usman 0.3.8 → 0.3.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 479e1edd33576baf3784bcecc8165178e3c1da93
4
- data.tar.gz: 34e9499b5fcf9ce47220b6eb8fc007b13860029d
3
+ metadata.gz: 7c9994e5cbd0656c7e474abba0af96316e2026ff
4
+ data.tar.gz: fe09a804f3dd1eededff04c8d8e023303ac79c52
5
5
  SHA512:
6
- metadata.gz: f146961b5e325920447f76b33fb9bb1b00cc1791db67e02106ebe90b2dceb4d14e7a5649d0378e6230655567f49d94efbe55d8709aed06db21909f230fbd97fe
7
- data.tar.gz: f1b73771b7cf1493af891b1928e88bd5aedae0c56e7d389f5da7795e46762ba896f36768bbc280461e9c22d1c7fb62857c9478977a4e1b465465bdcec8712cfd
6
+ metadata.gz: 184a2ddb395120ca4c1a9c24034211e4260f8650935c771f3d30e56c0119cd2be5cf3c30460744b56748d083b44599c8f12bb844d91e1fe03d255076e10bfdf5
7
+ data.tar.gz: 4b237890aab134dd28f5f5fcb0323ff3b94d447f2a62605a13e2c40705ceaa034005ca4aca179c5333b97d7afebc2a4e339abb34603eb4454b1178b49951bec1
@@ -21,5 +21,9 @@ module Usman
21
21
  @filter_param_mapping[:feature] = :ft
22
22
  end
23
23
 
24
+ def breadcrumb_home_path
25
+ usman.dashboard_path
26
+ end
27
+
24
28
  end
25
29
  end
@@ -66,7 +66,7 @@ module Usman
66
66
  heading: "Manage Features",
67
67
  icon: "lincons-diamond",
68
68
  description: "Listing all Features",
69
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'},
69
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
70
70
  {name: "Manage Features", link: features_path, icon: 'fa-calendar', active: true}]
71
71
  }
72
72
  end
@@ -11,7 +11,7 @@ module Usman
11
11
  {
12
12
  heading: "My Account",
13
13
  description: "Manage Account, Profile & Settings",
14
- links: [{name: "Dashboard", link: dashboard_path, icon: 'fa-dashboard'},
14
+ links: [{name: "Dashboard", link: breadcrumb_home_path, icon: 'fa-dashboard'},
15
15
  {name: "My Account", link: "#", icon: 'fa-user'}]
16
16
  }
17
17
  end
@@ -68,7 +68,7 @@ module Usman
68
68
  heading: "Manage Permissions",
69
69
  icon: "fa-lock",
70
70
  description: "Listing all Permissions",
71
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'},
71
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
72
72
  {name: "Manage Permissions", link: permissions_path, icon: 'fa-calendar', active: true}]
73
73
  }
74
74
  end
@@ -81,7 +81,7 @@ module Usman
81
81
  {
82
82
  heading: "Manage Device Registrations",
83
83
  description: "Listing all Device Registrations",
84
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'}]
84
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'}]
85
85
  }
86
86
  end
87
87
 
@@ -65,7 +65,7 @@ module Usman
65
65
  heading: "Manage Registrations",
66
66
  icon: "linecons-mobile",
67
67
  description: "Listing all Registrations",
68
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'},
68
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
69
69
  {name: "Manage Registrations", link: registrations_path, icon: 'linecons-mobile', active: true}]
70
70
  }
71
71
  end
@@ -16,6 +16,5 @@ module Usman
16
16
  @filter_param_mapping[:user] = :us
17
17
  @filter_param_mapping[:feature] = :ft
18
18
  end
19
-
20
19
  end
21
20
  end
@@ -51,7 +51,7 @@ module Usman
51
51
  heading: "Manage Roles",
52
52
  icon: "fa-lock",
53
53
  description: "Listing all Roles",
