diff options
Diffstat (limited to 'src/guff/views/dialogs/admin/site.cr')
-rw-r--r-- | src/guff/views/dialogs/admin/site.cr | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/guff/views/dialogs/admin/site.cr b/src/guff/views/dialogs/admin/site.cr index c03cd0a..b916fd7 100644 --- a/src/guff/views/dialogs/admin/site.cr +++ b/src/guff/views/dialogs/admin/site.cr @@ -1,9 +1,44 @@ class Guff::Views::Dialogs::Admin::Site < Guff::Views::HTMLView + TABS = [{ + :id => "content", + :css => "active", + :icon => "fa-pencil", + :name => "Content", + :text => "View content tab.", + }, { + :id => "theme", + :css => "", + :icon => "fa-eye", + :name => "Theme", + :text => "View theme tab.", + }, { + :id => "other", + :css => "", + :icon => "fa-ellipsis-h", + :name => "Other", + :text => "View other tab.", + }] + OPTION_TEMPLATES = { y: "<option value='%s' data-slug='%s' selected='selected'>%s</option>", n: "<option value='%s' data-slug='%s'>%s</option>", } + def initialize( + context : Context, + @id : String, + @name : String, + @save_name : String, + @save_icon : String, + @save_text : String, + ) + super(context) + end + + protected def tabs + super(@id, TABS) + end + private def theme_options @context.models.theme.all.map { |row| { @@ -18,4 +53,6 @@ class Guff::Views::Dialogs::Admin::Site < Guff::Views::HTMLView OPTION_TEMPLATES[tmpl_id] % %i{id slug name}.map { |k| row[k] } }.join("") end + + ECR.def_to_s("src/views/dialogs/admin/site.ecr") end |