From 6ff8fd4e02cb962c9e2d1e90691324c67f58c4e8 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 2 Apr 2016 23:14:45 -0400 Subject: add test auth panel tabs --- data/stuff/test/auth.js | 4 +- src/guff/models.cr | 1 + src/guff/models/tab.cr | 50 +++++++ src/guff/views/ecrs/test/auth.ecr | 265 +++++++++++++++++++++++--------------- src/guff/views/html/test/auth.cr | 28 +++- 5 files changed, 244 insertions(+), 104 deletions(-) create mode 100644 src/guff/models/tab.cr diff --git a/data/stuff/test/auth.js b/data/stuff/test/auth.js index 5e98425..18bfc49 100644 --- a/data/stuff/test/auth.js +++ b/data/stuff/test/auth.js @@ -279,5 +279,7 @@ jQuery(function($) { $('#reload').click(reload); // load users - reload(); + $('#tab-users').on('show.bs.tab', function() { + reload(); + }); }); diff --git a/src/guff/models.cr b/src/guff/models.cr index 4b6a46f..087c488 100644 --- a/src/guff/models.cr +++ b/src/guff/models.cr @@ -36,6 +36,7 @@ module Guff session: SessionModel, user: UserModel, role: RoleModel, + tab: TabModel, }) end end diff --git a/src/guff/models/tab.cr b/src/guff/models/tab.cr new file mode 100644 index 0000000..3fe5133 --- /dev/null +++ b/src/guff/models/tab.cr @@ -0,0 +1,50 @@ +class Guff::TabModel < Guff::Model + SQL = TemplateCache.new({ + } of Symbol => String) + + TABS = [{ + "id": "home", + "css": "active", + "icon": "fa-home", + "name": "Home", + "text": "View home tab.", + }, { + "id": "blog", + "icon": "fa-bullhorn", + "name": "Blog", + "text": "Add, view, and edit blog posts.", + }, { + "id": "files", + "icon": "fa-files-o", + "name": "Files", + "text": "Add, view, and edit files.", + }, { + "id": "pages", + "icon": "fa-bookmark-o", + "name": "Pages", + "text": "Add, view, and edit pages.", + }, { + "id": "projects", + "icon": "fa-cubes", + "name": "Projects", + "text": "Add, view, and edit projects.", + }, { + "id": "users", + "icon": "fa-users", + "name": "Users", + "text": "Add, view, and edit users and permissions.", + }, { + "id": "settings", + "icon": "fa-cog", + "name": "Settings", + "text": "Configure site settings.", + }] + + def initialize(models : Models) + super(models, SQL) + end + + def get_tabs + TABS + end +end diff --git a/src/guff/views/ecrs/test/auth.ecr b/src/guff/views/ecrs/test/auth.ecr index bea7adb..e377962 100644 --- a/src/guff/views/ecrs/test/auth.ecr +++ b/src/guff/views/ecrs/test/auth.ecr @@ -16,110 +16,171 @@
-
-
-
- - - Users - -
- - + +
+
+
+

+ TODO: settings +

+
+
+
+
+