54
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'},
54
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
55
55
  {name: "Manage Roles", link: roles_path, icon: 'fa-calendar', active: true}]
56
56
  }
57
57
  end
@@ -125,7 +125,7 @@ module Usman
125
125
  {
126
126
  heading: "Manage User Roles",
127
127
  description: "Listing all User Roles",
128
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'}]
128
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'}]
129
129
  }
130
130
  end
131
131
 
@@ -130,7 +130,7 @@ module Usman
130
130
  heading: "Manage Users",
131
131
  icon: "fa-user",
132
132
  description: "Listing all Users",
133
- links: [{name: "Home", link: dashboard_path, icon: 'fa-home'},
133
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'},
134
134
  {name: "Manage Users", link: users_path, icon: 'fa-user', active: true}]
135
135
  }
136
136
  end
@@ -2,5 +2,11 @@ class ProfileSerializer < ActiveModel::Serializer
2
2
  include NullAttributeReplacer
3
3
  attributes :id, :name, :gender, :date_of_birth, :username, :email, :phone, :dummy
4
4
 
5
- has_one :profile_picture, class_name: "Image::ProfilePicture", serializer: ProfilePictureSerializer
5
+ has_one :profile_picture, class_name: "Image::ProfilePicture", serializer: ProfilePictureSerializer do
6
+ if object.profile_picture
7
+ object.profile_picture
8
+ else
9
+ object.build_profile_picture
10
+ end
11
+ end
6
12
  end
@@ -22,21 +22,21 @@
22
22
  <tr><th>Operating System</th><td><%= @device.operating_system %></td></tr>
23
23
  <tr><th>Software Version</th><td><%= @device.software_version %></td></tr>
24
24
 
25
- <tr><th>Last Accesssed API</th><td><%= @device.last_accessed_api %></td></tr>
26
- <tr><th>Last Accessed At</th><td><%= @device.last_accessed_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.last_accessed_at %></td></tr>
25
+ <tr><th>Device Name</th><td><%= @device.device_name %></td></tr>
26
+ <tr><th>Device Type</th><td><%= @device.device_type %></td></tr>
27
+ <tr><th>Device Token</th><td><%= @device.device_token %></td></tr>
27
28
 
28
29
  <% if @current_user.super_admin? %>
29
30
  <tr><th>OTP</th><td><%= @device.otp %></td></tr>
30
- <% else %>
31
- <tr><th>Device Token</th><td><%= @device.device_token %></td></tr>
32
- <% end %>
33
- <tr><th>OTP Sent At</th><td><%= @device.otp_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.otp_sent_at %></td></tr>
34
-
35
- <% if @current_user.super_admin? %>
31
+ <tr><th>OTP Sent At</th><td><%= @device.otp_sent_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.otp_sent_at %></td></tr>
36
32
  <tr><th>API Token</th><td><%= @device.api_token %></td></tr>
37
33
  <% end %>
34
+
38
35
  <tr><th>Token Created At</th><td><%= @device.token_created_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.token_created_at %></td></tr>
39
36
 
37
+ <tr><th>Last Accesssed API</th><td><%= @device.last_accessed_api %></td></tr>
38
+ <tr><th>Last Accessed At</th><td><%= @device.last_accessed_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.last_accessed_at %></td></tr>
39
+
40
40
  <tr><th>Created At</th><td><%= @device.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.created_at %></td></tr>
41
41
  <tr><th>Updated At</th><td><%= @device.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @device.updated_at %></td></tr>
42
42
 
@@ -5,17 +5,19 @@
5
5
 
6
6
  <div class="row">
7
7
 
8
- <% if @user %>
9
8
  <div class="col-md-3 col-sm-6 col-xs-6" style="border-right:1px solid #f1f1f1;">
