aboutsummaryrefslogtreecommitdiff
path: root/src/guff/models/tab.cr
blob: 3649cdd79d00498a735abb721a7c976978faacef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
class Guff::TabModel < Guff::Model
  SQL = TemplateCache.new({
  } of Symbol => String)

  OLD_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.",
  }]

  TABS = {
    admin: [{
      "id":   "home",
      "css":  "active",
      "icon": "fa-home",
      "name": "Home",
      "text": "View home tab.",
    }, {
      "id":   "posts",
      "icon": "fa-cubes",
      "name": "Posts",
      "text": "Manage blog, pages, and projects.",
    }, {
      "id":   "files",
      "icon": "fa-files-o",
      "name": "Files",
      "text": "Manage files.",
    }, {
      "id":   "users",
      "icon": "fa-users",
      "name": "Users",
      "text": "Manage users and permissions.",
    }, {
      "id":   "settings",
      "icon": "fa-cog",
      "name": "Settings",
      "text": "Configure site settings.",
    }],

    post_new: [{
      "id":   "type",
      "icon": "",
      "name": "Choose Post Type",
      "text": "",
    }, {
      "id":   "blog",
      "icon": "",
      "name": "Create Blog Post",
      "text": "",
    }, {
      "id":   "page",
      "icon": "",
      "name": "Create Page",
      "text": "",
    }, {
      "id":   "project",
      "icon": "",
      "name": "Create Project",
      "text": "",
    }],
  }

  def initialize(models : Models)
    super(models, SQL)
  end

  def get_tabs(id : Symbol)
    TABS[id]
  end
end