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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77f716463690574774c93d0fa1480dc9163fac32
4
- data.tar.gz: 9b351de5e515a5babd2297c3ff33ed55b98166ba
3
+ metadata.gz: 8684f96b36137070f69d0d47d8dc7ffd382791cd
4
+ data.tar.gz: 9fc8852366aa9e43600d5f2b1888f43dd906679d
5
5
  SHA512:
6
- metadata.gz: bf5db781a36806f90d6b8312ad8917f2ae7a755658f2e4b76363a0003ee9b5f9e2503e9acfe841e0c5833a5565171a1629921d246f4b586f6a54117b863d5cdc
7
- data.tar.gz: 33a9d0d8ebf3c8960f37bb0fdb147f90f315b9e0ca1dddf83adc0d31db77adec327fec53411e90d397c3e6b2031849977a529125799e1b46bec63bcf7afcbad7
6
+ metadata.gz: 7266c9d93188a7fca00f2f33c1e1af59f0ea56195518abc374d54157542e40138f0553951bd6b8862ebedb0c73798cabbd64cb27a4a0f7e99f44686453b16ff6
7
+ data.tar.gz: 545cc51d36d4f67b8c578ac4742beae24887558225cf235506aba811345fede6349f0a6e2c2f648f7371b2c7e2308990acb475feada440a36023904a338a573f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ants (0.2.8)
4
+ ants (0.3.0)
5
5
  devise
6
6
  mongoid (>= 4.0)
7
7
  mongoid-slug (>= 4.0.0)
@@ -1,4 +1,4 @@
1
- class @AntsAdmins
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 }/admins"
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 here to update the current one'
50
+ input.config.placeholder = 'Type new password & hit Save'
51
51
  input._add_placeholder()
52
52
 
53
- return config
53
+ return config
@@ -0,0 +1,5 @@
1
+ module Admin
2
+ class AdminUsersController < Admin::BaseController
3
+ mongosteen
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ class AdminUserMailer < Devise::Mailer
2
+
3
+ end
@@ -1,4 +1,4 @@
1
- class Admin
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
- AdminMailer
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
- "//www.gravatar.com/avatar/#{ Digest::MD5.hexdigest(email) }?s=80&d=retro&r=g"
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
- def last_sign_in_ago
80
- if current_sign_in_at
81
- 'Seen ' + ActionController::Base.helpers.time_ago_in_words(current_sign_in_at) + ' ago'
82
- else
83
- 'Never seen'
84
- end
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
- <%= image_tag current_admin._list_item_thumbnail %>
2
+ <% user = current_admin_user %>
3
+ <%= image_tag user._list_item_thumbnail %>
3
4
 
4
- <% name = (current_admin.name.presence || "").strip.split(' ').first %>
5
- <% path = "#/settings/admins/view/#{current_admin.id}" %>
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", destroy_admin_session_path, method: :delete %>
9
+ <%= link_to "Sign out", destroy_admin_user_session_path, method: :delete %>
9
10
  </div>
data/lib/ants/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ants
2
- VERSION = "0.2.8"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.8
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/admins.coffee
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/admins_controller.rb
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/admin_mailer.rb
172
- - app/models/admin.rb
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
@@ -1,3 +0,0 @@
1
- class Admin::AdminsController < Admin::BaseController
2
- mongosteen
3
- end
@@ -1,3 +0,0 @@
1
- class AdminMailer < Devise::Mailer
2
-
3
- end