usman 0.4.7.pre.materialize → 0.4.8.pre.materialize

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/usman/api/v1/docs_controller.rb +2 -2
  3. data/app/controllers/usman/application_controller.rb +0 -10
  4. data/app/controllers/usman/features_controller.rb +20 -15
  5. data/app/controllers/usman/resource_controller.rb +1 -0
  6. data/app/controllers/usman/sessions_controller.rb +5 -1
  7. data/app/controllers/usman/users_controller.rb +2 -2
  8. data/app/models/feature.rb +2 -4
  9. data/app/views/layouts/kuppayam/{_footer.html.erb → materialize/_footer.html.erb} +0 -0
  10. data/app/views/layouts/kuppayam/{_header.html.erb → materialize/_header.html.erb} +0 -0
  11. data/app/views/layouts/kuppayam/{_navbar.html.erb → materialize/_navbar.html.erb} +0 -0
  12. data/app/views/layouts/kuppayam/{_sidebar.html.erb → materialize/_sidebar.html.erb} +2 -2
  13. data/app/views/layouts/kuppayam/xenon/_footer.html.erb +25 -0
  14. data/app/views/layouts/kuppayam/xenon/_header.html.erb +43 -0
  15. data/app/views/layouts/kuppayam/xenon/_navbar.html.erb +55 -0
  16. data/app/views/layouts/kuppayam/xenon/_sidebar.html.erb +175 -0
  17. data/app/views/layouts/kuppayam/{profile.html.erb → xenon/profile.html.erb} +0 -0
  18. data/app/views/usman/dashboard/bootstrap4/_index.html.erb +40 -0
  19. data/app/views/usman/dashboard/bootstrap4/_super_admin_index.html.erb +22 -0
  20. data/app/views/usman/dashboard/materialize/_index.html.erb +40 -0
  21. data/app/views/usman/dashboard/materialize/_super_admin_index.html.erb +22 -0
  22. data/app/views/usman/dashboard/{_index.html.erb → xenon/_index.html.erb} +2 -2
  23. data/app/views/usman/dashboard/{_super_admin_index.html.erb → xenon/_super_admin_index.html.erb} +1 -1
  24. data/app/views/usman/features/_form.html.erb +1 -0
  25. data/app/views/usman/features/index.html.erb +18 -0
  26. data/db/migrate/20180515030422_add_feature_category_to_features.rb +23 -0
  27. data/lib/usman/version.rb +1 -1
  28. metadata +22 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 419f3d7642de408924fce9263bd0023def32a14decc626e43ec8942f1bf0af01
4
- data.tar.gz: 55f104be6aec796794e4e2371fe66f790e2dc5a4ef517abd9f74ff2ba609e078
3
+ metadata.gz: 66dc8ae67a0f4b53e9c47c8bddd8d29c3779d87bcfe022e8cee1864e2fb3cfc1
4
+ data.tar.gz: ab508cc18eecdd1573af41bdc55f66b26b55a3732d7a88e274d35752bdc3c20e
5
5
  SHA512:
6
- metadata.gz: 36b2940fa7975409c63d048b7ac424416e0004463a1bfb5416e9480eb92b60a6a5611a2cfe10e2cdfd68ac44ea09644f80a9294aabe1aed72907e66fad8f83f5
7
- data.tar.gz: 14f120a3e96dad545b5d208b523b88b65797b14a02ec3c75f32d2c2cfbeaff2895ea51d71c64bc0a2da045b6e39c9adc395a0f35e2694be58c47514891884737
6
+ metadata.gz: 874a83bd0cbae9dd9d942fb8e5c537084a9bb48e7dec9ffdd574fdf7161f358391a41637d998d51d1e82daaf763e096816f8b0e85190b8abdded1a71b99cb208
7
+ data.tar.gz: e633d77de6328007a0cd4f3b63c49e71c13a36073ad6fb82588a34c920abbaabb9d4e89f088637fa8cecbec1042bb4514be5310576226df5c1ecbc5f294abffc
@@ -453,7 +453,7 @@ module Usman
453
453
 
454
454
  def set_nav_items