10
- <%= edit_image(@user,
9
+ <% if @current_user.super_admin? %>
10
+ <%= edit_image(@user,
11
11
  "profile_picture.image.large.url",
12
12
  upload_image_link(@user, :profile_picture, nil ),
13
13
  remove_image_link(@user, :profile_picture, nil ),
14
14
  image_options: {assoc_name: :profile_picture }) %>
15
+ <% else %>
16
+ <%= display_image(@user, "profile_picture.image.large.url", class: "img-circle img-inline userpic-32", alt: @user.display_name) %>
17
+ <% end %>
15
18
  </div>
16
- <% end %>
17
19
 
18
- <div class="col-md-9 col-sm-6 col-xs-6" style="border-right:1px solid #f1f1f1;">
20
+ <div class="col-md-6 col-sm-6 col-xs-6" style="border-right:1px solid #f1f1f1;">
19
21
 
20
22
  <div class="visible-sm visible-xs mt-50"></div>
21
23
 
@@ -41,6 +43,15 @@
41
43
 
42
44
  <div class="col-md-3 col-sm-12 col-xs-12">
43
45
 
46
+ <!-- Mark as Pending -->
47
+ <%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Mark as Pending"), update_status_registration_path(:id =>@registration.id, :status =>'pending'), :method =>'PUT', :remote=>true, class: "btn btn-block btn-white btn-only-hover" unless @registration.pending? %>
48
+
49
+ <!-- Verify -->
50
+ <%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Verify"), update_status_registration_path(:id =>@registration.id, :status =>'verified'), :method =>'PUT', :remote=>true, class: "btn btn-block btn-success" unless @registration.verified? %>
51
+
52
+ <!-- Suspend -->
53
+ <%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Suspend"), update_status_registration_path(:id =>@registration.id, :status =>'suspended'), :method =>'PUT', :remote=>true, class: "btn btn-block btn-danger btn-only-hover" unless @registration.suspended? %>
54
+
44
55
  <%# edit_link = edit_registration_path(id: @registration.id) %>
45
56
  <%# delete_link = registration_path(id: @registration.id) %>
46
57
 
@@ -94,7 +105,20 @@
94
105
 
95
106
  <tr>
96
107
  <th>ID</th><td><%= @registration.id %></td>
97
- <th>Status</th><td><%= @registration.status %></td>
108
+ <th>User / Profile ID</th><td><%= @registration.user_id %></td>
109
+ </tr>
110
+
111
+ <tr>
112
+ <th>Status</th><td>
113
+ <% if @registration.pending? %>
114
+ <span class="label label-default">Pending</span>
115
+ <% elsif @registration.verified? %>
116
+ <span class="label label-success">Verified</span>
117
+ <% elsif @registration.suspended? %>
118
+ <span class="label label-danger">Suspended</span>
119
+ <% end %>
120
+ </td>
121
+ <th></th><td></td>
98
122
  </tr>
99
123
 
100
124
  <tr>
@@ -135,10 +159,30 @@
135
159
  <th>Phone</th><td><%= @user.try(:phone) %></td>
136
160
  </tr>
137
161
 
162
+ <tr>
163
+ <th>Gender</th><td><%= @user.gender %></td>
164
+ <th>Date of Birth</th><td><%= @user.date_of_birth.strftime("%m/%d/%Y") if @user.date_of_birth %></td>
165
+ </tr>
166
+
138
167
  <tr>
139
168
  <th>Designation</th><td><%= @user.try(:designation) %></td>
140
- <th>Status</th><td><%= @user.try(:status).try(:titleize) %></td>
169
+ <th>Status</th><td>
170
+ <% if @user.pending? %>
171
+ <span class="label label-default">Pending</span>
172
+ <% elsif @user.approved? %>
173
+ <span class="label label-success">Approved</span>
174
+ <% elsif @user.suspended? %>
175
+ <span class="label label-danger">Suspended</span>
176
+ <% end %>
177
+ </td>
178
+ </tr>
179
+
180
+ <% if @current_user.super_admin? %>
181
+ <tr>
182
+ <th>Dummy?</th><td><%= @user.dummy.to_s.titleize %></td>
183
+ <th>Super Admin</th><td><%= @user.super_admin?.to_s.titleize %></td>
141
184
  </tr>
185
+ <% end %>
142
186
 
143
187
  </tbody>
144
188
  </table>
@@ -28,13 +28,21 @@
28
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
- <td class="hidden-xs hidden-sm">
32
- <% if user.super_admin %>
33
- <span class="mr-10 mt-5 label label-warning">Super Admin</span>
34
- <% else %>
35
- <span class="mr-10 mt-5 label label-default">Normal</span>
36
- <% end %>
37
- </td>
31
+ <td class="hidden-xs hidden-sm">
32
+ <% if user.super_admin? %>
33
+ <span class="mr-10 mt-5 label label-warning">Super Admin</span>
34
+ <% else %>
35
+ <% user.roles.collect(&:name).each do |r| %>
36
+ <span class="ml-5 label label-primary"><%= r %></span>
37
+ <% end %>
38
+ <% end %>
39
+ </td>
40
+ <% else %>
41
+ <td class="user-name">
42
+ <% user.roles.collect(&:name).each do |r| %>
43
+ <span class="ml-5 label label-primary"><%= r %></span>
44
+ <% end %>
45
+ </td>
38
46
  <% end %>
39
47
 
40
48
  <td>
@@ -6,11 +6,16 @@
6
6
 
7
7
  <div class="col-md-3 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
8
8
 
9
- <%= edit_image(@user,
10
- "profile_picture.image.large.url",
11
- upload_image_link(@user, :profile_picture, nil ),
12
- remove_image_link(@user, :profile_picture, nil ),
13
- image_options: {assoc_name: :profile_picture }) %>
9
+ <% if @current_user.super_admin? %>
10
+ <%= edit_image(@user,
11
+ "profile_picture.image.large.url",
12
+ upload_image_link(@user, :profile_picture, nil ),
13
+ remove_image_link(@user, :profile_picture, nil ),
14
+ image_options: {assoc_name: :profile_picture }) %>
15
+ <% else %>
16
+ <%= display_image(@user, "profile_picture.image.large.url", class: "img-circle img-inline userpic-32", alt: @user.display_name) %>
17
+ <% end %>
18
+
14
19
  </div>
15
20
 
16
21
  <div class="col-md-6 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
@@ -62,7 +67,7 @@
62
67
  <% end %>
63
68
 
64
69
  <!-- Approve -->
65
- <%= 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) %>
70
+ <%= link_to raw("<i class=\"fa fa-check 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) %>
66
71
 
67
72
  <!-- Mark as Pending -->
68
73
  <%= 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) %>
