tkh_authentication 0.9.15 → 0.9.16

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: 9c3f18fbc02342e10fe846903729f794f2471855
4
- data.tar.gz: 19e79b95397f5be3240a7b65b0e24c9bb0e54959
3
+ metadata.gz: 11376618dade27c56c4fc52395046214280b2fce
4
+ data.tar.gz: 503a1b59ac712e0227f174f0a1f5002d864779f2
5
5
  SHA512:
6
- metadata.gz: 4a311d82ae0e3a133443e30ef403cfb1ed148f117314c4face54acd77d137d4cd5b5eda9535cf3b4d1086db09caf75e3081e48615acb241d7aad512c2b2f1a8d
7
- data.tar.gz: 9ee3de815b39f120f5bbae171ad5d02313162cd797af7141cc023f2b8529fc3b21f29b3c34bf015ccda3bfbee64e0ff6e6ea796f9fb15a48a95dc8e129a999b2
6
+ metadata.gz: 5782bda9f68d8c440994e86b317fc4b991183ee68995748a111f7d6cbc7b450a5bb6a29b4e1b54a3731b679af5a85a0b0e2b62234564e0eadcac1936b829ef2e
7
+ data.tar.gz: 8a472c49ae3aab91abb62aa91ad4e9835e6052a116ffd55fb6c249894d0d5e71bbe902f50e2086c291814bbce7d057879c2018ec5bc93382284dc66f1b08170d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.9.16
6
+
7
+ * Loosened up dependency versioning.
8
+ * Built navigation around login form.
9
+
10
+
5
11
  ## 0.9.15
6
12
 
7
13
  * Users index view links point to members controller as opposed to deprecated details controller. Upgrading the tkh_mailing_list connection
@@ -0,0 +1,15 @@
1
+ <% if administrator? %>
2
+
3
+ <% content_for :admin_context_menu do %>
4
+
5
+ <h2><%= t('admin_section') %></h2>
6
+ <ul class="list-group">
7
+ <li class="list-group-item"><%= link_to t('admin_panel'), members_path %></li>
8
+ <%= content_tag :li, link_to( "#{t('activerecord.models.comments').capitalize} <span class='badge'>#{Comment.pending.count}</span>".html_safe, pending_comments_path ), class: 'list-group-item' if Comment.pending.count > 0 %>
9
+ <% if controller.action_name == 'show' %>
10
+ <% end %>
11
+ </ul>
12
+
13
+ <% end -%>
14
+
15
+ <% end -%>
@@ -15,3 +15,7 @@
15
15
  <p><%= link_to 'go to home page', root_path, class: 'btn btn-primary' %><%= link_to 'logout', disconnect_path, class: 'btn btn-default' %></p>
16
16
 
17
17
  <% end %>
18
+
19
+ <%= render 'admin_context_menu' %>
20
+ <%# partial in tkh_menus gem or has to be added in host app %>
21
+ <%= render './shared/menus' %>
@@ -1,11 +1,11 @@
1
1
  module TkhAuthenticationActionControllerExtension
2
2
  def self.included(base)
3
- base.send(:include, InstanceMethods)
3
+ base.send(:include, InstanceMethods)
4
4
  end
5
5
 
6
6
  module InstanceMethods
7
7
  def current_user
8
- @current_user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
8
+ @current_user ||= User.find_by!(auth_token: cookies[:auth_token]) if cookies[:auth_token]
9
9
  end
10
10
 
11
11
  def authenticate
@@ -14,20 +14,20 @@ module TkhAuthenticationActionControllerExtension
14
14
  redirect_to login_url, alert: t('authentication.warning.login_needed')
15
15
  end
16
16
  end
17
-
17
+
18
18
  def authenticate_with_admin
19
19
  unless administrator?
20
20
  session[:target_page] = request.url if session[:target_page].nil?
21
21
  redirect_to safe_root_url, alert: t('authentication.warning.restricted_access')
22
22
  end
23
23
  end
24
-
24
+
25
25
  def administrator?
26
26
  current_user && current_user.admin?
27
27
  end
28
-
28
+
29
29
  private
30
-
30
+
31
31
  def safe_root_url
32
32
  defined?(root_url) ? root_url : '/'
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module TkhAuthentication
2
- VERSION = "0.9.15"
2
+ VERSION = "0.9.16"
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15
4
+ version: 0.9.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-10 00:00:00.000000000 Z
11
+ date: 2014-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bcrypt
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +96,7 @@ files:
96
96
  - app/controllers/users_controller.rb
97
97
  - app/mailers/reception_mailer.rb
98
98
  - app/models/user.rb
99
+ - app/views/reception/_admin_context_menu.html.erb
99
100
  - app/views/reception/_email_input_form.html.erb
100
101
  - app/views/reception/_enter_your_password_form.html.erb
101
102
  - app/views/reception/_enter_your_password_form.js.erb