455
455
  @nav_items = {
456
- register: { nav_class: "docs/usman/register", icon_class: "fa-group", url: usman.docs_api_v1_register_path, text: "Registraions API"},
456
+ register: { nav_class: "docs/usman/register", icon_class: "fa-user", url: usman.docs_api_v1_register_path, text: "Registraions API"},
457
457
  resend_otp: { nav_class: "docs/usman/resend_otp", icon_class: "fa-send", url: usman.docs_api_v1_resend_otp_path, text: "Resend OTP API"},
458
458
  verify_otp: { nav_class: "docs/usman/verify_otp", icon_class: "fa-thumbs-up", url: usman.docs_api_v1_verify_otp_path, text: "Verify OTP API"},
459
459
  accept_tac: { nav_class: "docs/usman/accept_tac", icon_class: "fa-check-square-o", url: usman.docs_api_v1_accept_tac_path, text: "Accept T&C API"},
@@ -474,7 +474,7 @@ module Usman
474
474
 
475
475
  def set_tab_items
476
476
  @tab_items = {
477
- usman: { nav_class: "docs/usman", icon_class: "fa-group", url: usman.docs_api_v1_register_path, text: "User APIs"}
477
+ usman: { nav_class: "docs/usman", icon_class: "fa-user", url: usman.docs_api_v1_register_path, text: "User APIs"}
478
478
  }
479
479
  end
480
480
 
@@ -3,8 +3,6 @@ module Usman
3
3
 
4
4
  include Usman::AuthenticationHelper
5
5
 
6
- layout 'kuppayam/xenon/admin'
7
-
8
6
  before_action :current_user
9
7
  before_action :require_user
10
8
 
@@ -12,14 +10,6 @@ module Usman
12
10
 
13
11
  private
14
12
 
15
- def stylesheet_filename
16
- @stylesheet_filename = "kuppayam-xenon"
17
- end
18
-
19
- def javascript_filename
20
- @javascript_filename = "kuppayam-xenon"
21
- end
22
-
23
13
  def set_default_title
24
14
  set_title("Usman Admin | User Management Module")
25
15
  end
@@ -4,17 +4,9 @@ module Usman
4
4
  before_action :require_super_admin
5
5
 
6
6
  def update_permission
7
- @permission = Permission.find_by_id(params[:permission_id])
8
7
  @user = User.find_by_id(params[:user_id])
9
- if @permission
10
- begin
11
- @permission.toggle!(params[:permission_for])
12
- @success = true
13
- rescue
14
- @success = false
15
- end
16
- else
17
- @permission = Permission.new(user: @user, can_read: false, feature_id: params[:id])
8
+ @permission = Permission.find_by_id(params[:permission_id]) || Permission.where(user: @user, feature_id: params[:id]).first || Permission.new(user: @user, can_read: false, feature_id: params[:id])
9
+ if @permission.new_record?
18
10
  @permission.assign_attributes(params[:permission_for] => true)
19
11
  if @permission.valid?
20
12
  @permission.save
@@ -22,6 +14,13 @@ module Usman
22
14
  else
23
15
  @success = false
24
16
  end
17
+ else
18
+ begin
19
+ @permission.toggle!(params[:permission_for])
20
+ @success = true
21
+ rescue
22
+ @success = false
23
+ end
25
24
  end
26
25
  end
27
26
 
@@ -33,6 +32,7 @@ module Usman
33
32
  end
34
33
 
35
34
  def get_collections
35
+ @feature_categories = Feature.select("DISTINCT feature_category").map(&:feature_category)
36
36
  @relation = Feature.includes(:cover_image).where("")
37
37
 
38
38
  parse_filters
@@ -47,6 +47,10 @@ module Usman
47
47
  @relation = @relation.search(@query) if @query
48
48
  @relation = @relation.status(@status) if @status
49
49
 
50
+ # Set first feature category as default feature category
51
+ @feature_category = @feature_categories.first if @feature_category.blank?
52
+ @relation = @relation.where(feature_category: @feature_category)
53
+
50
54
  @order_by = "created_at desc" unless @order_by
51
55
  @relation = @relation.order(@order_by)
52
56
  end
@@ -55,7 +59,8 @@ module Usman
55
59
  @filter_settings = {
56
60
  string_filters: [
57
61
  { filter_name: :query },
58
- { filter_name: :status }
62
+ { filter_name: :status },
63
+ { filter_name: :feature_category },
59
64
  ],
60
65
  boolean_filters: [],
61
66
  reference_filters: [],
@@ -68,13 +73,13 @@ module Usman
68
73
  status: {
69
74
  object_filter: false,
70
75
  select_label: "Select Status",
71
- display_hash: Feature::STATUS,
76
+ display_hash: Feature::STATUS_REVERSE,
72
77
  current_value: @status,
73
- values: Feature::STATUS_REVERSE,
78
+ values: Feature::STATUS,
74
79
  current_filters: @filters,
75
80
  filters_to_remove: [],
76
81
  filters_to_add: {},
77
- url_method_name: 'users_url',
82
+ url_method_name: 'features_url',
78
83
  show_all_filter_on_top: true
79
84
  }
80
85
  }
@@ -101,7 +106,7 @@ module Usman
101
106
  end
102
107
 
103
108
  def permitted_params
104
- params.require(:feature).permit(:name, :categorisable)
109
+ params.require(:feature).permit(:name, :categorisable, :feature_category)
105
110
  end
106
111
 
107
112
  def set_navs
@@ -20,6 +20,7 @@ module Usman
20
20
  @filter_param_mapping[:super_admin] = :sa
21
21
  @filter_param_mapping[:user] = :us
22
22
  @filter_param_mapping[:feature] = :ft
23
+ @filter_param_mapping[:feature_category] = :fc
23
24
  end
24
25
  end
25
26
  end
@@ -86,6 +86,10 @@ module Usman
86
86
  def user_params
87
87
  params[:user].permit(:password, :password_confirmation, :reset_password_token)
88
88
  end
89
-
89
+
90
+ def determine_layout
91
+ "kuppayam/#{@current_layout}/blank"
92
+ end
93
+
90
94
  end
91
95
  end
@@ -130,10 +130,10 @@ module Usman
130
130
  def breadcrumbs_configuration
131
131
  {
132
132
  heading: "Manage Users",
133
- icon: "fa-group",
133
+ icon: "fa-user",
134
134
  description: "Listing all Users",
135
135
  links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
136
- {name: "Manage Users", link: users_path, icon: 'fa-group', active: true}]
136
+ {name: "Manage Users", link: users_path, icon: 'fa-user', active: true}]
137
137
  }
