chaltron 1.0.5 → 1.0.6

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: b575bca021b1310988735b0fb0d6c312722c20dc07e24e01e3a6e1dbea79c61e
4
- data.tar.gz: c98aa7a3ac17ea1feee3c35f1f248c7de3155ac83337a0ef79be66f1518c362b
3
+ metadata.gz: e6dd93d83899a5ece0bcb08dae116027904b93a08e2e23a3f43168df66da81c7
4
+ data.tar.gz: eff688766c57029580169523643e717f9d323f19149c2b99fe54a76908fb8eee
5
5
  SHA512:
6
- metadata.gz: 67329f27ca99fb540c267b25bcee7d75a91a0fe1840e9916d0dad1b3878208292aafac7ec07e4dbf4f7638c459f5a91020cbb21cb2c256ba2816f40bb4fce0ac
7
- data.tar.gz: 78c818ceb8b5d57f6b0a04dee659f9baa69b72f1ecbf4376983c68b0001eaac404b1b878ba31e9daf47f9ee2b6897c0c596bf15d5e1ed1ef50cb5940d78acc81
6
+ metadata.gz: 4bf40d6e0304969767a2fe3c98749559bc808402348b63eea1396eb26a6bcea4d680b860eeb83b2e3e14079bb767a55da5509ba86d7e1492168c55751b902bb7
7
+ data.tar.gz: 6b5d1fac7c6ac9326d3d078a61c775f9725450013de385a8dc13cf046125de1f3717db8edccc814d3f3cb50c9fff33bee648e19472902cd9c8b96b6cdaca241b
@@ -1,6 +1,6 @@
1
1
  module Authorizable
2
2
  def roles=(roles)
3
- self.roles_mask = (roles & Chaltron.roles).map { |r| 2**Chaltron.roles.index(r) }.sum
3
+ self.roles_mask = (roles & Chaltron.roles).map { |r| 2**Chaltron.roles.index(r) }.inject(:+)
4
4
  end
5
5
 
6
6
  def roles
@@ -1,29 +1,24 @@
1
1
  <div class='container-fluid'>
2
2
  <h3 class='pt-4'><%= t '.title' %></h3>
3
- <div class='row'>
4
- <div class='col-md-12'>
5
- <%= content_tag 'table', id: 'logs', class: 'table table-striped',
6
- data: {source: logs_path(format: :json)} do %>
7
- <thead>
8
- <tr>
9
- <th class='severity'>
10
- <%= Log.human_attribute_name(:severity) %>
11
- </th>
12
- <th class='timestamp'>
13
- <%= Log.human_attribute_name(:created_at) %>
14
- </th>
15
- <th class='message'>
16
- <%= Log.human_attribute_name(:message) %>
17
- </th>
18
- <th class='category'>
19
- <%= Log.human_attribute_name(:category) %>
20
- </th>
21
- </tr>
22
- </thead>
23
- <tbody>
24
- </tbody>
25
- <% end %>
26
- </div>
27
- </div>
28
-
3
+ <%= content_tag 'table', id: 'logs', class: 'table table-striped',
4
+ data: {source: logs_path(format: :json)} do %>
5
+ <thead>
6
+ <tr>
7
+ <th class='severity'>
8
+ <%= Log.human_attribute_name(:severity) %>
9
+ </th>
10
+ <th class='timestamp'>
11
+ <%= Log.human_attribute_name(:created_at) %>
12
+ </th>
13
+ <th class='message'>
14
+ <%= Log.human_attribute_name(:message) %>
15
+ </th>
16
+ <th class='category'>
17
+ <%= Log.human_attribute_name(:category) %>
18
+ </th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ </tbody>
23
+ <% end %>
29
24
  </div>
@@ -1,3 +1,3 @@
1
1
  module Chaltron
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- <%%= bootstrap_form_for(@<%= singular_table_name %>, layout: :horizontal, label_col: 'col-sm-2 col-form-label', control_col: 'col-sm-10') do |f| %>
1
+ <%%= bootstrap_form_with(model: @<%= singular_table_name %>, local: true, layout: :horizontal, label_col: 'col-sm-2 col-form-label', control_col: 'col-sm-10') do |f| %>
2
2
 
3
3
  <% attributes.each do |attribute| -%>
4
4
  <% if attribute.field_type == :check_box -%>
@@ -1,21 +1,19 @@
1
1
  <div class='container-fluid'>
2
2
  <h3 class='pt-4'><%= plural_table_name.titleize %></h3>
3
- <div class='row'>
4
- <%%= content_tag 'table', class: 'table table-striped datatable' do %>
5
- <thead>
3
+ <%%= content_tag 'table', class: 'table table-striped datatable' do %>
4
+ <thead>
5
+ <tr><% attributes.each do |attribute| %>
6
+ <th><%= attribute.name.humanize %></th><% end %>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
6
11
  <tr><% attributes.each do |attribute| %>
7
- <th><%= attribute.name.humanize %></th><% end %>
12
+ <td><%%= link_to <%= singular_table_name %>.<%= attribute.name %>, <%= singular_table_name %> %></td><% end %>
8
13
  </tr>
9
- </thead>
10
- <tbody>
11
- <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
12
- <tr><% attributes.each do |attribute| %>
13
- <td><%%= link_to <%= singular_table_name %>.<%= attribute.name %>, <%= singular_table_name %> %></td><% end %>
14
- </tr>
15
- <%% end -%>
16
- </tbody>
17
- <%% end %>
18
- </div>
14
+ <%% end -%>
15
+ </tbody>
16
+ <%% end %>
19
17
  <hr>
20
18
  <%%= link_to new_<%= singular_table_name %>_path, class: 'btn btn-primary btn-lg' do %>
21
19
  <%%= icon(:fas, :plus) %> New
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chaltron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - vicvega
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails