wobauth 5.0.1 → 5.0.2

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
  SHA256:
3
- metadata.gz: 0d5e1f219efe48cd29c469eb5d3ed59a25b1fc67475bfae58a264b0e7c99ad1a
4
- data.tar.gz: 8bdbdcfd1a077031af6b1877467adfa058ed08ab45f9dbe21e35948a12e9d6e9
3
+ metadata.gz: 2500bebf49f08404ae7184155a6f01f82ca0aec3851932e02475fb17d58e5782
4
+ data.tar.gz: a09aa25804d3f786183378606d1335e1681e1830c0f4bff0ce0fea87b1cc8e0a
5
5
  SHA512:
6
- metadata.gz: a0c43642e78f30c47ea97a380079bc544c9bda95efa28a143a9c446bc140e42121e6e80c6e1a06675a44a2112ead2f4fa651b0c5e57a6e7f4222407e5a9e03a0
7
- data.tar.gz: fd817e4f7019a3fa07bdb8340f096fb307870ba7e8324df128b65596e5fc11b12a01683b1396d4e79fdbae6c3747da9a5c542c9b6498ecba9ddb4d608ab0680b
6
+ metadata.gz: 705ff44fd69b90cbb7410b5aaf6fb101c9ccbd9680a8250c57e595c570957f43c21fb99c7df0b57179196e1172d40628dd64d1af52a3595ad7fb4de31b5e5ab8
7
+ data.tar.gz: 1e01f8526e8615957dae51d02d1de285a4e17b498fdbf2793a98d50da0006da887175ce93893d37202a8f0fbb6581f3ea45e99492e714e16c95f83f84701ecb4
@@ -4,14 +4,14 @@
4
4
 
5
5
  # - start with given values
6
6
  auth_types = $('#authority_authorizable_type').find("option:selected").val()
7
- $('#authority_authorizable_id optgroup').find('option').addBack().hide()
8
- $("#authority_authorizable_id optgroup[label=\"#{auth_types}\"]").find('option').addBack().show()
7
+ $('#authority_authorizable_id optgroup').find('option').addBack().attr("disabled", true)
8
+ $("#authority_authorizable_id optgroup[label=\"#{auth_types}\"]").find('option').addBack().attr("disabled", false)
9
9
 
10
10
  # - redisplay on change
11
11
  $(document).on('click', '#authority_authorizable_type', ->
12
12
  type = $(this).find("option:selected").val()
13
- $('#authority_authorizable_id optgroup').find('option').addBack().hide()
14
- $("#authority_authorizable_id optgroup[label=\"#{type}\"]").find('option').addBack().show()
13
+ $('#authority_authorizable_id optgroup').find('option').addBack().attr("disabled", true)
14
+ $("#authority_authorizable_id optgroup[label=\"#{type}\"]").find('option').addBack().attr("disabled", false)
15
15
  )
16
16
 
17
17
  #
@@ -20,12 +20,12 @@ $(document).on('click', '#authority_authorizable_type', ->
20
20
 
21
21
  # - start with given values
22
22
  authfor_type = $('#authority_authorized_for_type').find("option:selected").val()
23
- $('#authority_authorized_for_id optgroup').find('option').addBack().hide()
24
- $("#authority_authorized_for_id optgroup[label=\"#{authfor_type}\"]").find('option').addBack().show()
23
+ $('#authority_authorized_for_id optgroup').find('option').addBack().attr("disabled", true)
24
+ $("#authority_authorized_for_id optgroup[label=\"#{authfor_type}\"]").find('option').addBack().attr("disabled", false)
25
25
 
26
26
  # - redisplay on change
27
27
  $(document).on('click', '#authority_authorized_for_type', ->
28
28
  type = $(this).find("option:selected").val()
29
- $('#authority_authorized_for_id optgroup').find('option').addBack().hide()
30
- $("#authority_authorized_for_id optgroup[label=\"#{type}\"]").find('option').addBack().show()
29
+ $('#authority_authorized_for_id optgroup').find('option').addBack().attr("disabled", true)
30
+ $("#authority_authorized_for_id optgroup[label=\"#{type}\"]").find('option').addBack().attr("disabled", false)
31
31
  )
@@ -1,19 +1,7 @@
1
1
  module Wobauth
2
2
  module ApplicationHelper
3
3
  include Wobapphelpers::Helpers::All
4
-
5
- def polymorphic_selector(form, poly, types, group_method = :all)
6
- msg = ""
7
- # -- object available?
8
- if form.object.send(poly).present?
9
- msg += poly_type_display(form, poly)
10
- msg += poly_id_select(form, poly, form.object.send("#{poly}_type"), :all)
11
- else
12
- msg += poly_type_select(form, poly, types)
13
- msg += poly_id_select(form, poly, types, group_method)
14
- end
15
- msg.html_safe
16
- end
4
+ include Wobapphelpers::Helpers::PolymorphicHelper
17
5
 
18
6
  def navigation_admin_links
19
7
  render partial: 'wobauth/shared/admin'
@@ -29,25 +17,5 @@ module Wobauth
29
17
  end
30
18
  end
31
19
 
32
- private
33
-
34
- def poly_type_select(f, poly, types)
35
- f.input "#{poly}_type".to_sym, collection: types,
36
- label_method: lambda {|x| t('activerecord.models.' + x.underscore)}
37
- end
38
-
39
- def poly_type_display(f, poly)
40
- f.input("#{poly}_type".to_sym, collection: Array(f.object.send("#{poly}_type")),
41
- label_method: lambda {|x| t('activerecord.models.' + x.underscore)},
42
- disabled: true) +
43
- f.hidden_field("#{poly}_type".to_sym, value: f.object.send("#{poly}_type"))
44
- end
45
-
46
- def poly_id_select(f, poly, types, group_method)
47
- collections = Array(types).map {|t| t.constantize}
48
- f.input "#{poly}_id".to_sym, collection: collections,
49
- as: :grouped_select, group_method: group_method
50
- end
51
-
52
20
  end
53
21
  end
@@ -11,12 +11,16 @@
11
11
  <%= polymorphic_selector(f,
12
12
  'authorizable',
13
13
  Wobauth.authorizable_types,
14
- Wobauth.authorizable_group_method) %>
14
+ Wobauth.authorizable_group_method,
15
+ {class: 'select2'})
16
+ %>
15
17
  <%= f.association :role %>
16
18
  <%= polymorphic_selector(f,
17
19
  'authorized_for',
18
20
  Wobauth.authorized_for_types,
19
- Wobauth.authorized_for_group_method) %>
21
+ Wobauth.authorized_for_group_method,
22
+ {class: 'select2'})
23
+ %>
20
24
 
21
25
  <%= f.input :valid_from, as: :string, class: 'datepicker'
22
26
  %>
@@ -3,33 +3,33 @@
3
3
  <h4><%= t('activerecord.models.wobauth/authority') %></h4>
4
4
  </div>
5
5
  <div class="card-body">
6
- <table class="table table-bordered table-hover autowidth">
6
+ <table class="table table-sm table-borderless">
7
7
  <tr>
8
- <th><%= t('attributes.authorizable')%>:</th>
8
+ <th class="w-25 text-right"><%= t('attributes.authorizable')%>:</th>
9
9
  <td><%= @authority.authorizable %></td>
10
10
  </tr>
11
11
  <tr>
12
- <th><%= t('attributes.authorizable_type')%>:</th>
12
+ <th class="w-25 text-right"><%= t('attributes.authorizable_type')%>:</th>
13
13
  <td><%= @authority.authorizable_type %></td>
14
14
  </tr>
15
15
  <tr>
16
- <th><%= t('attributes.role')%>:</th>
16
+ <th class="w-25 text-right"><%= t('attributes.role')%>:</th>
17
17
  <td><%= @authority.role %></td>
18
18
  </tr>
19
19
  <tr>
20
- <th><%= t('attributes.authorized_for')%>:</th>
20
+ <th class="w-25 text-right"><%= t('attributes.authorized_for')%>:</th>
21
21
  <td><%= @authority.authorized_for %></td>
22
22
  </tr>
23
23
  <tr>
24
- <th><%= t('attributes.authorized_for_type')%>:</th>
24
+ <th class="w-25 text-right"><%= t('attributes.authorized_for_type')%>:</th>
25
25
  <td><%= @authority.authorized_for_type %></td>
26
26
  </tr>
27
27
  <tr>
28
- <th><%= t('attributes.valid_from')%>:</th>
28
+ <th class="w-25 text-right"><%= t('attributes.valid_from')%>:</th>
29
29
  <td><%= @authority.valid_from %></td>
30
30
  </tr>
31
31
  <tr>
32
- <th><%= t('attributes.valid_until')%>:</th>
32
+ <th class="w-25 text-right"><%= t('attributes.valid_until')%>:</th>
33
33
  <td><%= @authority.valid_until %></td>
34
34
  </tr>
35
35
  </table>
@@ -3,17 +3,17 @@
3
3
  <h4><%= t('attributes.membership') %></h4>
4
4
  </div>
5
5
  <div class="card-body">
6
- <table class="table table-bordered table-hover autowidth">
6
+ <table class="table table-sm table-borderless ">
7
7
  <tr>
8
- <th><%= t('attributes.user')%>:</th>
8
+ <th class="w-25 text-right"><%= t('attributes.user')%>:</th>
9
9
  <td><%= @membership.user %></td>
10
10
  </tr>
11
11
  <tr>
12
- <th><%= t('attributes.group')%>:</th>
12
+ <th class="w-25 text-right"><%= t('attributes.group')%>:</th>
13
13
  <td><%= @membership.group %></td>
14
14
  </tr>
15
15
  <tr>
16
- <th><%= t('attributes.auto')%>:</th>
16
+ <th class="w-25 text-right"><%= t('attributes.auto')%>:</th>
17
17
  <td><%= @membership.auto %></td>
18
18
  </tr>
19
19
  </table>
@@ -1,4 +1,4 @@
1
1
  module Wobauth
2
- VERSION = "5.0.1".freeze
3
- RELEASEDATE = "2020-01-22".freeze
2
+ VERSION = "5.0.2".freeze
3
+ RELEASEDATE = "2020-04-05".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wobauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolfgang Barth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2020-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
33
+ version: '4.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '4.0'
40
+ version: '4.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: wobaduser
43
43
  requirement: !ruby/object:Gem::Requirement