@@ -104,10 +109,9 @@
104
109
  </ul>
105
110
 
106
111
  <div class="tab-content">
107
- <div class="tab-pane active" id="profile_info">
112
+ <div class="tab-pane active" id="profile_info" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;">
108
113
 
109
114
  <%= clear_tag(20) %>
110
-
111
115
  <div class="table-responsive mt-30">
112
116
  <table class="table table-striped table-condensed table-bordered">
113
117
  <tbody>
@@ -122,46 +126,90 @@
122
126
  <th>Phone</th><td><%= @user.phone %></td>
123
127
  </tr>
124
128
 
129
+ <tr>
130
+ <th>Gender</th><td><%= @user.gender %></td>
131
+ <th>Date of Birth</th><td><%= @user.date_of_birth.strftime("%m/%d/%Y") if @user.date_of_birth %></td>
132
+ </tr>
133
+
125
134
  <tr>
126
135
  <th>Designation</th><td><%= @user.designation %></td>
127
- <th>Status</th><td><%= @user.status.titleize %></td>
136
+ <th>Status</th><td>
137
+ <% if @user.pending? %>
138
+ <span class="label label-default">Pending</span>
139
+ <% elsif @user.approved? %>
140
+ <span class="label label-success">Approved</span>
141
+ <% elsif @user.suspended? %>
142
+ <span class="label label-danger">Suspended</span>
143
+ <% end %>
144
+ </td>
128
145
  </tr>
