iam 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -9
- data/README.md +1 -1
- data/app/controllers/iam_controller.rb +2 -2
- data/app/views/iam/_account.html.erb +1 -1
- data/app/views/iam/_account_group.html.erb +1 -1
- data/config/locales/iam.en.yml +3 -0
- data/config/routes.rb +1 -1
- data/lib/generators/iam/initializer_generator.rb +0 -1
- data/lib/helpers/iam_helper.rb +2 -0
- data/lib/iam/version.rb +1 -1
- data/vendor/assets/javascripts/iam.js.coffee +4 -2
- metadata +3 -2
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@ class IamController < ApplicationController
|
|
3
3
|
account = Iam::Configuration.account_class.constantize.find(params[:id])
|
4
4
|
sign_in Iam::Configuration.account_class.downcase, account
|
5
5
|
|
6
|
-
|
7
|
-
render json: { notice:
|
6
|
+
name = Iam::Configuration.account_attributes.map{ |key| account.public_send(key)}.join(' ')
|
7
|
+
render json: { notice: I18n.t('iam.success', name: name) }
|
8
8
|
end
|
9
9
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<tr href='<%= log_in_as_path(account) %>'>
|
2
|
-
<%= render partial: 'iam/account_attribute', collection: Iam::Configuration.account_attributes.map { |key| [key, account.
|
2
|
+
<%= render partial: 'iam/account_attribute', collection: Iam::Configuration.account_attributes.map { |key| [key, account.public_send(key)] } %>
|
3
3
|
</tr>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<tr>
|
4
4
|
<td class='role-name' colspan=<%= Iam::Configuration.account_attributes.count %>>
|
5
|
-
<%= role.
|
5
|
+
<%= role.public_send Iam::Configuration.role_name_attribute %>
|
6
6
|
</td>
|
7
7
|
</tr>
|
8
8
|
<%= render partial: 'iam/account', collection: accounts %>
|
data/config/routes.rb
CHANGED
data/lib/helpers/iam_helper.rb
CHANGED
data/lib/iam/version.rb
CHANGED
@@ -12,8 +12,8 @@ $ ->
|
|
12
12
|
log_in_by_link = (link) ->
|
13
13
|
$.post link, (data) ->
|
14
14
|
$menu.hide()
|
15
|
-
iamNotice data.notice
|
16
15
|
window.location.reload()
|
16
|
+
iamNotice data.notice
|
17
17
|
|
18
18
|
log_in_by_input = ->
|
19
19
|
if inputMode
|
@@ -33,7 +33,9 @@ $ ->
|
|
33
33
|
input = ''
|
34
34
|
|
35
35
|
$(document).on 'keypress', (e) ->
|
36
|
-
|
36
|
+
$selectedInput = $(document.getSelection().focusNode).find('input')
|
37
|
+
|
38
|
+
if $selectedInput.length == 0 && (e.keyCode == 96 || e.keyCode == 1105) # '`' || 'ё'
|
37
39
|
log_in_by_input()
|
38
40
|
|
39
41
|
inputMode = !inputMode
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- app/views/iam/_account_attribute.html.erb
|
125
125
|
- app/views/iam/_account_group.html.erb
|
126
126
|
- app/views/iam/_menu.html.erb
|
127
|
+
- config/locales/iam.en.yml
|
127
128
|
- config/routes.rb
|
128
129
|
- iam.gemspec
|
129
130
|
- lib/generators/iam/initializer_generator.rb
|
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
206
|
version: '0'
|
206
207
|
requirements: []
|
207
208
|
rubyforge_project: iam
|
208
|
-
rubygems_version: 1.8.
|
209
|
+
rubygems_version: 1.8.24
|
209
210
|
signing_key:
|
210
211
|
specification_version: 3
|
211
212
|
summary: Simple account switcher for Rails.
|