138
138
  end
139
139
 
@@ -18,10 +18,8 @@ class Feature < Usman::ApplicationRecord
18
18
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
19
19
 
20
20
  # Validations
21
- validates :name, presence: true, length: {minimum: 3, maximum: 250}
22
-
23
-
24
-
21
+ validates :name, presence: true, length: {minimum: 3, maximum: 250}
22
+ validates :feature_category, presence: true, length: {minimum: 2, maximum: 64}
25
23
 
26
24
  # ------------------
27
25
  # Class Methods
@@ -103,7 +103,7 @@
103
103
 
104
104
  <li class="">
105
105
  <a href="#">
106
- <i class="fa-group"></i>
106
+ <i class="fa-user"></i>
107
107
  <span class="title">Manage Users</span>
108
108
  </a>
109
109
  <ul>
@@ -161,7 +161,7 @@
161
161
  <ul>
162
162
  <li class="">
163
163
  <a href="/docs/api/v1/register">
164
- <i class="fa-group"></i>
164
+ <i class="fa-user"></i>
165
165
  <span class="title">Authentication APIs</span>
166
166
  </a>
167
167
  </li>
@@ -0,0 +1,25 @@
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
+ &copy; 2017
8
+ <strong>Kuppayam</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
+
14
+ <!-- Go to Top Link, just add rel="go-top" to any link to add this functionality -->
15
+ <div class="go-up">
16
+
17
+ <a href="#" rel="go-top">
18
+ <i class="fa-angle-up"></i>
19
+ </a>
20
+
21
+ </div>
22
+
23
+ </div>
24
+
25
+ </footer>
@@ -0,0 +1,43 @@
1
+ <div class="top-bar">
2
+ <div class="top-bar-left">
3
+ <ul class="dropdown menu" data-dropdown-menu>
4
+ <li class="menu-text">Site Title</li>
5
+ <li>
6
+ <a href="#">One</a>
7
+ <ul class="menu vertical">
8
+ <li><a href="#">One</a></li>
9
+ <li><a href="#">Two</a></li>
10
+ <li><a href="#">Three</a></li>
11
+ </ul>
12
+ </li>
13
+ <li><a href="#">Two</a></li>
14
+ <li><a href="#">Three</a></li>
15
+ </ul>
16
+ </div>
17
+ <div class="top-bar-right">
18
+ <ul class="menu">
19
+ <li><input type="search" placeholder="Search"></li>
20
+ <li><button type="button" class="button">Search</button></li>
21
+ </ul>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="header mb-40">
26
+
27
+ <div class="visible-xs pull-left mt-10">
28
+ <a href="#menu-toggle" class="btn btn-default" id="menu-toggle"><i class="fa fa-list"></i></a>
29
+ <%#= theme_button('', 'list', "#menu-toggle", btn_type: "default", id: "menu-toggle", classes: "") %>
30
+ </div>
31
+
32
+ <div class="pull-right mt-10">
33
+ <% if @current_user %>
34
+ <span style="color:#898989;">Welcome</span> <span style="color:#4b4b4b;"><%= @current_user.name %></span>
35
+ &nbsp;&nbsp;|&nbsp;&nbsp;
36
+ <%= link_to raw("Sign Out"), usman.sign_out_path, method: :delete %>
37
+ <% else %>
38
+ <%= link_to raw("Sign In"), "#" %>
39
+ <% end %>
40
+ </div>
41
+ <div class="cl-10"></div>
42
+ </div>
43
+
@@ -0,0 +1,55 @@
1
+ <nav class="navbar user-info-navbar" role="navigation"><!-- User Info, Notifications and Menu Bar -->
2
+
3
+ <!-- Left links for user info navbar -->
4
+ <ul class="user-info-menu left-links list-inline list-unstyled">
5
+
6
+ <li class="hidden-sm hidden-xs">
7
+ <a href="#" data-toggle="sidebar">
8
+ <i class="fa-bars"></i>
9
+ </a>
10
+ </li>
11
+
12
+ </ul>
13
+
14
+ <!-- Right links for user info navbar -->
15
+ <ul class="user-info-menu right-links list-inline list-unstyled">
16
+ <li class="dropdown user-profile">
17
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
18
+
19
+ <%= display_image(@current_user, "profile_picture.image.small.url", width: "32", height: "auto", class: "img-circle img-inline userpic-32", alt: @current_user.display_name) %>
20
+
21
+ <span>
22
+ <%= @current_user.display_name %>
23
+ <i class="fa-angle-down"></i>
24
+ </span>
25
+
26
+ </a>
27
+
28
+ <ul class="dropdown-menu user-profile-menu list-unstyled">
29
+ <li>
30
+ <a href="#settings">
31
+ <i class="fa-wrench"></i>
32
+ Settings
33
+ </a>
34
+ </li>
35
+ <li>
36
+ <a href="#profile">
37
+ <i class="fa-user"></i>
38
+ Profile
39
+ </a>
40
+ </li>
41
+ <li>
42
+ <a href="#help">
43
+ <i class="fa-info"></i>
44
+ Help
45
+ </a>
46
+ </li>
47
+ <li class="last">
48
+ <%= link_to raw("<i class='fa-lock'></i>Sign Out"), usman.sign_out_path, method: :delete %>
49
+ </li>
50
+ </ul>
51
+ </li>
52
+
53
+ </ul>
54
+
55
+ </nav>
@@ -0,0 +1,175 @@
1
+ <%
2
+ user_items = {
3
+ users: {
4
+ text: "Manage Users",
5
+ icon_class: "fa-user",
6
+ url: usman.users_url,
7
+ has_permission: @current_user.has_read_permission?(User)
8
+ },
9
+ registrations: {
10
+ text: "Manage Registrations",
11
+ icon_class: "fa-mobile",
12
+ url: usman.registrations_url,
13
+ has_permission: @current_user.has_read_permission?(Registration)
14
+ },
15
+ roles: {
16
+ text: "Manage Roles",
17
+ icon_class: "fa-graduation-cap",
18
+ url: usman.roles_url,
19
+ has_permission: @current_user.has_read_permission?(Role)
20
+ },
21
+ permissions: {
22
+ text: "Manage Permissions",
23
+ icon_class: "fa-lock",
24
+ url: usman.permissions_url,
25
+ has_permission: @current_user.has_read_permission?(Permission)
26
+ }
27
+ }
28
+ %>
29
+ <%
30
+ configuration_items = {
31
+ features: {
32
+ text: "Manage Features",
33
+ icon_class: "fa-diamond",
34
+ url: usman.features_url,
35
+ has_permission: @current_user.has_read_permission?(Feature)
36
+ }
37
+ }
38
+ %>
39
+ <%
40
+ pattana_items = {
41
+ countries: {
42
+ text: "Manage Countries",
43
+ icon_class: "fa-flag-checkered",
44
+ url: pattana.countries_url,
45
+ has_permission: @current_user.has_read_permission?(Country)
46
+ },
47
+ regions: {
48
+ text: "Manage Regions",
49
+ icon_class: "fa-globe",
50
+ url: pattana.regions_url,
51
+ has_permission: @current_user.has_read_permission?(Region)
52
+ },
53
+ cities: {
54
+ text: "Manage Cities",
55
+ icon_class: "fa-map-marker",
56
+ url: pattana.cities_url,
57
+ has_permission: @current_user.has_read_permission?(City)
58
+ },
59
+
60
+ }
61
+ %>
62
+
63
+ <div class="sidebar-menu toggle-others collapsed">
64
+
65
+ <div class="sidebar-menu-inner">
66
+
67
+ <header class="logo-env">
68
+ <!-- logo -->
69
+ <div class="logo">
70
+ <a href="/" class="logo-expanded">
71
+ <%= image_tag("logo-white.png", width: "180") %>
72
+ </a>
73
+ <a href="/" class="logo-collapsed">
74
+ <%= image_tag("logo-small.png", width: "40") %>
75
+ </a>
76
+ </div>
77
+
78
+ <!-- This will toggle the mobile menu and will be visible only on mobile devices -->
79
+ <div class="mobile-menu-toggle visible-xs">
80
+ <!-- <a href="#" data-toggle="notifications-menu">
81
+ <i class="fa-bell-o"></i><span class="badge badge-success">7</span>
82
+ </a> -->
83
+ <a href="#" data-toggle="user-info-menu">
84
+ <%= display_image(@current_user, "profile_picture.image.small.url", width: "32", height: "auto", class: "img-circle img-inline userpic-32", alt: @current_user.display_name) %>
85
+ </a>
86
+ <a href="#" data-toggle="mobile-menu"><i class="fa-bars"></i></a>
87
+ </div>
88
+ </header>
89
+
90
+ <!-- add class "multiple-expanded" to allow multiple submenus to open -->
91
+ <!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
92
+ <ul id="main-menu" class="main-menu multiple-expanded auto-inherit-active-class">
93
+ <!-- Admin Dashboard -->
94
+ <% if @current_user.super_admin? || @current_user.has_role?("Site Admin") %>
95
+ <li class="<%= nav_active?('admin/dashboard') ? 'active' : '' %>">
96
+ <%= link_to raw("<i class=\"fa-desktop\"></i> <span class='title'>Dashboard</span>"), usman.dashboard_path %>
97
+ </li>
98
+ <% else %>
99
+ <li class="<%= nav_active?('profile/dashboard') ? 'active' : '' %>">
100
+ <%= link_to raw("<i class=\"fa-desktop\"></i> <span class='title'>Dashboard</span>"), usman.my_account_url %>
101
+ </li>
102
+ <% end %>
103
+
104
+ <li class="">
105
+ <a href="#">
106
+ <i class="fa-user"></i>
107
+ <span class="title">Manage Users</span>
108
+ </a>
109
+ <ul>
110
+ <% user_items.each do |key, values| %>
111
+ <% next unless values[:has_permission] %>
112
+ <li class="">
113
+ <%= link_to raw("<i class=\"#{values[:icon_class]}\"></i> <span class='title'>#{values[:text]}</span>"), values[:url] %>
114
+ </li>
115
+ <% end %>
116
+ </ul>
117
+ </li>
118
+
119
+ <li class="">
120
+ <a href="#">
121
+ <i class="fa-cog"></i>
122
+ <span class="title">Configure</span>
123
+ </a>
124
+ <ul>
125
+ <% configuration_items.each do |key, values| %>
126
+ <% next unless values[:has_permission] %>
127
+ <li class="">
128
+ <%= link_to raw("<i class=\"#{values[:icon_class]}\"></i> <span class='title'>#{values[:text]}</span>"), values[:url] %>
129
+ </li>
130
+ <% end %>
131
+ </ul>
132
+ </li>
133
+
134
+ <li class="">
135
+ <a href="#">
136
+ <i class="fa-globe"></i>
137
+ <span class="title">Manage Location</span>
138
+ </a>
139
+ <ul>
140
+ <% pattana_items.each do |key, values| %>
141
+ <% next unless values[:has_permission] %>
142
+ <li class="">
143
+ <%= link_to raw("<i class=\"#{values[:icon_class]}\"></i> <span class='title'>#{values[:text]}</span>"), values[:url] %>
144
+ </li>
145
+ <% end %>
146
+ </ul>
147
+ </li>
148
+
149
+ <li class="<%= nav_active?('profile/profile') ? 'active' : '' %>">
150
+ <a href="#"><i class="fa-user"></i><span class="title">My Account</span></a>
151
+ <ul>
152
+ <li class="<%= nav_class("profile/settings") %>">
153
+ <%= link_to raw("<i class=\"fa-cog\"></i> <span class='title'>User Settings</span>"), "#" %>
154
+ </li>
155
+ </ul>
156
+ </li>
157
+
158
+ <!-- API Documentation -->
159
+ <li class="<%= nav_active?('docs/index') ? 'active' : '' %>">
160
+ <a href="#"><i class="fa-file-code-o"></i><span class="title">API Documentation</span></a>
161
+ <ul>
162
+ <li class="">
163
+ <a href="/docs/api/v1/register">
164
+ <i class="fa-user"></i>
165
+ <span class="title">Authentication APIs</span>
166
+ </a>
167
+ </li>
168
+ </ul>
169
+ </li>
170
+
171
+ </ul>
172
+
173
+ </div>
174
+
175
+ </div>
@@ -0,0 +1,40 @@
1
+ <%
2
+ usman_items = {
3
+ users: {
4
+ text: "Users",
5
+ icon_class: "fa-user",
6
+ url: usman.users_url,
7
+ has_permission: @current_user.has_read_permission?(User)
8
+ },
9
+ registrations: {
10
+ text: "Registrations",
11
+ icon_class: "fa-mobile",
12
+ url: usman.registrations_url,
13
+ has_permission: @current_user.has_read_permission?(Registration)
14
+ },
15
+ roles: {
16
+ text: "Roles",
17
+ icon_class: "fa-graduation-cap",
18
+ url: usman.roles_url,
19
+ has_permission: @current_user.has_read_permission?(Role)
20
+ },
21
+ permissions: {
22
+ text: "Permissions",
23
+ icon_class: "fa-lock",
24
+ url: usman.permissions_url,
25
+ has_permission: @current_user.has_read_permission?(Permission)
26
+ },
27
+ }
28
+ %>
29
+
30
+ <% if (usman_items.map{|x, y| y[:has_permission] }).compact.uniq.any? %>
31
+
32
+ <h3 class="text-gray mt-50 mb-10">
33
+ Manage User <br>
34
+ <small class="text-muted">Manage Users, Role and much more...</small>
35
+ </h3>
36
+ <hr class="mb-30" style="border-top:1px solid #ddd;">
37
+
38
+ <%= render partial: "/layouts/dashboard/bootstrap4/items", locals: { items: usman_items } %>
39
+
40
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <%
2
+ super_admin_items = {
3
+ features: {
4
+ text: "Features",
5
+ icon_class: "fa-diamond",
6
+ url: usman.features_url,
7
+ has_permission: @current_user.has_read_permission?(Feature)
8
+ }
9
+ }
10
+ %>
11
+
12
+ <% if (super_admin_items.map{|x, y| y[:has_permission] }).compact.uniq.any? %>
13
+
14
+ <h3 class="text-gray mt-50 mb-10">
15
+ Configurations <br>
16
+ <small class="text-muted">Configure Features & Other Settings </small>
17
+ </h3>
18
+ <hr class="mb-30" style="border-top:1px solid #ddd;">
19
+
20
+ <%= render partial: "/layouts/dashboard/bootstrap4/items", locals: { items: super_admin_items } %>
21
+
22
+ <% end %>
@@ -0,0 +1,40 @@
1
+ <%
2
+ usman_items = {
3
+ users: {
4
+ text: "Users",
5
+ icon_class: "fa-user",
6
+ url: usman.users_url,
7
+ has_permission: @current_user.has_read_permission?(User)
8
+ },
9
+ registrations: {
10
+ text: "Registrations",
11
+ icon_class: "fa-mobile",
12
+ url: usman.registrations_url,
13
+ has_permission: @current_user.has_read_permission?(Registration)
14
+ },
15
+ roles: {
16
+ text: "Roles",
17
+ icon_class: "fa-graduation-cap",
18
+ url: usman.roles_url,
19
+ has_permission: @current_user.has_read_permission?(Role)
20
+ },
21
+ permissions: {
22
+ text: "Permissions",
23
+ icon_class: "fa-lock",
24
+ url: usman.permissions_url,
25
+ has_permission: @current_user.has_read_permission?(Permission)
26
+ },
27
+ }
28
+ %>
29
+
30
+ <% if (usman_items.map{|x, y| y[:has_permission] }).compact.uniq.any? %>
31
+
32
+ <h3 class="text-gray mt-50 mb-10">
33
+ Manage User <br>
34
+ <small class="text-muted">Manage Users, Role and much more...</small>
35
+ </h3>
36
+ <hr class="mb-30" style="border-top:1px solid #ddd;">
37
+
38
+ <%= render partial: "/layouts/dashboard/materialize/items", locals: { items: usman_items } %>
39
+
40
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <%
2
+ super_admin_items = {
3
+ features: {
4
+ text: "Features",
5
+ icon_class: "fa-diamond",
6
+ url: usman.features_url,
7
+ has_permission: @current_user.has_read_permission?(Feature)
8
+ }
9
+ }
10
+ %>
11
+
12
+ <% if (super_admin_items.map{|x, y| y[:has_permission] }).compact.uniq.any? %>
13
+
14
+ <h3 class="text-gray mt-50 mb-10">
15
+ Configurations <br>
16
+ <small class="text-muted">Configure Features & Other Settings </small>
17
+ </h3>
18
+ <hr class="mb-30" style="border-top:1px solid #ddd;">
19
+
20
+ <%= render partial: "/layouts/dashboard/materialize/items", locals: { items: super_admin_items } %>
21
+
22
+ <% end %>
@@ -2,7 +2,7 @@
2
2
  usman_items = {
3
3
  users: {
4
4
  text: "Users",
5
- icon_class: "fa-group",
5
+ icon_class: "fa-user",
6
6
  url: usman.users_url,
7
7
  has_permission: @current_user.has_read_permission?(User)
8
8
  },
@@ -35,6 +35,6 @@
35
35
  </h3>
36
36
  <hr class="mb-30" style="border-top:1px solid #ddd;">
37
37
 
38
- <%= render partial: "/layouts/dashboard/items", locals: { items: usman_items } %>
38
+ <%= render partial: "/layouts/dashboard/xenon/items", locals: { items: usman_items } %>
39
39
 
40
40
  <% end %>
@@ -17,6 +17,6 @@
17
17
  </h3>
18
18
  <hr class="mb-30" style="border-top:1px solid #ddd;">
19
19
 
20
- <%= render partial: "/layouts/dashboard/items", locals: { items: super_admin_items } %>
20
+ <%= render partial: "/layouts/dashboard/xenon/items", locals: { items: super_admin_items } %>
21
21
 
22
22
  <% end %>
@@ -6,6 +6,7 @@
6
6
 
7
7
  <div class="form-inputs mb-30 mt-30">
8
8
  <%= theme_form_field(@feature, :name, label: "Class Name") %>
9
+ <%= theme_form_field(@feature, :feature_category, label: "Feature Category") %>
9
10
  <%= theme_form_field(@feature, :categorisable, required: false, html_options: {type: :checkbox}) %>
10
11
  </div>
11
12
 
@@ -3,6 +3,11 @@
3
3
  <div class="col-md-12">
4
4
 
5
5
  <ul class="nav nav-tabs">
6
+ <% @feature_categories.uniq.each do |f| %>
7
+ <li class="<%= @feature_category == f ? 'active' : '' %>">
8
+ <%= link_to f, features_path(fc: f) %>
9
+ </li>
10
+ <% end %>
6
11
  </ul>
7
12
  <div class="tab-content">
8
13
  <div class="tab-pane active">
@@ -20,6 +25,19 @@
20
25
  <%= search_form_kuppayam(Feature, features_path, text: @filters[:query]) %>
21
26
  </div>
22
27
  </div>
28
+
29
+ <div class="row">
30
+ <div class="col-md-12">
31
+ <% @filter_ui_settings.each do |filter_name, options| %>
32
+ <% if options[:object_filter] == true %>
33
+ <%= report_object_filter(filter_name, options) %>
34
+ <% else %>
35
+ <%= report_filter(filter_name, options) %>
36
+ <% end %>
37
+ <% end %>
38
+ </div>
39
+ </div>
40
+
23
41
  </div>
24
42
  <%= clear_tag(10) %>
25
43
 
@@ -0,0 +1,23 @@
1
+ class AddFeatureCategoryToFeatures < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :features, :feature_category, :string, :null => false, :limit=>64, default: "Default"
4
+ Feature.update_all("feature_category = 'Default'")
5
+
6
+ Feature.where("").update_all("feature_category = 'Default'")
7
+
8
+ Feature.where("name like '%Dhatu%'").update_all("feature_category = 'Website Features'")
9
+
10
+ Feature.where("name like '%Promotion%'").update_all("feature_category = 'Marketing Features'")
11
+ Feature.where("name like '%Offer%'").update_all("feature_category = 'Marketing Features'")
12
+ Feature.where("name like '%Booking%'").update_all("feature_category = 'Marketing Features'")
13
+ Feature.where("name like '%Blog%'").update_all("feature_category = 'Marketing Features'")
14
+
15
+ Feature.where("name like '%User%'").update_all("feature_category = 'Admin'")
16
+ Feature.where("name like '%Role%'").update_all("feature_category = 'Admin'")
17
+ Feature.where("name like '%Permission%'").update_all("feature_category = 'Admin'")
18
+ Feature.where("name like '%Feature%'").update_all("feature_category = 'Admin'")
19
+ Feature.where("name like '%Country%' or name like '%Countries%'").update_all("feature_category = 'Admin'")
20
+ Feature.where("name like '%Region%'").update_all("feature_category = 'Admin'")
21
+ Feature.where("name like '%City%' or name like '%Cities%'").update_all("feature_category = 'Admin'")
22
+ end
23
+ end
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.4.7.pre.materialize'
2
+ VERSION = '0.4.8.pre.materialize'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.pre.materialize
4
+ version: 0.4.8.pre.materialize
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -104,28 +104,28 @@ dependencies:
104
104
  requirements:
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 0.2.7.pre.materialize
107
+ version: 0.2.8.pre.materialize
108
108
  type: :runtime
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: 0.2.7.pre.materialize
114
+ version: 0.2.8.pre.materialize
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: pattana
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
- version: 0.2.5.pre.materialize
121
+ version: 0.2.6.pre.materialize
122
122
  type: :runtime
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - ">="
127
127
  - !ruby/object:Gem::Version
128
- version: 0.2.5.pre.materialize
128
+ version: 0.2.6.pre.materialize
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: bcrypt
131
131
  requirement: !ruby/object:Gem::Requirement
@@ -452,11 +452,15 @@ files:
452
452
  - app/services/usman/sms_service.rb
453
453
  - app/uploaders/feature_image_uploader.rb
454
454
  - app/uploaders/profile_picture_uploader.rb
455
- - app/views/layouts/kuppayam/_footer.html.erb
456
- - app/views/layouts/kuppayam/_header.html.erb
457
- - app/views/layouts/kuppayam/_navbar.html.erb
458
- - app/views/layouts/kuppayam/_sidebar.html.erb
459
- - app/views/layouts/kuppayam/profile.html.erb
455
+ - app/views/layouts/kuppayam/materialize/_footer.html.erb
456
+ - app/views/layouts/kuppayam/materialize/_header.html.erb
457
+ - app/views/layouts/kuppayam/materialize/_navbar.html.erb
458
+ - app/views/layouts/kuppayam/materialize/_sidebar.html.erb
459
+ - app/views/layouts/kuppayam/xenon/_footer.html.erb
460
+ - app/views/layouts/kuppayam/xenon/_header.html.erb
461
+ - app/views/layouts/kuppayam/xenon/_navbar.html.erb
462
+ - app/views/layouts/kuppayam/xenon/_sidebar.html.erb
463
+ - app/views/layouts/kuppayam/xenon/profile.html.erb
460
464
  - app/views/usman/api/v1/docs/accept_tac/_neg_case_1.html.erb
461
465
  - app/views/usman/api/v1/docs/accept_tac/_neg_case_2.html.erb
462
466
  - app/views/usman/api/v1/docs/accept_tac/_neg_case_3.html.erb
@@ -526,9 +530,13 @@ files:
526
530
  - app/views/usman/api/v1/docs/verify_otp/_neg_case_4.html.erb
527
531
  - app/views/usman/api/v1/docs/verify_otp/_pos_case_1.html.erb
528
532
  - app/views/usman/api/v1/docs/verify_otp/_pos_case_2.html.erb
529
- - app/views/usman/dashboard/_index.html.erb
530
- - app/views/usman/dashboard/_super_admin_index.html.erb
533
+ - app/views/usman/dashboard/bootstrap4/_index.html.erb
534
+ - app/views/usman/dashboard/bootstrap4/_super_admin_index.html.erb
531
535
  - app/views/usman/dashboard/index.html.erb
536
+ - app/views/usman/dashboard/materialize/_index.html.erb
537
+ - app/views/usman/dashboard/materialize/_super_admin_index.html.erb
538
+ - app/views/usman/dashboard/xenon/_index.html.erb
539
+ - app/views/usman/dashboard/xenon/_super_admin_index.html.erb
532
540
  - app/views/usman/features/_form.html.erb
533
541
  - app/views/usman/features/_index.html.erb
534
542
  - app/views/usman/features/_permissions.html.erb
@@ -595,6 +603,7 @@ files:
595
603
  - db/migrate/20170929083236_add_country_city_to_users.rb
596
604
  - db/migrate/20171124071245_create_contacts.rb
597
605
  - db/migrate/20171212094209_correct_contacts.rb
606
+ - db/migrate/20180515030422_add_feature_category_to_features.rb
598
607
  - lib/tasks/usman/data.rake
599
608
  - lib/tasks/usman/master_data.rake
600
609
  - lib/temp/features.rake