ants 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/ants/{admins.coffee → admin_users.coffee} +4 -4
- data/app/controllers/admin/admin_users_controller.rb +5 -0
- data/app/mailers/admin_user_mailer.rb +3 -0
- data/app/models/{admin.rb → admin_user.rb} +11 -23
- data/app/views/ants/_profile.html.erb +5 -4
- data/lib/ants/version.rb +1 -1
- metadata +5 -5
- data/app/controllers/admin/admins_controller.rb +0 -3
- data/app/mailers/admin_mailer.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8684f96b36137070f69d0d47d8dc7ffd382791cd
|
4
|
+
data.tar.gz: 9fc8852366aa9e43600d5f2b1888f43dd906679d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7266c9d93188a7fca00f2f33c1e1af59f0ea56195518abc374d54157542e40138f0553951bd6b8862ebedb0c73798cabbd64cb27a4a0f7e99f44686453b16ff6
|
7
|
+
data.tar.gz: 545cc51d36d4f67b8c578ac4742beae24887558225cf235506aba811345fede6349f0a6e2c2f648f7371b2c7e2308990acb475feada440a36023904a338a573f
|
data/Gemfile.lock
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class @
|
1
|
+
class @AntsAdminUsers
|
2
2
|
constructor: (title='Admins', apiPath='/admin') ->
|
3
3
|
config =
|
4
4
|
title: title
|
@@ -6,7 +6,7 @@ class @AntsAdmins
|
|
6
6
|
|
7
7
|
arrayStore: new RailsArrayStore({
|
8
8
|
resource: 'admin'
|
9
|
-
path: "#{ apiPath }/
|
9
|
+
path: "#{ apiPath }/admin_users"
|
10
10
|
sortBy: 'name'
|
11
11
|
searchable: true
|
12
12
|
})
|
@@ -47,7 +47,7 @@ class @AntsAdmins
|
|
47
47
|
if input.object
|
48
48
|
input.$el.removeClass 'input-required'
|
49
49
|
input.$label.html 'Change Password'
|
50
|
-
input.config.placeholder = 'Type new password
|
50
|
+
input.config.placeholder = 'Type new password & hit Save'
|
51
51
|
input._add_placeholder()
|
52
52
|
|
53
|
-
return config
|
53
|
+
return config
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class AdminUser
|
2
2
|
include Mongoid::Document
|
3
3
|
include Mongoid::Timestamps
|
4
4
|
include Mongoid::Search
|
@@ -8,7 +8,6 @@ class Admin
|
|
8
8
|
field :name
|
9
9
|
field :permissions, type: Array
|
10
10
|
|
11
|
-
|
12
11
|
# Include default devise modules. Others available are:
|
13
12
|
# :confirmable, :lockable, :timeoutable, :registerable and :omniauthable
|
14
13
|
devise :database_authenticatable,
|
@@ -36,56 +35,45 @@ class Admin
|
|
36
35
|
field :current_sign_in_ip, type: String
|
37
36
|
field :last_sign_in_ip, type: String
|
38
37
|
|
39
|
-
|
40
38
|
## Validations
|
41
39
|
validates :name, presence: true
|
42
40
|
|
43
|
-
|
44
41
|
## Search
|
45
42
|
search_in :name, :email
|
46
43
|
|
47
44
|
## Scopes
|
48
45
|
default_scope -> { asc(:name) }
|
49
46
|
|
50
|
-
|
51
47
|
## Indexes
|
52
48
|
index({ name: 1 })
|
53
49
|
index({ email: 1 }, { unique: true })
|
54
50
|
|
55
|
-
|
56
51
|
## Helpers
|
57
52
|
def devise_mailer
|
58
|
-
|
53
|
+
AdminUserMailer
|
59
54
|
end
|
60
55
|
|
61
|
-
|
62
56
|
def _list_item_title
|
63
57
|
name.empty? ? email : name
|
64
58
|
end
|
65
59
|
|
66
|
-
|
67
60
|
def _list_item_subtitle
|
68
61
|
last_sign_in_ago
|
69
62
|
end
|
70
63
|
|
71
|
-
|
72
64
|
def _list_item_thumbnail
|
73
|
-
|
65
|
+
hex = Digest::MD5.hexdigest(email)
|
66
|
+
"//www.gravatar.com/avatar/#{hex}?s=80&d=retro&r=g"
|
74
67
|
end
|
75
68
|
|
76
|
-
|
77
69
|
private
|
78
70
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
71
|
+
def last_sign_in_ago
|
72
|
+
if current_sign_in_at
|
73
|
+
time = ActionController::Base.helpers.time_ago_in_words(current_sign_in_at)
|
74
|
+
"Seen #{time} ago"
|
75
|
+
else
|
76
|
+
"Never seen"
|
85
77
|
end
|
86
|
-
|
78
|
+
end
|
87
79
|
end
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<div class="sidebar-profile" style="display:none;">
|
2
|
-
|
2
|
+
<% user = current_admin_user %>
|
3
|
+
<%= image_tag user._list_item_thumbnail %>
|
3
4
|
|
4
|
-
<% name = (
|
5
|
-
<% path = "#/settings/admins/view/#{
|
5
|
+
<% name = (user.name.presence || "").strip.split(' ').first %>
|
6
|
+
<% path = "#/settings/admins/view/#{user.id}" %>
|
6
7
|
<%= link_to name, path %>
|
7
8
|
|
8
|
-
<%= link_to "Sign out",
|
9
|
+
<%= link_to "Sign out", destroy_admin_user_session_path, method: :delete %>
|
9
10
|
</div>
|
data/lib/ants/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ants
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kravets
|
@@ -154,7 +154,7 @@ files:
|
|
154
154
|
- Rakefile
|
155
155
|
- ants.gemspec
|
156
156
|
- app/assets/javascripts/ants.coffee
|
157
|
-
- app/assets/javascripts/ants/
|
157
|
+
- app/assets/javascripts/ants/admin_users.coffee
|
158
158
|
- app/assets/javascripts/ants/menu.coffee
|
159
159
|
- app/assets/javascripts/ants/meta.coffee
|
160
160
|
- app/assets/javascripts/ants/profile.coffee
|
@@ -163,13 +163,13 @@ files:
|
|
163
163
|
- app/assets/stylesheets/ants.scss
|
164
164
|
- app/assets/stylesheets/ants/header.scss
|
165
165
|
- app/assets/stylesheets/ants/profile.scss
|
166
|
-
- app/controllers/admin/
|
166
|
+
- app/controllers/admin/admin_users_controller.rb
|
167
167
|
- app/controllers/admin/menus_controller.rb
|
168
168
|
- app/controllers/admin/redirects_controller.rb
|
169
169
|
- app/controllers/redirects_controller.rb
|
170
170
|
- app/helpers/menu_helper.rb
|
171
|
-
- app/mailers/
|
172
|
-
- app/models/
|
171
|
+
- app/mailers/admin_user_mailer.rb
|
172
|
+
- app/models/admin_user.rb
|
173
173
|
- app/models/menu.rb
|
174
174
|
- app/models/menu_link.rb
|
175
175
|
- app/models/redirect.rb
|
data/app/mailers/admin_mailer.rb
DELETED