dhatu 0.3.6.pre.materialize → 0.3.7.pre.materialize
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/android-icon-144x144.png +0 -0
- data/app/assets/images/android-icon-192x192.png +0 -0
- data/app/assets/images/android-icon-36x36.png +0 -0
- data/app/assets/images/android-icon-48x48.png +0 -0
- data/app/assets/images/android-icon-72x72.png +0 -0
- data/app/assets/images/android-icon-96x96.png +0 -0
- data/app/assets/images/apple-icon-114x114.png +0 -0
- data/app/assets/images/apple-icon-120x120.png +0 -0
- data/app/assets/images/apple-icon-144x144.png +0 -0
- data/app/assets/images/apple-icon-152x152.png +0 -0
- data/app/assets/images/apple-icon-180x180.png +0 -0
- data/app/assets/images/apple-icon-57x57.png +0 -0
- data/app/assets/images/apple-icon-60x60.png +0 -0
- data/app/assets/images/apple-icon-72x72.png +0 -0
- data/app/assets/images/apple-icon-76x76.png +0 -0
- data/app/assets/images/apple-icon-precomposed.png +0 -0
- data/app/assets/images/apple-icon.png +0 -0
- data/app/assets/images/browserconfig.xml +2 -0
- data/app/assets/images/favicon-16x16.png +0 -0
- data/app/assets/images/favicon-32x32.png +0 -0
- data/app/assets/images/favicon-96x96.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/favicon.png +0 -0
- data/app/assets/images/logo-small.png +0 -0
- data/app/assets/images/logo-white-small.png +0 -0
- data/app/assets/images/logo-white.png +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/images/manifest.json +41 -0
- data/app/assets/images/ms-icon-144x144.png +0 -0
- data/app/assets/images/ms-icon-150x150.png +0 -0
- data/app/assets/images/ms-icon-310x310.png +0 -0
- data/app/assets/images/ms-icon-70x70.png +0 -0
- data/app/controllers/dhatu/application_controller.rb +2 -2
- data/app/controllers/dhatu/career_opportunities_controller.rb +2 -2
- data/app/controllers/dhatu/dashboard_controller.rb +165 -0
- data/app/controllers/dhatu/products_controller.rb +2 -2
- data/app/controllers/dhatu/projects_controller.rb +2 -2
- data/app/controllers/dhatu/services_controller.rb +2 -2
- data/app/models/dhatu/career_opportunity.rb +1 -1
- data/app/models/dhatu/category.rb +2 -10
- data/app/views/dhatu/dashboard/bootstrap4/_index.html.erb +41 -0
- data/app/views/dhatu/dashboard/index.html.erb +4 -4
- data/app/views/dhatu/dashboard/materialize/_index.html.erb +26 -0
- data/app/views/dhatu/dashboard/xenon/_index.html.erb +26 -0
- data/app/views/layouts/kuppayam/bootstrap4/_footer.html.erb +24 -0
- data/app/views/layouts/kuppayam/{_header.html.erb → bootstrap4/_header.html.erb} +0 -0
- data/app/views/layouts/kuppayam/bootstrap4/_navbar.html.erb +271 -0
- data/app/views/layouts/kuppayam/bootstrap4/_sidebar.html.erb +251 -0
- data/app/views/layouts/kuppayam/{_footer.html.erb → materialize/_footer.html.erb} +1 -1
- data/app/views/layouts/kuppayam/materialize/_header.html.erb +43 -0
- data/app/views/layouts/kuppayam/{_navbar.html.erb → materialize/_navbar.html.erb} +0 -0
- data/app/views/layouts/kuppayam/{_sidebar.html.erb → materialize/_sidebar.html.erb} +5 -5
- data/app/views/layouts/kuppayam/xenon/_footer.html.erb +25 -0
- data/app/views/layouts/kuppayam/xenon/_header.html.erb +43 -0
- data/app/views/layouts/kuppayam/xenon/_navbar.html.erb +55 -0
- data/app/views/layouts/kuppayam/xenon/_sidebar.html.erb +267 -0
- data/app/views/pattana/dashboard/_index.html.erb +1 -1
- data/app/views/usman/dashboard/_super_admin_index.html.erb +1 -1
- data/lib/dhatu/version.rb +1 -1
- metadata +55 -14
- data/app/views/dhatu/dashboard/_index.html.erb +0 -141
- data/app/views/layouts/dhatu/application.html.erb +0 -14
@@ -0,0 +1,26 @@
|
|
1
|
+
<% if (@dashboard_items[:dhatu_website_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
2
|
+
<h3 class="text-gray mt-50 mb-10">
|
3
|
+
Website Elements <br>
|
4
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
5
|
+
</h3>
|
6
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
7
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:dhatu_website_items] } %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if (@dashboard_items[:dhatu_marketing_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
11
|
+
<h3 class="text-gray mt-50 mb-10">
|
12
|
+
Marketing Elements <br>
|
13
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
14
|
+
</h3>
|
15
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
16
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:dhatu_marketing_items] } %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% if (@dashboard_items[:configuration_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
20
|
+
<h3 class="text-gray mt-50 mb-10">
|
21
|
+
Configurations <br>
|
22
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
23
|
+
</h3>
|
24
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
25
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:configuration_items] } %>
|
26
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<% if (@dashboard_items[:dhatu_website_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
2
|
+
<h3 class="text-gray mt-50 mb-10">
|
3
|
+
Website Elements <br>
|
4
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
5
|
+
</h3>
|
6
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
7
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:dhatu_website_items] } %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if (@dashboard_items[:dhatu_marketing_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
11
|
+
<h3 class="text-gray mt-50 mb-10">
|
12
|
+
Marketing Elements <br>
|
13
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
14
|
+
</h3>
|
15
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
16
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:dhatu_marketing_items] } %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% if (@dashboard_items[:configuration_items].map{|x, y| y[:has_permission] }).compact.uniq.any? %>
|
20
|
+
<h3 class="text-gray mt-50 mb-10">
|
21
|
+
Configurations <br>
|
22
|
+
<small class="text-muted">Manage All Elements of your websites and much more ...</small>
|
23
|
+
</h3>
|
24
|
+
<hr class="mb-30" style="border-top:1px solid #ddd;">
|
25
|
+
<%= render partial: "/layouts/dashboard/#{@current_layout}/items", locals: { items: @dashboard_items[:configuration_items] } %>
|
26
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<footer class="main-footer sticky footer-type-1">
|
2
|
+
|
3
|
+
<div class="footer-inner">
|
4
|
+
|
5
|
+
<!-- Add your copyright text here -->
|
6
|
+
<div class="footer-text">
|
7
|
+
© <%= Date.today.year %>
|
8
|
+
<strong>SBIDU</strong>
|
9
|
+
|
10
|
+
All rights reserved. <br>developed, maintained and hosted by <a href="http://rightsolutions.io" target="_blank" style="color:red">Right Solutions</a>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
</div>
|
14
|
+
|
15
|
+
</footer>
|
16
|
+
|
17
|
+
<style type="text/css">
|
18
|
+
.footer-text {
|
19
|
+
text-align: center;
|
20
|
+
bottom: 0px;
|
21
|
+
position: absolute;
|
22
|
+
width: 100%;
|
23
|
+
}
|
24
|
+
</style>
|
File without changes
|
@@ -0,0 +1,271 @@
|
|
1
|
+
<%
|
2
|
+
navbar_items = {}
|
3
|
+
navbar_items = {
|
4
|
+
dhatu_website_items: {
|
5
|
+
pages: {
|
6
|
+
text: "Pages",
|
7
|
+
icon_class: "fa-file",
|
8
|
+
url: dhatu.pages_url,
|
9
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Page)
|
10
|
+
},
|
11
|
+
categories: {
|
12
|
+
text: "Categories",
|
13
|
+
icon_class: "fa-sitemap",
|
14
|
+
url: dhatu.choose_category_type_url,
|
15
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Category)
|
16
|
+
},
|
17
|
+
projects: {
|
18
|
+
text: "Projects",
|
19
|
+
icon_class: "fa-tasks",
|
20
|
+
url: dhatu.projects_url,
|
21
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Project)
|
22
|
+
},
|
23
|
+
manufacturers: {
|
24
|
+
text: "Manufacturers",
|
25
|
+
icon_class: "fa-institution",
|
26
|
+
url: dhatu.manufacturers_url,
|
27
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Manufacturer)
|
28
|
+
},
|
29
|
+
products: {
|
30
|
+
text: "Products",
|
31
|
+
icon_class: "fa-th",
|
32
|
+
url: dhatu.products_url,
|
33
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Product)
|
34
|
+
},
|
35
|
+
services: {
|
36
|
+
text: "Services",
|
37
|
+
icon_class: "fa-wrench",
|
38
|
+
url: dhatu.services_url,
|
39
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Service)
|
40
|
+
},
|
41
|
+
photo_albums: {
|
42
|
+
text: "Photo Gallery",
|
43
|
+
icon_class: "fa-image",
|
44
|
+
url: dhatu.photo_albums_url,
|
45
|
+
has_permission: @current_user.has_read_permission?(Dhatu::PhotoAlbum)
|
46
|
+
},
|
47
|
+
prices: {
|
48
|
+
text: "Prices",
|
49
|
+
icon_class: "fa-dollar",
|
50
|
+
url: dhatu.prices_url,
|
51
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Price)
|
52
|
+
},
|
53
|
+
branches: {
|
54
|
+
text: "Branches",
|
55
|
+
icon_class: "fa-map-marker",
|
56
|
+
url: dhatu.branches_url,
|
57
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Branch)
|
58
|
+
},
|
59
|
+
events: {
|
60
|
+
text: "Events",
|
61
|
+
icon_class: "fa-calendar",
|
62
|
+
url: dhatu.events_url,
|
63
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Event)
|
64
|
+
},
|
65
|
+
testimonials: {
|
66
|
+
text: "Testimonials",
|
67
|
+
icon_class: "fa-comment",
|
68
|
+
url: dhatu.testimonials_url,
|
69
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Testimonial)
|
70
|
+
},
|
71
|
+
careers: {
|
72
|
+
text: "Careers",
|
73
|
+
icon_class: "fa-male",
|
74
|
+
url: dhatu.career_opportunities_url,
|
75
|
+
has_permission: @current_user.has_read_permission?(Dhatu::CareerOpportunity)
|
76
|
+
},
|
77
|
+
team: {
|
78
|
+
text: "Team",
|
79
|
+
icon_class: "fa-group",
|
80
|
+
url: dhatu.team_members_url,
|
81
|
+
has_permission: @current_user.has_read_permission?(Dhatu::TeamMember)
|
82
|
+
}
|
83
|
+
},
|
84
|
+
dhatu_marketing_items: {
|
85
|
+
promotions: {
|
86
|
+
text: "Promotions",
|
87
|
+
icon_class: "fa-gift",
|
88
|
+
url: dhatu.promotions_url,
|
89
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Promotion)
|
90
|
+
},
|
91
|
+
promotion_enquiries: {
|
92
|
+
text: "Promotional Enquiries",
|
93
|
+
icon_class: "fa-bullhorn",
|
94
|
+
url: dhatu.promotion_enquiries_url,
|
95
|
+
has_permission: @current_user.has_read_permission?(Dhatu::PromotionEnquiry)
|
96
|
+
},
|
97
|
+
bookings: {
|
98
|
+
text: "Bookings",
|
99
|
+
icon_class: "fa-calendar",
|
100
|
+
url: dhatu.bookings_url,
|
101
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Booking)
|
102
|
+
},
|
103
|
+
blog_posts: {
|
104
|
+
text: "Blog",
|
105
|
+
icon_class: "fa-newspaper-o",
|
106
|
+
url: dhatu.blog_posts_url,
|
107
|
+
has_permission: @current_user.has_read_permission?(Dhatu::BlogPost)
|
108
|
+
},
|
109
|
+
offers: {
|
110
|
+
text: "Offers",
|
111
|
+
icon_class: "fa-gift",
|
112
|
+
url: dhatu.offers_url,
|
113
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Offer)
|
114
|
+
}
|
115
|
+
},
|
116
|
+
configuration_items: {
|
117
|
+
features: {
|
118
|
+
text: "Manage Features",
|
119
|
+
icon_class: "fa-diamond",
|
120
|
+
url: usman.features_url,
|
121
|
+
has_permission: @current_user.has_read_permission?(Feature)
|
122
|
+
},
|
123
|
+
users: {
|
124
|
+
text: "Manage Users",
|
125
|
+
icon_class: "fa-user",
|
126
|
+
url: usman.users_url,
|
127
|
+
has_permission: @current_user.has_read_permission?(User)
|
128
|
+
},
|
129
|
+
registrations: {
|
130
|
+
text: "Manage Registrations",
|
131
|
+
icon_class: "fa-mobile",
|
132
|
+
url: usman.registrations_url,
|
133
|
+
has_permission: @current_user.has_read_permission?(Registration)
|
134
|
+
},
|
135
|
+
roles: {
|
136
|
+
text: "Manage Roles",
|
137
|
+
icon_class: "fa-graduation-cap",
|
138
|
+
url: usman.roles_url,
|
139
|
+
has_permission: @current_user.has_read_permission?(Role)
|
140
|
+
},
|
141
|
+
permissions: {
|
142
|
+
text: "Manage Permissions",
|
143
|
+
icon_class: "fa-lock",
|
144
|
+
url: usman.permissions_url,
|
145
|
+
has_permission: @current_user.has_read_permission?(Permission)
|
146
|
+
},
|
147
|
+
countries: {
|
148
|
+
text: "Manage Countries",
|
149
|
+
icon_class: "fa-flag-checkered",
|
150
|
+
url: pattana.countries_url,
|
151
|
+
has_permission: @current_user.has_read_permission?(Country)
|
152
|
+
},
|
153
|
+
regions: {
|
154
|
+
text: "Manage Regions",
|
155
|
+
icon_class: "fa-globe",
|
156
|
+
url: pattana.regions_url,
|
157
|
+
has_permission: @current_user.has_read_permission?(Region)
|
158
|
+
},
|
159
|
+
cities: {
|
160
|
+
text: "Manage Cities",
|
161
|
+
icon_class: "fa-map-marker",
|
162
|
+
url: pattana.cities_url,
|
163
|
+
has_permission: @current_user.has_read_permission?(City)
|
164
|
+
},
|
165
|
+
}
|
166
|
+
} if @current_user
|
167
|
+
%>
|
168
|
+
|
169
|
+
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
|
170
|
+
|
171
|
+
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="/">SBIDU</a>
|
172
|
+
|
173
|
+
<ul class="navbar-nav bd-navbar-nav flex-row">
|
174
|
+
|
175
|
+
<li class="nav-item">
|
176
|
+
<!-- Admin Dashboard -->
|
177
|
+
<% if @current_user %>
|
178
|
+
<% if @current_user.super_admin? || @current_user.has_role?("Site Admin") %>
|
179
|
+
|
180
|
+
<% active_class = nav_active?('admin/dashboard') ? 'active' : '' %>
|
181
|
+
<% begin %>
|
182
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), main_app.dashboard_path, class: "nav-link #{active_class}" %>
|
183
|
+
<% rescue %>
|
184
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), dhatu.dashboard_path, class: "nav-link #{active_class}" %>
|
185
|
+
<% end %>
|
186
|
+
<% else %>
|
187
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), usman.my_account_url, class: "nav-link #{active_class}" %>
|
188
|
+
<% end %>
|
189
|
+
<% end %>
|
190
|
+
</li>
|
191
|
+
|
192
|
+
<% if navbar_items[:dhatu_website_items] && navbar_items[:dhatu_website_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
193
|
+
|
194
|
+
<li class="nav-item dropdown">
|
195
|
+
<a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
196
|
+
Website
|
197
|
+
</a>
|
198
|
+
<div class="dropdown-menu dropdown-menu-left" aria-labelledby="bd-versions">
|
199
|
+
<% navbar_items[:dhatu_website_items].each do |key, values| %>
|
200
|
+
<% next unless values[:has_permission] %>
|
201
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "dropdown-item" %>
|
202
|
+
<% end %>
|
203
|
+
</div>
|
204
|
+
</li>
|
205
|
+
<% end %>
|
206
|
+
|
207
|
+
<% if navbar_items[:dhatu_marketing_items] && navbar_items[:dhatu_marketing_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
208
|
+
|
209
|
+
<li class="nav-item dropdown">
|
210
|
+
<a class="nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
211
|
+
Marketing
|
212
|
+
</a>
|
213
|
+
<div class="dropdown-menu dropdown-menu-left" aria-labelledby="bd-versions">
|
214
|
+
<% navbar_items[:dhatu_marketing_items].each do |key, values| %>
|
215
|
+
<% next unless values[:has_permission] %>
|
216
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "dropdown-item" %>
|
217
|
+
<% end %>
|
218
|
+
</div>
|
219
|
+
</li>
|
220
|
+
<% end %>
|
221
|
+
|
222
|
+
<% if navbar_items[:configuration_items] && navbar_items[:configuration_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
223
|
+
|
224
|
+
<li class="nav-item dropdown">
|
225
|
+
<a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
226
|
+
Configurations
|
227
|
+
</a>
|
228
|
+
<div class="dropdown-menu dropdown-menu-left" aria-labelledby="bd-versions">
|
229
|
+
<% navbar_items[:configuration_items].each do |key, values| %>
|
230
|
+
<% next unless values[:has_permission] %>
|
231
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "dropdown-item" %>
|
232
|
+
<% end %>
|
233
|
+
</div>
|
234
|
+
</li>
|
235
|
+
<% end %>
|
236
|
+
|
237
|
+
</ul>
|
238
|
+
|
239
|
+
<ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
|
240
|
+
<li class="nav-item"></li>
|
241
|
+
</ul>
|
242
|
+
|
243
|
+
<ul class="navbar-nav px-3">
|
244
|
+
|
245
|
+
<li class="nav-item dropdown">
|
246
|
+
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
|
247
|
+
<%= display_image(@current_user, "profile_picture.image.small.url", width: "18", height: "auto", class: "img-circle img-inline", alt: @current_user.display_name) if @current_user %>
|
248
|
+
</a>
|
249
|
+
|
250
|
+
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions">
|
251
|
+
<a class="dropdown-item" href="#settings">
|
252
|
+
<i class="fa fa-wrench pr-5"></i>
|
253
|
+
Settings
|
254
|
+
</a>
|
255
|
+
|
256
|
+
<a class="dropdown-item" href="#profile">
|
257
|
+
<i class="fa fa-user pr-5"></i>
|
258
|
+
Profile
|
259
|
+
</a>
|
260
|
+
|
261
|
+
<a class="dropdown-item" href="#help">
|
262
|
+
<i class="fa fa-info pr-5"></i>
|
263
|
+
Help
|
264
|
+
</a>
|
265
|
+
|
266
|
+
<%= link_to raw("<i class='fa fa-lock pr-5'></i>Sign Out"), usman.sign_out_path, method: :delete, class: "dropdown-item" %>
|
267
|
+
</div>
|
268
|
+
</li>
|
269
|
+
|
270
|
+
</ul>
|
271
|
+
</nav>
|
@@ -0,0 +1,251 @@
|
|
1
|
+
<%
|
2
|
+
sidebar_items = {}
|
3
|
+
sidebar_items = {
|
4
|
+
dhatu_website_items: {
|
5
|
+
pages: {
|
6
|
+
text: "Pages",
|
7
|
+
icon_class: "fa-file",
|
8
|
+
url: dhatu.pages_url,
|
9
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Page)
|
10
|
+
},
|
11
|
+
categories: {
|
12
|
+
text: "Categories",
|
13
|
+
icon_class: "fa-sitemap",
|
14
|
+
url: dhatu.choose_category_type_url,
|
15
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Category)
|
16
|
+
},
|
17
|
+
projects: {
|
18
|
+
text: "Projects",
|
19
|
+
icon_class: "fa-tasks",
|
20
|
+
url: dhatu.projects_url,
|
21
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Project)
|
22
|
+
},
|
23
|
+
manufacturers: {
|
24
|
+
text: "Manufacturers",
|
25
|
+
icon_class: "fa-institution",
|
26
|
+
url: dhatu.manufacturers_url,
|
27
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Manufacturer)
|
28
|
+
},
|
29
|
+
products: {
|
30
|
+
text: "Products",
|
31
|
+
icon_class: "fa-th",
|
32
|
+
url: dhatu.products_url,
|
33
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Product)
|
34
|
+
},
|
35
|
+
services: {
|
36
|
+
text: "Services",
|
37
|
+
icon_class: "fa-wrench",
|
38
|
+
url: dhatu.services_url,
|
39
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Service)
|
40
|
+
},
|
41
|
+
photo_albums: {
|
42
|
+
text: "Photo Gallery",
|
43
|
+
icon_class: "fa-image",
|
44
|
+
url: dhatu.photo_albums_url,
|
45
|
+
has_permission: @current_user.has_read_permission?(Dhatu::PhotoAlbum)
|
46
|
+
},
|
47
|
+
prices: {
|
48
|
+
text: "Prices",
|
49
|
+
icon_class: "fa-dollar",
|
50
|
+
url: dhatu.prices_url,
|
51
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Price)
|
52
|
+
},
|
53
|
+
branches: {
|
54
|
+
text: "Branches",
|
55
|
+
icon_class: "fa-map-marker",
|
56
|
+
url: dhatu.branches_url,
|
57
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Branch)
|
58
|
+
},
|
59
|
+
events: {
|
60
|
+
text: "Events",
|
61
|
+
icon_class: "fa-calendar",
|
62
|
+
url: dhatu.events_url,
|
63
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Event)
|
64
|
+
},
|
65
|
+
testimonials: {
|
66
|
+
text: "Testimonials",
|
67
|
+
icon_class: "fa-comment",
|
68
|
+
url: dhatu.testimonials_url,
|
69
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Testimonial)
|
70
|
+
},
|
71
|
+
careers: {
|
72
|
+
text: "Careers",
|
73
|
+
icon_class: "fa-male",
|
74
|
+
url: dhatu.career_opportunities_url,
|
75
|
+
has_permission: @current_user.has_read_permission?(Dhatu::CareerOpportunity)
|
76
|
+
},
|
77
|
+
team: {
|
78
|
+
text: "Team",
|
79
|
+
icon_class: "fa-group",
|
80
|
+
url: dhatu.team_members_url,
|
81
|
+
has_permission: @current_user.has_read_permission?(Dhatu::TeamMember)
|
82
|
+
}
|
83
|
+
},
|
84
|
+
dhatu_marketing_items: {
|
85
|
+
promotions: {
|
86
|
+
text: "Promotions",
|
87
|
+
icon_class: "fa-gift",
|
88
|
+
url: dhatu.promotions_url,
|
89
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Promotion)
|
90
|
+
},
|
91
|
+
promotion_enquiries: {
|
92
|
+
text: "Promotional Enquiries",
|
93
|
+
icon_class: "fa-bullhorn",
|
94
|
+
url: dhatu.promotion_enquiries_url,
|
95
|
+
has_permission: @current_user.has_read_permission?(Dhatu::PromotionEnquiry)
|
96
|
+
},
|
97
|
+
bookings: {
|
98
|
+
text: "Bookings",
|
99
|
+
icon_class: "fa-calendar",
|
100
|
+
url: dhatu.bookings_url,
|
101
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Booking)
|
102
|
+
},
|
103
|
+
blog_posts: {
|
104
|
+
text: "Blog",
|
105
|
+
icon_class: "fa-newspaper-o",
|
106
|
+
url: dhatu.blog_posts_url,
|
107
|
+
has_permission: @current_user.has_read_permission?(Dhatu::BlogPost)
|
108
|
+
},
|
109
|
+
offers: {
|
110
|
+
text: "Offers",
|
111
|
+
icon_class: "fa-gift",
|
112
|
+
url: dhatu.offers_url,
|
113
|
+
has_permission: @current_user.has_read_permission?(Dhatu::Offer)
|
114
|
+
}
|
115
|
+
},
|
116
|
+
configuration_items: {
|
117
|
+
features: {
|
118
|
+
text: "Manage Features",
|
119
|
+
icon_class: "fa-diamond",
|
120
|
+
url: usman.features_url,
|
121
|
+
has_permission: @current_user.has_read_permission?(Feature)
|
122
|
+
},
|
123
|
+
users: {
|
124
|
+
text: "Manage Users",
|
125
|
+
icon_class: "fa-user",
|
126
|
+
url: usman.users_url,
|
127
|
+
has_permission: @current_user.has_read_permission?(User)
|
128
|
+
},
|
129
|
+
registrations: {
|
130
|
+
text: "Manage Registrations",
|
131
|
+
icon_class: "fa-mobile",
|
132
|
+
url: usman.registrations_url,
|
133
|
+
has_permission: @current_user.has_read_permission?(Registration)
|
134
|
+
},
|
135
|
+
roles: {
|
136
|
+
text: "Manage Roles",
|
137
|
+
icon_class: "fa-graduation-cap",
|
138
|
+
url: usman.roles_url,
|
139
|
+
has_permission: @current_user.has_read_permission?(Role)
|
140
|
+
},
|
141
|
+
permissions: {
|
142
|
+
text: "Manage Permissions",
|
143
|
+
icon_class: "fa-lock",
|
144
|
+
url: usman.permissions_url,
|
145
|
+
has_permission: @current_user.has_read_permission?(Permission)
|
146
|
+
},
|
147
|
+
countries: {
|
148
|
+
text: "Manage Countries",
|
149
|
+
icon_class: "fa-flag-checkered",
|
150
|
+
url: pattana.countries_url,
|
151
|
+
has_permission: @current_user.has_read_permission?(Country)
|
152
|
+
},
|
153
|
+
regions: {
|
154
|
+
text: "Manage Regions",
|
155
|
+
icon_class: "fa-globe",
|
156
|
+
url: pattana.regions_url,
|
157
|
+
has_permission: @current_user.has_read_permission?(Region)
|
158
|
+
},
|
159
|
+
cities: {
|
160
|
+
text: "Manage Cities",
|
161
|
+
icon_class: "fa-map-marker",
|
162
|
+
url: pattana.cities_url,
|
163
|
+
has_permission: @current_user.has_read_permission?(City)
|
164
|
+
},
|
165
|
+
}
|
166
|
+
} if @current_user
|
167
|
+
%>
|
168
|
+
|
169
|
+
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
|
170
|
+
<div class="sidebar-sticky">
|
171
|
+
|
172
|
+
<ul class="nav flex-column">
|
173
|
+
<li class="nav-item">
|
174
|
+
<!-- Admin Dashboard -->
|
175
|
+
<% if @current_user %>
|
176
|
+
<% if @current_user.super_admin? || @current_user.has_role?("Site Admin") %>
|
177
|
+
|
178
|
+
<% active_class = nav_active?('admin/dashboard') ? 'active' : '' %>
|
179
|
+
<% begin %>
|
180
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), main_app.dashboard_path, class: "nav-link #{active_class}" %>
|
181
|
+
<% rescue %>
|
182
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), dhatu.dashboard_path, class: "nav-link #{active_class}" %>
|
183
|
+
<% end %>
|
184
|
+
<% else %>
|
185
|
+
<%= link_to raw("<i class=\"fa fa-desktop\"></i> <span class='title'>Dashboard</span>"), usman.my_account_url, class: "nav-link #{active_class}" %>
|
186
|
+
<% end %>
|
187
|
+
<% end %>
|
188
|
+
</li>
|
189
|
+
</ul>
|
190
|
+
|
191
|
+
<% if sidebar_items[:dhatu_website_items] && sidebar_items[:dhatu_website_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
192
|
+
<ul class="nav flex-column">
|
193
|
+
|
194
|
+
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-40 mb-1 text-muted">
|
195
|
+
<span>Website Elements</span>
|
196
|
+
<a class="d-flex align-items-center text-muted" href="#">
|
197
|
+
</a>
|
198
|
+
</h6>
|
199
|
+
|
200
|
+
<% sidebar_items[:dhatu_website_items].each do |key, values| %>
|
201
|
+
<% next unless values[:has_permission] %>
|
202
|
+
|
203
|
+
<li class="nav-item">
|
204
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "nav-link" %>
|
205
|
+
</li>
|
206
|
+
<% end %>
|
207
|
+
</ul>
|
208
|
+
<% end %>
|
209
|
+
|
210
|
+
<% if sidebar_items[:dhatu_marketing_items] && sidebar_items[:dhatu_marketing_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
211
|
+
<ul class="nav flex-column">
|
212
|
+
|
213
|
+
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-40 mb-1 text-muted">
|
214
|
+
<span>Marketing Elements</span>
|
215
|
+
<a class="d-flex align-items-center text-muted" href="#">
|
216
|
+
</a>
|
217
|
+
</h6>
|
218
|
+
|
219
|
+
<% sidebar_items[:dhatu_marketing_items].each do |key, values| %>
|
220
|
+
<% next unless values[:has_permission] %>
|
221
|
+
|
222
|
+
<li class="nav-item">
|
223
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "nav-link" %>
|
224
|
+
</li>
|
225
|
+
<% end %>
|
226
|
+
</ul>
|
227
|
+
<% end %>
|
228
|
+
|
229
|
+
<% if sidebar_items[:configuration_items] && sidebar_items[:configuration_items].map{|x,y| x if y[:has_permission] }.compact.any? %>
|
230
|
+
<ul class="nav flex-column">
|
231
|
+
|
232
|
+
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-40 mb-1 text-muted">
|
233
|
+
<span>Configurations</span>
|
234
|
+
<a class="d-flex align-items-center text-muted" href="#">
|
235
|
+
</a>
|
236
|
+
</h6>
|
237
|
+
|
238
|
+
<% sidebar_items[:configuration_items].each do |key, values| %>
|
239
|
+
<% next unless values[:has_permission] %>
|
240
|
+
|
241
|
+
<li class="nav-item">
|
242
|
+
<%= link_to raw("<i class=\"fa #{values[:icon_class]} pr-5 \"></i> <span class='title'>#{values[:text]}</span>"), values[:url], class: "nav-link" %>
|
243
|
+
</li>
|
244
|
+
<% end %>
|
245
|
+
</ul>
|
246
|
+
<% end %>
|
247
|
+
|
248
|
+
<div class="pb-70"></div>
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</nav>
|