146
+
147
+ <% if @current_user.super_admin? %>
148
+ <tr>
149
+ <th>Dummy?</th><td><%= @user.dummy.to_s.titleize %></td>
150
+ <th>Super Admin</th><td><%= @user.super_admin?.to_s.titleize %></td>
151
+ </tr>
152
+ <% end %>
129
153
 
130
154
  </tbody>
131
155
  </table>
132
156
  </div>
157
+
133
158
  </div>
134
159
 
135
- <div class="tab-pane active" id="registration_info">
160
+ <div class="tab-pane" id="registration_info" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;">
136
161
 
137
162
  <%= clear_tag(20) %>
138
163
 
164
+ <% if @registration %>
165
+
139
166
  <div class="table-responsive mt-30">
140
167
  <table class="table table-striped table-condensed table-bordered">
141
168
  <tbody>
142
169
 
143
170
  <tr>
144
- <th>Country</th><td><%= @registration.try(:country).try(:display_name) %></td>
145
- <th>City</th><td><%= @registration.try(:city).try(:display_name) %></td>
171
+ <th>ID</th><td><%= @registration.id %></td>
172
+ <th>User / Profile ID</th><td><%= @registration.user_id %></td>
146
173
  </tr>
147
174
 
148
175
  <tr>
149
- <th>Dialing Prefix</th><td><%= @registration.try(:dialing_prefix) %></td>
150
- <th>Mobile Number</th><td><%= @registration.try(:mobile_number) %></td>
176
+ <th>Status</th><td>
177
+ <% if @registration.pending? %>
178
+ <span class="label label-default">Pending</span>
179
+ <% elsif @registration.verified? %>
180
+ <span class="label label-success">Verified</span>
181
+ <% elsif @registration.suspended? %>
182
+ <span class="label label-danger">Suspended</span>
183
+ <% end %>
184
+ </td>
185
+ <th></th><td></td>
151
186
  </tr>
152
187
 
153
188
  <tr>
154
- <th>Status</th><td><%= @registration.try(:status).try(:titleize) %></td>
155
- <th></th><td></td>
189
+ <th>Country</th><td><%= @registration.country.try(:display_name) %></td>
190
+ <th>City</th><td><%= @registration.city.try(:display_name) %></td>
191
+ </tr>
192
+
193
+ <tr>
194
+ <th>Dialing Prefix</th><td><%= @registration.dialing_prefix %></td>
195
+ <th>Mobile Number</th><td><%= @registration.mobile_number %></td>
196
+ </tr>
197
+
198
+ <tr>
199
+ <th>Created At</th><td><%= @registration.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @registration.created_at %></td>
200
+ <th>Updated At</th><td><%= @registration.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @registration.updated_at %></td>
156
201
  </tr>
157
202
 
158
203
  </tbody>
159
204
  </table>
160
205
  </div>
206
+
207
+ <% end %>
208
+
161
209
  </div>
162
210
 
163
211
  <% if @current_user.super_admin? %>
164
- <div class="tab-pane" id="technical_details">
212
+ <div class="tab-pane" id="technical_details" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;">
165
213
 
166
214
  <%= clear_tag(20) %>
167
215
 
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.9'
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.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-29 00:00:00.000000000 Z
11
+ date: 2017-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,7 +107,7 @@ dependencies:
107
107
  version: '0.1'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.14
110
+ version: 0.1.15
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0.1'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 0.1.14
120
+ version: 0.1.15
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: pattana
123
123
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: '0.1'
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 0.1.11
130
+ version: 0.1.12
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '0.1'
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 0.1.11
140
+ version: 0.1.12
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: bcrypt
143
143
  requirement: !ruby/object:Gem::Requirement