From 49648c04226a692bc14ee642a8d96f15765b75de Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 31 Jul 2016 00:40:07 -0400 Subject: initial home panel dragging --- src/guff/views/pages/admin.cr | 1 + src/guff/views/panes/admin/home.cr | 103 +++++++++++++++++++++++++++++++++++++ src/views/panes/admin/home.ecr | 102 ++++++++++++++++++++++++++++++++++-- 3 files changed, 201 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/guff/views/pages/admin.cr b/src/guff/views/pages/admin.cr index 5ed95db..7113fbc 100644 --- a/src/guff/views/pages/admin.cr +++ b/src/guff/views/pages/admin.cr @@ -20,6 +20,7 @@ class Guff::Views::Pages::Admin < Guff::Views::HTMLView assets/ckeditor-4.5.8-custom/ckeditor.js assets/js/search-field.js assets/js/dropdown.js + assets/js/admin/tabs/home.js assets/js/admin/tabs/posts.js assets/js/admin/tabs/files.js assets/js/admin/tabs/import.js diff --git a/src/guff/views/panes/admin/home.cr b/src/guff/views/panes/admin/home.cr index b5be8c2..d7d1596 100644 --- a/src/guff/views/panes/admin/home.cr +++ b/src/guff/views/panes/admin/home.cr @@ -1,5 +1,108 @@ require "./pane" class Guff::Views::Panes::Admin::Home < Guff::Views::Panes::Admin::Pane + TEMPLATES = Template::Cache.new({ + "col" => %{ + + }.strip, + + "old-panel-edit" => %{ + + }.strip, + + "panel-edit" => %{ + + + + }.strip, + }) + + private def add_menu + # TODO + "" + end + + private def cols_menu + t = TEMPLATES["col"] + num_cols = 3 + + (1..4).map { |i| + t.run({ + "i" => i.to_s, + "s" => (i == 1) ? "" : "s", + "css" => (i == num_cols) ? "active" : "", + }) + }.join + end + + PANEL_EDIT = TEMPLATES["panel-edit"].run({} of String => String) + + private def panel_edit : String + PANEL_EDIT + end + ECR.def_to_s("src/views/panes/admin/home.ecr") end diff --git a/src/views/panes/admin/home.ecr b/src/views/panes/admin/home.ecr index af19b78..df0c7ec 100644 --- a/src/views/panes/admin/home.ecr +++ b/src/views/panes/admin/home.ecr @@ -6,16 +6,108 @@
-
<%= +
<%= new_post_button %>
+ + + + + +
+ + + +
-
-

- TODO: home -

+
+
+
+
+
+ <%= panel_edit %> + + + Some Panel + +
+ +
+

Some panel.

+
+
+
+ +
+
+
+ <%= panel_edit %> + + + Another Panel + +
+ +
+

Another panel.

+
+
+
+ +
+
+ +
+ <%= panel_edit %> + + + Third Panel + +
+ +
+

Third panel.

+
+
+
+
-- cgit v1.2.3