usman 0.1.6dev2 → 0.2.0
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/logo-on-white.png +0 -0
- data/app/assets/images/logo-small.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/assets/sketches/logo.sketch +0 -0
- data/app/controllers/api/v1/base_controller.rb +13 -0
- data/app/controllers/api/v1/registrations_controller.rb +41 -0
- data/app/controllers/usman/admin_controller.rb +26 -0
- data/app/controllers/usman/application_controller.rb +16 -0
- data/app/controllers/usman/dashboard_controller.rb +26 -0
- data/app/controllers/usman/features_controller.rb +83 -0
- data/app/controllers/usman/my_account_controller.rb +25 -0
- data/app/controllers/usman/permissions_controller.rb +85 -0
- data/app/controllers/usman/resource_controller.rb +21 -0
- data/app/controllers/usman/roles_controller.rb +68 -0
- data/app/controllers/usman/sessions_controller.rb +4 -1
- data/app/controllers/usman/user_roles_controller.rb +141 -0
- data/app/controllers/usman/users_controller.rb +133 -0
- data/app/helpers/usman/api_helper.rb +79 -0
- data/app/helpers/usman/authentication_helper.rb +21 -7
- data/app/models/device.rb +149 -0
- data/app/models/feature.rb +11 -7
- data/app/models/permission.rb +17 -13
- data/app/models/registration.rb +108 -0
- data/app/models/role.rb +11 -7
- data/app/models/user.rb +19 -13
- data/app/services/usman/mobile_registration_service.rb +127 -0
- data/app/views/layouts/kuppayam/_sidebar.html.erb +39 -19
- data/app/views/layouts/kuppayam/profile.html.erb +120 -0
- data/app/views/usman/dashboard/index.html.erb +118 -0
- data/app/views/usman/{admin/features → features}/_form.html.erb +1 -1
- data/app/views/usman/{admin/features → features}/_index.html.erb +10 -10
- data/app/views/usman/{admin/features → features}/_row.html.erb +10 -10
- data/app/views/usman/{admin/features → features}/_show.html.erb +2 -2
- data/app/views/usman/{admin/features → features}/index.html.erb +4 -4
- data/app/views/usman/my_account/index.html.erb +1 -0
- data/app/views/usman/{admin/permissions → permissions}/_form.html.erb +1 -1
- data/app/views/usman/{admin/permissions → permissions}/_index.html.erb +2 -2
- data/app/views/usman/{admin/permissions → permissions}/_row.html.erb +2 -2
- data/app/views/usman/{admin/permissions → permissions}/_show.html.erb +2 -2
- data/app/views/usman/{admin/permissions → permissions}/index.html.erb +4 -4
- data/app/views/usman/{admin/roles → roles}/_form.html.erb +1 -1
- data/app/views/usman/{admin/roles → roles}/_index.html.erb +3 -3
- data/app/views/usman/{admin/roles → roles}/_row.html.erb +3 -3
- data/app/views/usman/{admin/roles → roles}/_show.html.erb +6 -6
- data/app/views/usman/{admin/roles → roles}/index.html.erb +5 -5
- data/app/views/usman/sessions/_form.html.erb +1 -1
- data/app/views/usman/{admin/user_roles → user_roles}/_form.html.erb +1 -1
- data/app/views/usman/{admin/user_roles → user_roles}/_index.html.erb +2 -2
- data/app/views/usman/{admin/user_roles → user_roles}/_row.html.erb +3 -3
- data/app/views/usman/{admin/users → users}/_form.html.erb +1 -1
- data/app/views/usman/{admin/users → users}/_index.html.erb +9 -9
- data/app/views/usman/{admin/users → users}/_row.html.erb +9 -9
- data/app/views/usman/{admin/users → users}/_show.html.erb +8 -8
- data/app/views/usman/{admin/users → users}/index.html.erb +8 -8
- data/config/locales/usman/mobile_registration.ar.yml +14 -0
- data/config/locales/usman/mobile_registration.en.yml +14 -0
- data/config/routes.rb +25 -21
- data/db/master_data/roles.csv +2 -0
- data/db/migrate/{20170728095744_create_otp_registrations.rb → 20170819113217_create_registrations.rb} +4 -4
- data/db/migrate/20170819113218_add_registration_id_to_users.rb +7 -0
- data/db/migrate/20170819113219_create_devices.rb +41 -0
- data/lib/tasks/usman/data.rake +85 -0
- data/lib/tasks/usman/master_data.rake +44 -0
- data/lib/usman/engine.rb +2 -1
- data/lib/usman/version.rb +1 -1
- metadata +111 -52
- data/app/controllers/usman/admin/base_controller.rb +0 -46
- data/app/controllers/usman/admin/dashboard_controller.rb +0 -26
- data/app/controllers/usman/admin/features_controller.rb +0 -83
- data/app/controllers/usman/admin/permissions_controller.rb +0 -85
- data/app/controllers/usman/admin/resource_controller.rb +0 -17
- data/app/controllers/usman/admin/roles_controller.rb +0 -68
- data/app/controllers/usman/admin/user_roles_controller.rb +0 -142
- data/app/controllers/usman/admin/users_controller.rb +0 -133
- data/app/views/usman/admin/dashboard/index.html.erb +0 -51
- data/config/initializers/overide_kuppayam_controllers.rb +0 -74
- data/lib/tasks/usman/all.rake +0 -73
- /data/app/views/usman/{admin/permissions → permissions}/_action_buttons.html.erb +0 -0
- /data/config/locales/{kuppayam → usman}/authentication.ar.yml +0 -0
- /data/config/locales/{kuppayam → usman}/authentication.en.yml +0 -0
- /data/db/{import_data → data}/dummy/features.csv +0 -0
- /data/db/{import_data → data}/dummy/permissions.csv +0 -0
- /data/db/{import_data → data}/dummy/roles.csv +0 -0
- /data/db/{import_data → data}/dummy/users.csv +0 -0
- /data/db/{import_data → data}/features.csv +0 -0
- /data/db/{import_data → data}/permissions.csv +0 -0
- /data/db/{import_data → data}/roles.csv +0 -0
- /data/db/{import_data → data}/users.csv +0 -0
@@ -12,20 +12,20 @@
|
|
12
12
|
<tbody>
|
13
13
|
<% @features.each_with_index do |feature, i| %>
|
14
14
|
|
15
|
-
<% edit_link =
|
16
|
-
<% delete_link =
|
15
|
+
<% edit_link = edit_feature_path(id: feature.id) %>
|
16
|
+
<% delete_link = feature_path(id: feature.id) %>
|
17
17
|
|
18
18
|
<tr id="tr_feature_<%= feature.id %>">
|
19
19
|
|
20
20
|
<td class="feature-image"></td>
|
21
21
|
|
22
22
|
<td class="feature-image">
|
23
|
-
<%= link_to(
|
23
|
+
<%= link_to(feature_path(feature), remote: true) do %>
|
24
24
|
<%= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
|
25
25
|
<% end %>
|
26
26
|
</td>
|
27
27
|
|
28
|
-
<td class="feature-name"><%= link_to feature.name,
|
28
|
+
<td class="feature-name"><%= link_to feature.name, feature_path(feature), remote: true %></td>
|
29
29
|
|
30
30
|
<td>
|
31
31
|
<% if feature.unpublished? %>
|
@@ -42,20 +42,20 @@
|
|
42
42
|
<% case feature.status %>
|
43
43
|
<% when "published" %>
|
44
44
|
<!-- Un-Publish -->
|
45
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"),
|
45
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_feature_path(:id =>feature.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
46
46
|
|
47
47
|
<!-- Disable -->
|
48
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"),
|
48
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"), update_status_feature_path(:id =>feature.id, :status =>'disabled'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
49
49
|
<% when "unpublished" %>
|
50
50
|
<!-- Approve -->
|
51
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"),
|
51
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_feature_path(:id =>feature.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
52
52
|
<!-- Disable -->
|
53
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"),
|
53
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"), update_status_feature_path(:id =>feature.id, :status =>'disabled'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
54
54
|
<% when "disabled" %>
|
55
55
|
<!-- Un-Publish -->
|
56
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"),
|
56
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_feature_path(:id =>feature.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
57
57
|
<!-- Approve -->
|
58
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"),
|
58
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_feature_path(:id =>feature.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1",:class=>"feature_status" %>
|
59
59
|
<% end %>
|
60
60
|
|
61
61
|
</td>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
<% edit_link =
|
2
|
-
<% delete_link =
|
1
|
+
<% edit_link = edit_feature_path(id: feature.id) %>
|
2
|
+
<% delete_link = feature_path(id: feature.id) %>
|
3
3
|
|
4
4
|
<tr id="tr_feature_<%= feature.id %>">
|
5
5
|
|
6
6
|
<td class="feature-image">
|
7
|
-
<%= link_to(
|
7
|
+
<%= link_to(feature_path(feature), remote: true) do %>
|
8
8
|
<%= display_image(feature, "feature_image.image.small.url", width: "32", height: "auto", class: "img-rectangle", alt: feature.display_name) %>
|
9
9
|
<% end %>
|
10
10
|
</td>
|
11
11
|
|
12
|
-
<td class="feature-name"><%= link_to feature.name,
|
12
|
+
<td class="feature-name"><%= link_to feature.name, feature_path(feature), remote: true %></td>
|
13
13
|
|
14
14
|
<td>
|
15
15
|
<% if feature.unpublished? %>
|
@@ -26,20 +26,20 @@
|
|
26
26
|
<% case feature.status %>
|
27
27
|
<% when "published" %>
|
28
28
|
<!-- Un-Publish -->
|
29
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"),
|
29
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_feature_path(:id =>feature.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
30
30
|
|
31
31
|
<!-- Disable -->
|
32
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"),
|
32
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"), update_status_feature_path(:id =>feature.id, :status =>'disabled'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
33
33
|
<% when "unpublished" %>
|
34
34
|
<!-- Approve -->
|
35
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"),
|
35
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_feature_path(:id =>feature.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
36
36
|
<!-- Disable -->
|
37
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"),
|
37
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Disable"), update_status_feature_path(:id =>feature.id, :status =>'disabled'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
38
38
|
<% when "disabled" %>
|
39
39
|
<!-- Un-Publish -->
|
40
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"),
|
40
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_feature_path(:id =>feature.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"feature_status" %>
|
41
41
|
<!-- Approve -->
|
42
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"),
|
42
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_feature_path(:id =>feature.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1",:class=>"feature_status" %>
|
43
43
|
<% end %>
|
44
44
|
|
45
45
|
</td>
|
@@ -38,8 +38,8 @@
|
|
38
38
|
|
39
39
|
<div>
|
40
40
|
<%
|
41
|
-
edit_link =
|
42
|
-
delete_link =
|
41
|
+
edit_link = edit_feature_url(id: @feature.id)
|
42
|
+
delete_link = feature_url(id: @feature.id)
|
43
43
|
%>
|
44
44
|
|
45
45
|
<%= link_to raw("<i class=\"fa fa-close mr-5\"></i> <span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "btn btn-white pull-left" %>
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<div class="row">
|
12
12
|
<div class="col-md-6">
|
13
13
|
|
14
|
-
<%= theme_button('Add a Feature', 'plus',
|
14
|
+
<%= theme_button('Add a Feature', 'plus', new_feature_path(), classes: "pull-left", btn_type: "success") %>
|
15
15
|
|
16
|
-
<%= theme_button('Refresh', 'refresh',
|
16
|
+
<%= theme_button('Refresh', 'refresh', features_path(), classes: "pull-left ml-10", btn_type: "white") %>
|
17
17
|
|
18
18
|
<!-- Single button -->
|
19
19
|
<div class="ml-10 btn-group hidden">
|
@@ -30,14 +30,14 @@
|
|
30
30
|
|
31
31
|
</div>
|
32
32
|
<div class="col-md-6">
|
33
|
-
<%= search_form_kuppayam(Feature,
|
33
|
+
<%= search_form_kuppayam(Feature, features_path, text: @filters[:query]) %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
<%= clear_tag(10) %>
|
38
38
|
|
39
39
|
<div id="div_feature_index">
|
40
|
-
<%= render :partial=>"usman/
|
40
|
+
<%= render :partial=>"usman/features/index" %>
|
41
41
|
</div>
|
42
42
|
<%= clear_tag(10) %>
|
43
43
|
|
@@ -0,0 +1 @@
|
|
1
|
+
My Account - yet to be done
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for([
|
1
|
+
<%= form_for([@permission], :html => {:id=>"form_permission", :class=>"mb-0 form-horizontal", :role => "form", :method => (@permission.new_record? ? :post : :put), :remote=>true}) do |f| %>
|
2
2
|
|
3
3
|
<div id="permission_form_error">
|
4
4
|
<%= @permission.errors[:base].to_sentence %>
|
@@ -16,8 +16,8 @@
|
|
16
16
|
</thead>
|
17
17
|
<tbody>
|
18
18
|
<% @permissions.each_with_index do |permission, i| %>
|
19
|
-
<% edit_link =
|
20
|
-
<% delete_link =
|
19
|
+
<% edit_link = edit_permission_path(id: permission.id) %>
|
20
|
+
<% delete_link = permission_path(id: permission.id) %>
|
21
21
|
|
22
22
|
<tr id="tr_permission_<%= permission.id %>">
|
23
23
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% edit_link =
|
2
|
-
<% delete_link =
|
1
|
+
<% edit_link = edit_permission_path(id: permission.id) %>
|
2
|
+
<% delete_link = permission_path(id: permission.id) %>
|
3
3
|
|
4
4
|
<tr id="tr_permission_<%= permission.id %>">
|
5
5
|
|
@@ -26,8 +26,8 @@
|
|
26
26
|
|
27
27
|
<div>
|
28
28
|
<%
|
29
|
-
edit_link =
|
30
|
-
delete_link =
|
29
|
+
edit_link = edit_permission_url(id: @permission.id)
|
30
|
+
delete_link = permission_url(id: @permission.id)
|
31
31
|
%>
|
32
32
|
|
33
33
|
<%= link_to raw("<i class=\"fa fa-close mr-5\"></i> <span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "btn btn-white pull-left" %>
|
@@ -11,9 +11,9 @@
|
|
11
11
|
<div class="row">
|
12
12
|
<div class="col-md-6">
|
13
13
|
|
14
|
-
<%= theme_button('Add a Permission', 'plus',
|
14
|
+
<%= theme_button('Add a Permission', 'plus', new_permission_path(), classes: "pull-left", btn_type: "success") %>
|
15
15
|
|
16
|
-
<%= theme_button('Refresh', 'refresh',
|
16
|
+
<%= theme_button('Refresh', 'refresh', permissions_path(), classes: "pull-left ml-10", btn_type: "white") %>
|
17
17
|
|
18
18
|
<!-- Single button -->
|
19
19
|
<div class="ml-10 btn-group hidden">
|
@@ -30,14 +30,14 @@
|
|
30
30
|
|
31
31
|
</div>
|
32
32
|
<div class="col-md-6">
|
33
|
-
<%= search_form_kuppayam(Permission,
|
33
|
+
<%= search_form_kuppayam(Permission, permissions_path, text: @filters[:query]) %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
</div>
|
37
37
|
<%= clear_tag(10) %>
|
38
38
|
|
39
39
|
<div id="div_permission_index">
|
40
|
-
<%= render :partial=>"usman/
|
40
|
+
<%= render :partial=>"usman/permissions/index" %>
|
41
41
|
</div>
|
42
42
|
<%= clear_tag(10) %>
|
43
43
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for([
|
1
|
+
<%= form_for([@role], :html => {:id=>"form_role", :class=>"mb-0 form-horizontal", :role => "form", :method => (@role.new_record? ? :post : :put), :remote=>true}) do |f| %>
|
2
2
|
|
3
3
|
<div id="role_form_error">
|
4
4
|
<%= @role.errors[:base].to_sentence %>
|
@@ -11,8 +11,8 @@
|
|
11
11
|
<tbody>
|
12
12
|
<% @roles.each_with_index do |role, i| %>
|
13
13
|
|
14
|
-
<% edit_link =
|
15
|
-
<% delete_link =
|
14
|
+
<% edit_link = edit_role_path(id: role.id) %>
|
15
|
+
<% delete_link = role_path(id: role.id) %>
|
16
16
|
|
17
17
|
<tr id="tr_role_<%= role.id %>">
|
18
18
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<% end %>
|
25
25
|
</th>
|
26
26
|
|
27
|
-
<td class="role-name"><%= link_to role.name,
|
27
|
+
<td class="role-name"><%= link_to role.name, role_path(role), remote: true %></td>
|
28
28
|
|
29
29
|
<td class="action-links" style="width:10%">
|
30
30
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% edit_link =
|
2
|
-
<% delete_link =
|
1
|
+
<% edit_link = edit_role_path(id: role.id) %>
|
2
|
+
<% delete_link = role_path(id: role.id) %>
|
3
3
|
|
4
4
|
<tr id="tr_role_<%= role.id %>">
|
5
5
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
</th>
|
13
13
|
|
14
|
-
<td class="role-name"><%= link_to role.name,
|
14
|
+
<td class="role-name"><%= link_to role.name, role_path(role), remote: true %></td>
|
15
15
|
|
16
16
|
<td class="action-links" style="width:10%">
|
17
17
|
|
@@ -18,8 +18,8 @@
|
|
18
18
|
|
19
19
|
<div class="col-md-3 col-sm-12 col-xs-12">
|
20
20
|
|
21
|
-
<% edit_link =
|
22
|
-
<% delete_link =
|
21
|
+
<% edit_link = edit_role_path(id: @role.id) %>
|
22
|
+
<% delete_link = role_path(id: @role.id) %>
|
23
23
|
|
24
24
|
<%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Role"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @current_user.super_admin? and @role.can_be_edited? %>
|
25
25
|
|
@@ -60,19 +60,19 @@
|
|
60
60
|
<div class="row">
|
61
61
|
<div class="col-md-6">
|
62
62
|
|
63
|
-
<%= theme_button('Add a User', 'plus',
|
63
|
+
<%= theme_button('Add a User', 'plus', new_role_user_path(@role), classes: "pull-left", btn_type: "success") %>
|
64
64
|
|
65
|
-
<%= theme_button('Refresh', 'refresh',
|
65
|
+
<%= theme_button('Refresh', 'refresh', role_users_path(@role), classes: "pull-left ml-10", btn_type: "white") %>
|
66
66
|
</div>
|
67
67
|
<div class="col-md-6">
|
68
|
-
<%= search_form_kuppayam(User,
|
68
|
+
<%= search_form_kuppayam(User, role_users_path(@role), text: "") %>
|
69
69
|
</div>
|
70
70
|
</div>
|
71
71
|
</div>
|
72
72
|
<%= clear_tag(10) %>
|
73
73
|
|
74
74
|
<div id="div_user_index">
|
75
|
-
<%= render :partial=>"usman/
|
75
|
+
<%= render :partial=>"usman/user_roles/index" %>
|
76
76
|
</div>
|
77
77
|
</div>
|
78
78
|
|
@@ -11,11 +11,11 @@
|
|
11
11
|
<div class="row">
|
12
12
|
<div class="col-md-6">
|
13
13
|
|
14
|
-
<%= theme_button('Add a Role', 'plus',
|
14
|
+
<%= theme_button('Add a Role', 'plus', new_role_path(), classes: "pull-left", btn_type: "success") if @current_user.super_admin? %>
|
15
15
|
|
16
|
-
<%= theme_button('Refresh', 'refresh',
|
16
|
+
<%= theme_button('Refresh', 'refresh', roles_path(), classes: "pull-left ml-10", btn_type: "white") %>
|
17
17
|
|
18
|
-
<%= theme_button('Manage Users', 'nothing linecons-graduation-cap',
|
18
|
+
<%= theme_button('Manage Users', 'nothing linecons-graduation-cap', users_path(), classes: "pull-left ml-10", btn_type: "white", remote: false) %>
|
19
19
|
|
20
20
|
<!-- Single button -->
|
21
21
|
<div class="ml-10 btn-group hidden">
|
@@ -32,14 +32,14 @@
|
|
32
32
|
|
33
33
|
</div>
|
34
34
|
<div class="col-md-6">
|
35
|
-
<%= search_form_kuppayam(Role,
|
35
|
+
<%= search_form_kuppayam(Role, roles_path, text: @filters[:query]) %>
|
36
36
|
</div>
|
37
37
|
</div>
|
38
38
|
</div>
|
39
39
|
<%= clear_tag(10) %>
|
40
40
|
|
41
41
|
<div id="div_role_index">
|
42
|
-
<%= render :partial=>"usman/
|
42
|
+
<%= render :partial=>"usman/roles/index" %>
|
43
43
|
</div>
|
44
44
|
<%= clear_tag(10) %>
|
45
45
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for([
|
1
|
+
<%= form_for([@role, @user], :html => {:id=>"form_user", :class=>"mb-0 form-horizontal", :user => "form", :method => (@user.new_record? ? :post : :put), :remote=>true}) do |f| %>
|
2
2
|
|
3
3
|
<div id="user_form_error">
|
4
4
|
<%= @user.errors[:base].to_sentence %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<tbody>
|
14
14
|
<% @users.each_with_index do |user, i| %>
|
15
15
|
|
16
|
-
<% delete_link =
|
16
|
+
<% delete_link = role_user_path(@role, user) %>
|
17
17
|
|
18
18
|
<tr id="tr_user_<%= user.id %>">
|
19
19
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
</th>
|
27
27
|
|
28
28
|
<td class="user-image">
|
29
|
-
<%= link_to(
|
29
|
+
<%= link_to(user_path(user), remote: true) do %>
|
30
30
|
<%= display_image(user, "profile_picture.image.small.url", width: "120", height: "auto", class: "img-rectangle", alt: user.display_name) %>
|
31
31
|
<% end %>
|
32
32
|
</td>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% edit_link =
|
2
|
-
<% delete_link =
|
1
|
+
<% edit_link = edit_role_user_path(@role, user) %>
|
2
|
+
<% delete_link = role_user_path(@role, user) %>
|
3
3
|
|
4
4
|
<tr id="tr_user_<%= user.id %>">
|
5
5
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
</th>
|
13
13
|
|
14
14
|
<td class="user-image">
|
15
|
-
<%= link_to(
|
15
|
+
<%= link_to(user_path(user), remote: true) do %>
|
16
16
|
<%= display_image(user, "profile_picture.image.small.url", width: "120", height: "auto", class: "img-rectangle", alt: user.display_name) %>
|
17
17
|
<% end %>
|
18
18
|
</td>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= form_for([
|
1
|
+
<%= form_for([@user], :html => {:id=>"form_user", :class=>"mb-0 form-horizontal", :role => "form", :method => (@user.new_record? ? :post : :put), :remote=>true}) do |f| %>
|
2
2
|
|
3
3
|
<div id="user_form_error">
|
4
4
|
<%= @user.errors[:base].to_sentence %>
|
@@ -15,8 +15,8 @@
|
|
15
15
|
<tbody>
|
16
16
|
<% @users.each_with_index do |user, i| %>
|
17
17
|
|
18
|
-
<% edit_link =
|
19
|
-
<% delete_link =
|
18
|
+
<% edit_link = edit_user_path(id: user.id) %>
|
19
|
+
<% delete_link = user_path(id: user.id) %>
|
20
20
|
|
21
21
|
<tr id="tr_user_<%= user.id %>">
|
22
22
|
|
@@ -33,16 +33,16 @@
|
|
33
33
|
</th>
|
34
34
|
|
35
35
|
<td class="user-image">
|
36
|
-
<%= link_to(
|
36
|
+
<%= link_to(user_path(user), remote: true) do %>
|
37
37
|
<%= display_image(user, "profile_picture.image.small.url", width: "120", height: "auto", class: "img-rectangle", alt: user.display_name) %>
|
38
38
|
<% end %>
|
39
39
|
</td>
|
40
40
|
|
41
|
-
<td class="user-name"><%= link_to user.name,
|
41
|
+
<td class="user-name"><%= link_to user.name, user_path(user), remote: true %></td>
|
42
42
|
|
43
|
-
<td class="hidden-xs hidden-sm"><%= link_to user.username,
|
43
|
+
<td class="hidden-xs hidden-sm"><%= link_to user.username, user_path(user), remote: true %></td>
|
44
44
|
|
45
|
-
<td class="hidden-xs hidden-sm"><%= link_to user.email,
|
45
|
+
<td class="hidden-xs hidden-sm"><%= link_to user.email, user_path(user), remote: true, class: "email" %></td>
|
46
46
|
|
47
47
|
<% if @current_user.super_admin? %>
|
48
48
|
<td class="hidden-xs hidden-sm">
|
@@ -83,13 +83,13 @@
|
|
83
83
|
<td class="action-links" style="width:15%">
|
84
84
|
|
85
85
|
<!-- Approve -->
|
86
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"),
|
86
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"), update_status_user_path(:id =>user.id, :status =>'approved'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_approved? && (@current_user != user) %>
|
87
87
|
|
88
88
|
<!-- Mark as Pending -->
|
89
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"),
|
89
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"), update_status_user_path(:id =>user.id, :status =>'pending'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_marked_as_pending? && (@current_user != user) %>
|
90
90
|
|
91
91
|
<!-- Suspend -->
|
92
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"),
|
92
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"), update_status_user_path(:id =>user.id, :status =>'suspended'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_suspended? && (@current_user != user) %>
|
93
93
|
|
94
94
|
</td>
|
95
95
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% edit_link =
|
2
|
-
<% delete_link =
|
1
|
+
<% edit_link = edit_user_path(id: user.id) %>
|
2
|
+
<% delete_link = user_path(id: user.id) %>
|
3
3
|
|
4
4
|
<tr id="tr_user_<%= user.id %>">
|
5
5
|
|
@@ -16,16 +16,16 @@
|
|
16
16
|
</th>
|
17
17
|
|
18
18
|
<td class="user-image hidden-xs hidden-sm">
|
19
|
-
<%= link_to(
|
19
|
+
<%= link_to(user_path(user), remote: true) do %>
|
20
20
|
<%= display_image(user, "profile_picture.image.small.url", width: "120", height: "auto", class: "img-rectangle", alt: user.display_name) %>
|
21
21
|
<% end %>
|
22
22
|
</td>
|
23
23
|
|
24
|
-
<td class="user-name"><%= link_to user.name,
|
24
|
+
<td class="user-name"><%= link_to user.name, user_path(user), remote: true %></td>
|
25
25
|
|
26
|
-
<td class="hidden-xs hidden-sm"><%= link_to user.username,
|
26
|
+
<td class="hidden-xs hidden-sm"><%= link_to user.username, user_path(user), remote: true %></td>
|
27
27
|
|
28
|
-
<td class="hidden-xs hidden-sm"><%= link_to user.email,
|
28
|
+
<td class="hidden-xs hidden-sm"><%= link_to user.email, user_path(user), remote: true, class: "email" %></td>
|
29
29
|
|
30
30
|
<% if @current_user.super_admin? %>
|
31
31
|
<td class="hidden-xs hidden-sm">
|
@@ -58,13 +58,13 @@
|
|
58
58
|
<td class="action-links" style="width:15%">
|
59
59
|
|
60
60
|
<!-- Approve -->
|
61
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"),
|
61
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"), update_status_user_path(:id =>user.id, :status =>'approved'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_approved? && (@current_user != user) %>
|
62
62
|
|
63
63
|
<!-- Mark as Pending -->
|
64
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"),
|
64
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"), update_status_user_path(:id =>user.id, :status =>'pending'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_marked_as_pending? && (@current_user != user) %>
|
65
65
|
|
66
66
|
<!-- Suspend -->
|
67
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"),
|
67
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"), update_status_user_path(:id =>user.id, :status =>'suspended'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1" if user.can_be_suspended? && (@current_user != user) %>
|
68
68
|
|
69
69
|
</td>
|
70
70
|
|
@@ -41,8 +41,8 @@
|
|
41
41
|
|
42
42
|
<div class="col-md-3 col-sm-12 col-xs-12">
|
43
43
|
|
44
|
-
<% edit_link =
|
45
|
-
<% delete_link =
|
44
|
+
<% edit_link = edit_user_path(id: @user.id) %>
|
45
|
+
<% delete_link = user_path(id: @user.id) %>
|
46
46
|
|
47
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
48
|
|
@@ -50,24 +50,24 @@
|
|
50
50
|
|
51
51
|
<% if @current_user.super_admin? %>
|
52
52
|
|
53
|
-
<%= link_to raw("<i class=\"linecons-paper-plane\"></i> Masquerade"),
|
53
|
+
<%= link_to raw("<i class=\"linecons-paper-plane\"></i> Masquerade"), masquerade_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
54
|
|
55
55
|
<!-- Remove Super Admin -->
|
56
|
-
<%= link_to raw("<i class=\"fa fa-remove mr-5\"></i> Remove Super Admin"),
|
56
|
+
<%= link_to raw("<i class=\"fa fa-remove mr-5\"></i> Remove Super Admin"), remove_super_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
57
|
|
58
58
|
<!-- Make Super Admin -->
|
59
|
-
<%= link_to raw("<i class=\"fa fa-plus-square mr-5\"></i> Make Super Admin"),
|
59
|
+
<%= link_to raw("<i class=\"fa fa-plus-square mr-5\"></i> Make Super Admin"), make_super_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
60
|
|
61
61
|
<% end %>
|
62
62
|
|
63
63
|
<!-- Approve -->
|
64
|
-
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"),
|
64
|
+
<%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Approve"), update_status_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? && (@current_user != @user) %>
|
65
65
|
|
66
66
|
<!-- Mark as Pending -->
|
67
|
-
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"),
|
67
|
+
<%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"), update_status_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
68
|
|
69
69
|
<!-- Suspend -->
|
70
|
-
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"),
|
70
|
+
<%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"), update_status_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
71
|
|
72
72
|
<div class="visible-sm visible-xs mb-50"></div>
|
73
73
|
|
@@ -6,14 +6,14 @@
|
|
6
6
|
<%# Show Admin tab only for admins %>
|
7
7
|
<% if @current_user.super_admin? %>
|
8
8
|
<li class="<%= @super_admin == false ? 'active' : '' %>">
|
9
|
-
<%= link_to "Users",
|
9
|
+
<%= link_to "Users", users_path(sa: '0') %>
|
10
10
|
</li>
|
11
11
|
<li class="<%= @super_admin == true ? 'active' : '' %>">
|
12
|
-
<%= link_to "Administrators",
|
12
|
+
<%= link_to "Administrators", users_path(sa: '1') %>
|
13
13
|
</li>
|
14
14
|
<% else %>
|
15
15
|
<li class="active">
|
16
|
-
<%= link_to "Users",
|
16
|
+
<%= link_to "Users", users_path(sa: '0') %>
|
17
17
|
</li>
|
18
18
|
<% end %>
|
19
19
|
|
@@ -26,11 +26,11 @@
|
|
26
26
|
<div class="row">
|
27
27
|
<div class="col-md-6">
|
28
28
|
|
29
|
-
<%= theme_button('Add a User', 'plus',
|
29
|
+
<%= theme_button('Add a User', 'plus', new_user_path(), classes: "pull-left", btn_type: "success") %>
|
30
30
|
|
31
|
-
<%= theme_button('Refresh', 'refresh',
|
31
|
+
<%= theme_button('Refresh', 'refresh', users_path(), classes: "pull-left ml-10", btn_type: "white") %>
|
32
32
|
|
33
|
-
<%= theme_button('Manage Roles', 'nothing linecons-graduation-cap',
|
33
|
+
<%= theme_button('Manage Roles', 'nothing linecons-graduation-cap', roles_path(), classes: "pull-left ml-10", btn_type: "white", remote: false) %>
|
34
34
|
|
35
35
|
<!-- Single button -->
|
36
36
|
<div class="ml-10 btn-group hidden">
|
@@ -47,14 +47,14 @@
|
|
47
47
|
|
48
48
|
</div>
|
49
49
|
<div class="col-md-6">
|
50
|
-
<%= search_form_kuppayam(User,
|
50
|
+
<%= search_form_kuppayam(User, users_path, text: @filters[:query]) %>
|
51
51
|
</div>
|
52
52
|
</div>
|
53
53
|
</div>
|
54
54
|
<%= clear_tag(10) %>
|
55
55
|
|
56
56
|
<div id="div_user_index">
|
57
|
-
<%= render :partial=>"usman/
|
57
|
+
<%= render :partial=>"usman/users/index" %>
|
58
58
|
</div>
|
59
59
|
<%= clear_tag(10) %>
|
60
60
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
en:
|
2
|
+
mobile_registration:
|
3
|
+
device_blocked:
|
4
|
+
heading: "This device is blocked."
|
5
|
+
message: "You must have done some mal-practices."
|
6
|
+
invalid_inputs:
|
7
|
+
heading: "Registring new mobile number FAILED."
|
8
|
+
message: "Check if all mandatory details are passed. Refer the error details for technical information."
|
9
|
+
otp_sent:
|
10
|
+
heading: "An OTP has been sent to you"
|
11
|
+
message: "Check your mobile for new message from us."
|
12
|
+
otp_not_sent:
|
13
|
+
heading: "OTP was not sent"
|
14
|
+
message: "There was some technical glitch and OTP was not sent. Try after some time."
|