usman 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +51 -10
- data/app/controllers/usman/admin/dashboard_controller.rb +9 -1
- data/app/controllers/usman/admin/features_controller.rb +16 -22
- data/app/controllers/usman/admin/permissions_controller.rb +15 -0
- data/app/controllers/usman/admin/resource_controller.rb +4 -0
- data/app/controllers/usman/admin/roles_controller.rb +66 -0
- data/app/controllers/usman/admin/users_controller.rb +44 -31
- data/app/controllers/usman/sessions_controller.rb +14 -3
- data/app/helpers/usman/authentication_helper.rb +23 -17
- data/app/models/feature.rb +50 -4
- data/app/models/permission.rb +49 -1
- data/app/models/role.rb +62 -0
- data/app/models/user.rb +112 -3
- data/app/models/usman/application_record.rb +2 -2
- data/app/views/layouts/kuppayam/_sidebar.html.erb +8 -4
- data/app/views/usman/admin/dashboard/index.html.erb +1 -1
- data/app/views/usman/admin/features/_action_buttons.html.erb +0 -11
- data/app/views/usman/admin/features/_index.html.erb +3 -3
- data/app/views/usman/admin/features/_row.html.erb +3 -3
- data/app/views/usman/admin/features/_show.html.erb +5 -1
- data/app/views/usman/admin/features/index.html.erb +8 -1
- data/app/views/usman/admin/features/temp/create.js.erb +29 -0
- data/app/views/usman/admin/features/{index.js.erb → temp/index.js.erb} +1 -1
- data/app/views/usman/admin/permissions/_action_buttons.html.erb +0 -11
- data/app/views/usman/admin/permissions/index.html.erb +8 -1
- data/app/views/usman/admin/permissions/temp/create.js.erb +29 -0
- data/app/views/usman/admin/permissions/temp/destroy.js.erb +22 -0
- data/app/views/usman/admin/permissions/temp/edit.js.erb +4 -0
- data/app/views/usman/admin/permissions/{index.js.erb → temp/index.js.erb} +9 -3
- data/app/views/usman/admin/permissions/temp/new.js.erb +4 -0
- data/app/views/usman/admin/permissions/temp/row.js.erb +24 -0
- data/app/views/usman/admin/permissions/temp/show.js.erb +13 -0
- data/app/views/usman/admin/permissions/temp/update.js.erb +29 -0
- data/app/views/usman/admin/roles/_form.html.erb +23 -0
- data/app/views/usman/admin/roles/_index.html.erb +48 -0
- data/app/views/usman/admin/roles/_row.html.erb +24 -0
- data/app/views/usman/admin/roles/_show.html.erb +72 -0
- data/app/views/usman/admin/roles/index.html.erb +32 -0
- data/app/views/usman/admin/users/_form.html.erb +5 -2
- data/app/views/usman/admin/users/_index.html.erb +22 -41
- data/app/views/usman/admin/users/_row.html.erb +21 -41
- data/app/views/usman/admin/users/_show.html.erb +198 -131
- data/app/views/usman/admin/users/index.html.erb +25 -1
- data/app/views/usman/sessions/_sign_in.js.erb +2 -2
- data/config/locales/kuppayam/authentication.ar.yml +25 -0
- data/config/locales/kuppayam/authentication.en.yml +25 -0
- data/config/routes.rb +4 -9
- data/db/import_data/dummy/features.csv +10 -0
- data/db/import_data/dummy/images/users/guna.neweast.png +0 -0
- data/db/import_data/dummy/images/users/junaid.ramzan.jpg +0 -0
- data/db/import_data/dummy/images/users/kpvarma.png +0 -0
- data/db/import_data/dummy/images/users/stephen.price.png +0 -0
- data/db/import_data/dummy/images/users/vinodh.jpg +0 -0
- data/db/import_data/dummy/permissions.csv +60 -0
- data/db/import_data/dummy/users.csv +7 -0
- data/db/import_data/features.csv +10 -0
- data/db/import_data/images/users/junaid.ramzan.jpg +0 -0
- data/db/import_data/images/users/kpvarma.png +0 -0
- data/db/import_data/images/users/vinodh.jpg +0 -0
- data/db/import_data/permissions.csv +30 -0
- data/db/import_data/users.csv +4 -0
- data/db/migrate/20170000000102_create_roles.rb +18 -0
- data/lib/tasks/usman/all.rake +49 -0
- data/lib/tasks/usman/features.rake +26 -0
- data/lib/tasks/usman/permissions.rake +26 -0
- data/lib/tasks/usman/users.rake +26 -0
- data/lib/usman/engine.rb +12 -1
- data/lib/usman/extras/import_error_handler.rb +79 -0
- data/lib/usman/version.rb +1 -1
- metadata +65 -55
- data/app/models/image/base.rb +0 -30
- data/app/views/usman/admin/features/create.js.erb +0 -16
- data/app/views/usman/admin/permissions/create.js.erb +0 -17
- data/app/views/usman/admin/permissions/destroy.js.erb +0 -16
- data/app/views/usman/admin/permissions/edit.js.erb +0 -7
- data/app/views/usman/admin/permissions/new.js.erb +0 -7
- data/app/views/usman/admin/permissions/row.js.erb +0 -10
- data/app/views/usman/admin/permissions/show.js.erb +0 -8
- data/app/views/usman/admin/permissions/update.js.erb +0 -16
- data/app/views/usman/admin/users/_action_buttons.html.erb +0 -11
- data/app/views/usman/admin/users/create.js.erb +0 -16
- data/app/views/usman/admin/users/destroy.js.erb +0 -16
- data/app/views/usman/admin/users/edit.js.erb +0 -7
- data/app/views/usman/admin/users/index.js.erb +0 -8
- data/app/views/usman/admin/users/new.js.erb +0 -7
- data/app/views/usman/admin/users/row.js.erb +0 -10
- data/app/views/usman/admin/users/show.js.erb +0 -8
- data/app/views/usman/admin/users/update.js.erb +0 -16
- data/config/locales/usman.en.yml +0 -61
- data/db/migrate/20131108102728_create_images.rb +0 -12
- data/lib/tasks/usman_tasks.rake +0 -4
- /data/app/views/usman/admin/features/{destroy.js.erb → temp/destroy.js.erb} +0 -0
- /data/app/views/usman/admin/features/{edit.js.erb → temp/edit.js.erb} +0 -0
- /data/app/views/usman/admin/features/{new.js.erb → temp/new.js.erb} +0 -0
- /data/app/views/usman/admin/features/{row.js.erb → temp/row.js.erb} +0 -0
- /data/app/views/usman/admin/features/{show.js.erb → temp/show.js.erb} +0 -0
- /data/app/views/usman/admin/features/{update.js.erb → temp/update.js.erb} +0 -0
- /data/db/migrate/{20140402113213_create_users.rb → 20170000000100_create_users.rb} +0 -0
- /data/db/migrate/{20140402113214_create_features.rb → 20170000000101_create_features.rb} +0 -0
|
@@ -1,132 +1,199 @@
|
|
|
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
|
-
|
|
1
|
+
<div id="div_user_show">
|
|
2
|
+
<% status_hash = {approved: "success", pending: "default", suspended: "danger"} %>
|
|
3
|
+
|
|
4
|
+
<div class="row">
|
|
5
|
+
|
|
6
|
+
<div class="col-md-3 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
|
|
7
|
+
|
|
8
|
+
<%= edit_image(@user,
|
|
9
|
+
"profile_picture.image.large.url",
|
|
10
|
+
upload_image_link(@user, :profile_picture, nil ),
|
|
11
|
+
remove_image_link(@user, :profile_picture, nil ),
|
|
12
|
+
image_options: {assoc_name: :profile_picture }) %>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="col-md-6 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
|
|
16
|
+
|
|
17
|
+
<div class="visible-sm visible-xs mt-50"></div>
|
|
18
|
+
|
|
19
|
+
<%= theme_panel_heading(@user.name) %>
|
|
20
|
+
<%= theme_panel_sub_heading(@user.designation, "#") if @user.designation %>
|
|
21
|
+
|
|
22
|
+
<%= clear_tag(10) %>
|
|
23
|
+
|
|
24
|
+
<span class="ml-5 mt-5 label label-<%= status_hash[@user.status.to_sym] %>"><%= @user.status.titleize %></span>
|
|
25
|
+
|
|
26
|
+
<% if @user.super_admin %>
|
|
27
|
+
<span class="mr-10 mt-5 label label-warning">Super Admin</span>
|
|
28
|
+
<% else %>
|
|
29
|
+
<span class="mr-10 mt-5 label label-default">Normal</span>
|
|
30
|
+
<% end %>
|
|
31
|
+
|
|
32
|
+
<%= clear_tag(10) %>
|
|
33
|
+
|
|
34
|
+
<!-- <div class="mt-20" style="max-width: 100%;overflow: auto;max-height: 500px;">
|
|
35
|
+
<%#= raw(@user.biography) %>
|
|
36
|
+
</div> -->
|
|
37
|
+
|
|
38
|
+
<div class="visible-sm visible-xs mb-50"></div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="col-md-3 col-sm-12 col-xs-12">
|
|
43
|
+
|
|
44
|
+
<% edit_link = edit_admin_user_path(id: @user.id) %>
|
|
45
|
+
<% delete_link = admin_user_path(id: @user.id) %>
|
|
46
|
+
|
|
47
|
+
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit User"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @user.can_be_edited? %>
|
|
48
|
+
|
|
49
|
+
<%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, role: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @user.can_be_deleted? && (@current_user != @user) %>
|
|
50
|
+
|
|
51
|
+
<% if @current_user.super_admin? %>
|
|
52
|
+
|
|
53
|
+
<%= link_to raw("<i class=\"linecons-paper-plane\"></i> Masquerade"), masquerade_admin_user_path(@user), method: :put, data: { confirm: "Are you sure? Do you really want to logout current session and login as #{@user.name}?" }, class: "btn btn-block btn-gray btn-only-hover" if @current_user != @user %>
|
|
54
|
+
|
|
55
|
+
<!-- Remove Super Admin -->
|
|
56
|
+
<%= link_to raw("<i class=\"fa fa-remove mr-5\"></i> Remove Super Admin"), remove_super_admin_admin_user_path(id: @user.id), method: :put, :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" if @user.super_admin? && (@current_user != @user) %>
|
|
57
|
+
|
|
58
|
+
<!-- Make Super Admin -->
|
|
59
|
+
<%= link_to raw("<i class=\"fa fa-plus-square mr-5\"></i> Make Super Admin"), make_super_admin_admin_user_path(id: @user.id), method: :put, remote: true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-gray btn-only-hover" unless @user.super_admin? %>
|
|
60
|
+
|
|
61
|
+
<% end %>
|
|
62
|
+
|
|
63
|
+
<!-- Approve -->
|
|
64
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"), update_status_admin_user_path(:id =>@user.id, :status =>'approved'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-success btn-only-hover" if @user.can_be_approved? %>
|
|
65
|
+
|
|
66
|
+
<!-- Mark as Pending -->
|
|
67
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"), update_status_admin_user_path(:id =>@user.id, :status =>'pending'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-gray btn-only-hover" if @user.can_be_marked_as_pending? && (@current_user != @user) %>
|
|
68
|
+
|
|
69
|
+
<!-- Suspend -->
|
|
70
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"), update_status_admin_user_path(:id =>@user.id, :status =>'suspended'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" if @user.can_be_suspended? && (@current_user != @user) %>
|
|
71
|
+
|
|
72
|
+
<div class="visible-sm visible-xs mb-50"></div>
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<%= clear_tag(50) %>
|
|
79
|
+
|
|
80
|
+
<ul class="nav nav-pills">
|
|
81
|
+
<li class="active">
|
|
82
|
+
<a href="#user_details" data-toggle="tab" aria-expanded="true">
|
|
83
|
+
<span class="visible-xs"><i class="fa-info"></i></span>
|
|
84
|
+
<span class="hidden-xs">User Details</span>
|
|
85
|
+
</a>
|
|
86
|
+
</li>
|
|
87
|
+
<li class="">
|
|
88
|
+
<a href="#technical_details" data-toggle="tab" aria-expanded="false">
|
|
89
|
+
<span class="visible-xs"><i class="fa-database"></i></span>
|
|
90
|
+
<span class="hidden-xs">Technical Details</span>
|
|
91
|
+
</a>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
|
|
95
|
+
<div class="tab-content">
|
|
96
|
+
<div class="tab-pane active" id="user_details">
|
|
97
|
+
|
|
98
|
+
<%= clear_tag(20) %>
|
|
99
|
+
|
|
100
|
+
<div class="table-responsive mt-30">
|
|
101
|
+
<table class="table table-striped table-condensed table-bordered">
|
|
102
|
+
<tbody>
|
|
103
|
+
|
|
104
|
+
<tr>
|
|
105
|
+
<th>Username</th><td><%= @user.username %></td>
|
|
106
|
+
<th>Email</th><td><%= @user.email %></td>
|
|
107
|
+
</tr>
|
|
108
|
+
|
|
109
|
+
<tr>
|
|
110
|
+
<th>Phone</th><td><%= @user.phone %></td>
|
|
111
|
+
<th>Designation</th><td><%= @user.designation %></td>
|
|
112
|
+
</tr>
|
|
113
|
+
|
|
114
|
+
<tr>
|
|
115
|
+
<th>Super Admim?</th><td><%= @user.super_admin %></td>
|
|
116
|
+
<th>Status</th><td><%= @user.status.titleize %></td>
|
|
117
|
+
</tr>
|
|
118
|
+
|
|
119
|
+
</tbody>
|
|
120
|
+
</table>
|
|
121
|
+
</div>
|
|
45
122
|
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
</
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
%>
|
|
124
|
-
|
|
125
|
-
<%= link_to raw("<i class=\"fa fa-close mr-5\"></i> <span>Cancel</span>"), "#", onclick: "closeLargeModal();", class: "btn btn-white pull-left" %>
|
|
126
|
-
|
|
127
|
-
<%= link_to raw("<i class=\"fa fa-trash mr-5\"></i> <span>Delete User</span>"), delete_link, method: :delete, :remote=>true, class: "btn btn-gray pull-right" %>
|
|
128
|
-
|
|
129
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Edit User"), edit_link, method: :get, :remote=>true, class: "btn btn-gray pull-right mr-10" %>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<%= clear_tag %>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div class="tab-pane" id="technical_details">
|
|
126
|
+
|
|
127
|
+
<%= clear_tag(20) %>
|
|
128
|
+
|
|
129
|
+
<div class="table-responsive">
|
|
130
|
+
<table class="table table-striped table-condensed table-bordered mb-30">
|
|
131
|
+
<tbody>
|
|
132
|
+
|
|
133
|
+
<tr>
|
|
134
|
+
<th style="width:20%;">Sign In Count</th><td style="width:30%;"><%= @user.sign_in_count %></td>
|
|
135
|
+
<th style="width:20%;">Remember User</th><td style="width:30%;"><%= @user.remember_created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.remember_created_at %></td>
|
|
136
|
+
</tr>
|
|
137
|
+
|
|
138
|
+
<tr>
|
|
139
|
+
<th>Current Sign In At</th><td><%= @user.current_sign_in_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.current_sign_in_at %></td>
|
|
140
|
+
<th>Last Sign In At</th><td><%= @user.last_sign_in_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.last_sign_in_at %></td>
|
|
141
|
+
</tr>
|
|
142
|
+
|
|
143
|
+
<tr>
|
|
144
|
+
<th>Current Sign In IP</th><td><%= @user.current_sign_in_ip %></td>
|
|
145
|
+
<th>Last Sign In IP</th><td><%= @user.last_sign_in_ip %></td>
|
|
146
|
+
</tr>
|
|
147
|
+
|
|
148
|
+
</tbody>
|
|
149
|
+
</table>
|
|
150
|
+
|
|
151
|
+
<table class="table table-striped table-condensed table-bordered">
|
|
152
|
+
<tbody>
|
|
153
|
+
|
|
154
|
+
<tr>
|
|
155
|
+
<th style="width:20%;">Reset Password Token</th><td style="width:30%;"><%= @user.reset_password_token %></td>
|
|
156
|
+
<th style="width:20%;">Reset Password Sent At</th><td style="width:30%;"><%= @user.reset_password_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.reset_password_sent_at %></td>
|
|
157
|
+
</tr>
|
|
158
|
+
|
|
159
|
+
<tr>
|
|
160
|
+
<th>Locked At</th><td colspan="3"><%= @user.locked_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.locked_at %></td>
|
|
161
|
+
</tr>
|
|
162
|
+
|
|
163
|
+
<tr>
|
|
164
|
+
<th>Failed Attempts</th><td><%= @user.failed_attempts %></td>
|
|
165
|
+
<th>Unlock Token</th><td><%= @user.unlock_token %></td>
|
|
166
|
+
</tr>
|
|
167
|
+
|
|
168
|
+
<tr>
|
|
169
|
+
<th>Confirmation Token</th><td><%= @user.confirmation_token %></td>
|
|
170
|
+
<th>Confirmation Token Sent At</th><td><%= @user.confirmed_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.confirmed_at %></td>
|
|
171
|
+
</tr>
|
|
172
|
+
|
|
173
|
+
<tr>
|
|
174
|
+
<th>Confirmation Sent At</th><td><%= @user.confirmation_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.confirmation_sent_at %></td>
|
|
175
|
+
<th>Uncomfirmed Email</th><td><%= @user.unconfirmed_email %></td>
|
|
176
|
+
</tr>
|
|
177
|
+
|
|
178
|
+
<tr>
|
|
179
|
+
<th>Auth Token</th><td><%= @user.auth_token %></td>
|
|
180
|
+
<th>Token Created At</th><td><%= @user.token_created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.token_created_at %></td>
|
|
181
|
+
</tr>
|
|
182
|
+
|
|
183
|
+
<tr>
|
|
184
|
+
<th>Created At</th><td><%= @user.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.created_at %></td>
|
|
185
|
+
<th>Updated At</th><td><%= @user.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @user.updated_at %></td>
|
|
186
|
+
</tr>
|
|
187
|
+
|
|
188
|
+
</tbody>
|
|
189
|
+
</table>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %>
|
|
197
|
+
|
|
198
|
+
<%= clear_tag %>
|
|
199
|
+
</div>
|
|
@@ -23,7 +23,31 @@
|
|
|
23
23
|
<div class="tab-pane active">
|
|
24
24
|
|
|
25
25
|
<div id="div_user_action_buttons">
|
|
26
|
-
|
|
26
|
+
<div class="row">
|
|
27
|
+
<div class="col-md-6">
|
|
28
|
+
|
|
29
|
+
<%= theme_button('Add a User', 'plus', new_admin_user_path(), classes: "pull-left", btn_type: "success") %>
|
|
30
|
+
|
|
31
|
+
<%= theme_button('Refresh', 'refresh', admin_users_path(), classes: "pull-left ml-10", btn_type: "white") %>
|
|
32
|
+
|
|
33
|
+
<!-- Single button -->
|
|
34
|
+
<div class="ml-10 btn-group">
|
|
35
|
+
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
36
|
+
More Actions <span class="caret"></span>
|
|
37
|
+
</button>
|
|
38
|
+
<ul class="dropdown-menu">
|
|
39
|
+
<li><a href="#">Import Users</a></li>
|
|
40
|
+
<li><a href="#">Import History</a></li>
|
|
41
|
+
<li role="separator" class="divider"></li>
|
|
42
|
+
<li><a href="#">Export Users</a></li>
|
|
43
|
+
</ul>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
<div class="col-md-6">
|
|
48
|
+
<%= search_form_kuppayam(User, admin_users_path, text: @filters[:query]) %>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
27
51
|
</div>
|
|
28
52
|
<%= clear_tag(10) %>
|
|
29
53
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
heading = "Please Sign In";
|
|
2
|
-
bodyContent = "<%= escape_javascript(render(:partial=>'usman/sessions/form.html.erb', locals: {redirect_back_url: request.original_url})) %>";
|
|
1
|
+
var heading = "Please Sign In";
|
|
2
|
+
var bodyContent = "<%= escape_javascript(render(:partial=>'usman/sessions/form.html.erb', locals: {redirect_back_url: request.original_url})) %>";
|
|
3
3
|
showGenericModal(heading, bodyContent);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
ar:
|
|
2
|
+
authentication:
|
|
3
|
+
permission_denied:
|
|
4
|
+
heading: "Permission Denied"
|
|
5
|
+
message: "You don't have permission to perform this action"
|
|
6
|
+
session_expired:
|
|
7
|
+
heading: "Session Expired"
|
|
8
|
+
message: "Your session has been expired. Please sign in again"
|
|
9
|
+
invalid_login:
|
|
10
|
+
heading: "Invalid Login"
|
|
11
|
+
message: "Invalid Username/Email or password."
|
|
12
|
+
user_is_pending:
|
|
13
|
+
heading: "Account Pending"
|
|
14
|
+
message: "Your account is not yet approved, please contact administrator to activate your account"
|
|
15
|
+
user_is_suspended:
|
|
16
|
+
heading: "Account Suspended"
|
|
17
|
+
message: "Your account is suspended, please contact administrator"
|
|
18
|
+
logged_in:
|
|
19
|
+
heading: "Signed In"
|
|
20
|
+
message: "You have successfully signed in"
|
|
21
|
+
logged_out:
|
|
22
|
+
heading: "Signed Out"
|
|
23
|
+
message: "You have successfully signed out"
|
|
24
|
+
masquerade: "لقد سجلت الدخول بنجاح - %{user}"
|
|
25
|
+
sign_in_back: "You have successfully signed in back as %{user}"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
en:
|
|
2
|
+
authentication:
|
|
3
|
+
permission_denied:
|
|
4
|
+
heading: "Permission Denied"
|
|
5
|
+
message: "You don't have permission to perform this action"
|
|
6
|
+
session_expired:
|
|
7
|
+
heading: "Session Expired"
|
|
8
|
+
message: "Your session has been expired. Please sign in again"
|
|
9
|
+
invalid_login:
|
|
10
|
+
heading: "Invalid Login"
|
|
11
|
+
message: "Invalid Username/Email or password."
|
|
12
|
+
user_is_pending:
|
|
13
|
+
heading: "Account Pending"
|
|
14
|
+
message: "Your account is not yet approved, please contact administrator to activate your account"
|
|
15
|
+
user_is_suspended:
|
|
16
|
+
heading: "Account Suspended"
|
|
17
|
+
message: "Your account is suspended, please contact administrator"
|
|
18
|
+
logged_in:
|
|
19
|
+
heading: "Signed In"
|
|
20
|
+
message: "You have successfully signed in"
|
|
21
|
+
logged_out:
|
|
22
|
+
heading: "Signed Out"
|
|
23
|
+
message: "You have successfully signed out"
|
|
24
|
+
masquerade: "لقد سجلت الدخول بنجاح - %{user}"
|
|
25
|
+
sign_in_back: "You have successfully signed in back as %{user}"
|
data/config/routes.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
Usman::Engine.routes.draw do
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Sign In URLs for users
|
|
3
|
+
# Sign In URLs for users
|
|
6
4
|
get '/sign_in', to: "sessions#sign_in", as: :sign_in
|
|
7
5
|
post '/create_session', to: "sessions#create_session", as: :create_session
|
|
8
6
|
get '/forgot_password_form', to: "sessions#forgot_password_form", as: :forgot_password_form
|
|
@@ -26,6 +24,8 @@ Usman::Engine.routes.draw do
|
|
|
26
24
|
end
|
|
27
25
|
end
|
|
28
26
|
|
|
27
|
+
resources :roles
|
|
28
|
+
|
|
29
29
|
resources :features do
|
|
30
30
|
member do
|
|
31
31
|
put :update_status, as: :update_status
|
|
@@ -33,12 +33,7 @@ Usman::Engine.routes.draw do
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
resources :permissions
|
|
36
|
-
|
|
37
|
-
resources :images do
|
|
38
|
-
member do
|
|
39
|
-
put :crop
|
|
40
|
-
end
|
|
41
|
-
end
|
|
36
|
+
|
|
42
37
|
|
|
43
38
|
end
|
|
44
39
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
user,feature,can_create,can_read,can_update,can_delete
|
|
2
|
+
kpvarma,Products,TRUE,TRUE,TRUE,TRUE
|
|
3
|
+
kpvarma,Categories,TRUE,TRUE,TRUE,TRUE
|
|
4
|
+
kpvarma,Brands,TRUE,TRUE,TRUE,TRUE
|
|
5
|
+
kpvarma,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
6
|
+
kpvarma,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
7
|
+
kpvarma,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
8
|
+
kpvarma,Teams,TRUE,TRUE,TRUE,TRUE
|
|
9
|
+
kpvarma,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
10
|
+
kpvarma,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
11
|
+
,,,,,
|
|
12
|
+
vinodh,Products,TRUE,TRUE,TRUE,TRUE
|
|
13
|
+
vinodh,Categories,TRUE,TRUE,TRUE,TRUE
|
|
14
|
+
vinodh,Brands,TRUE,TRUE,TRUE,TRUE
|
|
15
|
+
vinodh,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
16
|
+
vinodh,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
17
|
+
vinodh,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
18
|
+
vinodh,Teams,TRUE,TRUE,TRUE,TRUE
|
|
19
|
+
vinodh,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
20
|
+
vinodh,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
21
|
+
,,,,,
|
|
22
|
+
junaid.ramzan,Products,TRUE,TRUE,TRUE,TRUE
|
|
23
|
+
junaid.ramzan,Categories,TRUE,TRUE,TRUE,TRUE
|
|
24
|
+
junaid.ramzan,Brands,TRUE,TRUE,TRUE,TRUE
|
|
25
|
+
junaid.ramzan,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
26
|
+
junaid.ramzan,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
27
|
+
junaid.ramzan,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
28
|
+
junaid.ramzan,Teams,TRUE,TRUE,TRUE,TRUE
|
|
29
|
+
junaid.ramzan,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
30
|
+
junaid.ramzan,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
31
|
+
,,,,,
|
|
32
|
+
angelo.joseph,Products,TRUE,TRUE,TRUE,TRUE
|
|
33
|
+
angelo.joseph,Categories,TRUE,TRUE,TRUE,TRUE
|
|
34
|
+
angelo.joseph,Brands,TRUE,TRUE,TRUE,TRUE
|
|
35
|
+
angelo.joseph,Events & News,FALSE,FALSE,FALSE,FALSE
|
|
36
|
+
angelo.joseph,Subscriptions,FALSE,FALSE,FALSE,FALSE
|
|
37
|
+
angelo.joseph,Enquiries,FALSE,FALSE,FALSE,FALSE
|
|
38
|
+
angelo.joseph,Teams,FALSE,FALSE,FALSE,FALSE
|
|
39
|
+
angelo.joseph,Testimonials,FALSE,FALSE,FALSE,FALSE
|
|
40
|
+
angelo.joseph,Careers / Jobs,FALSE,FALSE,FALSE,FALSE
|
|
41
|
+
,,,,,
|
|
42
|
+
guna.neweast,Products,TRUE,TRUE,TRUE,TRUE
|
|
43
|
+
guna.neweast,Categories,TRUE,TRUE,TRUE,TRUE
|
|
44
|
+
guna.neweast,Brands,TRUE,TRUE,TRUE,TRUE
|
|
45
|
+
guna.neweast,Events & News,FALSE,FALSE,FALSE,FALSE
|
|
46
|
+
guna.neweast,Subscriptions,FALSE,FALSE,FALSE,FALSE
|
|
47
|
+
guna.neweast,Enquiries,FALSE,FALSE,FALSE,FALSE
|
|
48
|
+
guna.neweast,Teams,FALSE,FALSE,FALSE,FALSE
|
|
49
|
+
guna.neweast,Testimonials,FALSE,FALSE,FALSE,FALSE
|
|
50
|
+
guna.neweast,Careers / Jobs,FALSE,FALSE,FALSE,FALSE
|
|
51
|
+
,,,,,
|
|
52
|
+
stephen.price,Products,TRUE,TRUE,TRUE,TRUE
|
|
53
|
+
stephen.price,Categories,TRUE,TRUE,TRUE,TRUE
|
|
54
|
+
stephen.price,Brands,TRUE,TRUE,TRUE,TRUE
|
|
55
|
+
stephen.price,Events & News,FALSE,FALSE,FALSE,FALSE
|
|
56
|
+
stephen.price,Subscriptions,FALSE,FALSE,FALSE,FALSE
|
|
57
|
+
stephen.price,Enquiries,FALSE,FALSE,FALSE,FALSE
|
|
58
|
+
stephen.price,Teams,FALSE,FALSE,FALSE,FALSE
|
|
59
|
+
stephen.price,Testimonials,FALSE,FALSE,FALSE,FALSE
|
|
60
|
+
stephen.price,Careers / Jobs,FALSE,FALSE,FALSE,FALSE
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
name,username,designation,email,phone,super_admin,status
|
|
2
|
+
Krishna Prasad Varma,kpvarma,Site Admin,prasad@rightsolutions.io,,TRUE,approved
|
|
3
|
+
Vinodh Ellath,vinodh,Site Admin,vinodh@rightsolutions.io,,TRUE,approved
|
|
4
|
+
Junaid Ramzan,junaid.ramzan,Site Admin,junaid.ramzan@gmail.com,,TRUE,approved
|
|
5
|
+
Angelo Joseph,angelo.joseph,Manager,angelo@yopmail.com,,FALSE,pending
|
|
6
|
+
Guna,guna.neweast,IT Support,guna@yopmail.com,,FALSE,pending
|
|
7
|
+
Stephen Price,stephen.price,Director,stephen.price@yopmail.com,,FALSE,suspended
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
user,feature,can_create,can_read,can_update,can_delete
|
|
2
|
+
kpvarma,Products,TRUE,TRUE,TRUE,TRUE
|
|
3
|
+
kpvarma,Categories,TRUE,TRUE,TRUE,TRUE
|
|
4
|
+
kpvarma,Brands,TRUE,TRUE,TRUE,TRUE
|
|
5
|
+
kpvarma,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
6
|
+
kpvarma,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
7
|
+
kpvarma,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
8
|
+
kpvarma,Teams,TRUE,TRUE,TRUE,TRUE
|
|
9
|
+
kpvarma,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
10
|
+
kpvarma,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
11
|
+
,,,,,
|
|
12
|
+
vinodh,Products,TRUE,TRUE,TRUE,TRUE
|
|
13
|
+
vinodh,Categories,TRUE,TRUE,TRUE,TRUE
|
|
14
|
+
vinodh,Brands,TRUE,TRUE,TRUE,TRUE
|
|
15
|
+
vinodh,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
16
|
+
vinodh,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
17
|
+
vinodh,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
18
|
+
vinodh,Teams,TRUE,TRUE,TRUE,TRUE
|
|
19
|
+
vinodh,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
20
|
+
vinodh,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
21
|
+
,,,,,
|
|
22
|
+
junaid.ramzan,Products,TRUE,TRUE,TRUE,TRUE
|
|
23
|
+
junaid.ramzan,Categories,TRUE,TRUE,TRUE,TRUE
|
|
24
|
+
junaid.ramzan,Brands,TRUE,TRUE,TRUE,TRUE
|
|
25
|
+
junaid.ramzan,Events & News,TRUE,TRUE,TRUE,TRUE
|
|
26
|
+
junaid.ramzan,Subscriptions,TRUE,TRUE,TRUE,TRUE
|
|
27
|
+
junaid.ramzan,Enquiries,TRUE,TRUE,TRUE,TRUE
|
|
28
|
+
junaid.ramzan,Teams,TRUE,TRUE,TRUE,TRUE
|
|
29
|
+
junaid.ramzan,Testimonials,TRUE,TRUE,TRUE,TRUE
|
|
30
|
+
junaid.ramzan,Careers / Jobs,TRUE,TRUE,TRUE,TRUE
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
name,username,designation,email,phone,super_admin,status
|
|
2
|
+
Krishna Prasad Varma,kpvarma,Site Admin,prasad@rightsolutions.io,,TRUE,approved
|
|
3
|
+
Vinodh Ellath,vinodh,Site Admin,vinodh@rightsolutions.io,,TRUE,approved
|
|
4
|
+
Junaid Ramzan,junaid.ramzan,Site Admin,junaid.ramzan@gmail.com,,TRUE,approved
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class CreateRoles < ActiveRecord::Migration[5.0]
|
|
2
|
+
|
|
3
|
+
def change
|
|
4
|
+
create_table(:roles) do |t|
|
|
5
|
+
t.string :name, limit: 256
|
|
6
|
+
t.timestamps
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
create_table :roles_users do |t|
|
|
10
|
+
t.belongs_to :user, index: true
|
|
11
|
+
t.belongs_to :role, index: true
|
|
12
|
+
t.timestamps
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
add_index(:roles_users, [ :user_id, :role_id ], :unique => true)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|