bullet_train-super_scaffolding 1.0.29 → 1.0.32

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
  SHA256:
3
- metadata.gz: 05b68451045068aa2ec97bb4198826333c702d2af995005b9cf0090e58254ed4
4
- data.tar.gz: 1ea761bfa6ec36306bedae27ecbb51176fb03ff35581b0c5f66dbcf722f4f69e
3
+ metadata.gz: f51f2db556dd32be5a81cd6fcf0fc54cca58cd662e61da38289a95a8aecb6d64
4
+ data.tar.gz: '03957b2a34172dabb98a2ef32fdcb16d3be71eb65963546b746826915e74d4be'
5
5
  SHA512:
6
- metadata.gz: '09dbb3f20dcb25d5f1abab3d5a009686f415799b43575e31738695809a882e3a26e8aa5cdb29951b882c66bd75af3f26abddf8006b053404eb8fafe3038ff5db'
7
- data.tar.gz: f3b55698e2feb4425bf56d855b82570ec59c7ce51a867b7c447e7386a4c88245534bb54513f638b5b3fd60e2a390d374fd53c6199d0bf761ce5c91ff6186e600
6
+ metadata.gz: 8f692ccec6f4cebec181c086562d5b1c5bf59a6e2106cd12fff70df47addf7043157de95d89c5c637068826068e90349a5a5f07acac79c85b8a3ed4f1c63c2bc
7
+ data.tar.gz: ce76ef0471d6f6f7721c70bcf4645a99ecd8866ece6d48ab3809601a162579f5df90cf5042cce74b9f7ba6dc9e3c3dada590013ee9b614132035ef6fc2108479
@@ -0,0 +1,10 @@
1
+ module SuperScaffoldingHelper
2
+ unless defined?(BulletTrain::ActionModels)
3
+ def action_model_select_controller
4
+ # TODO I don't know why if I just call `yield` I get duplicate content on the page.
5
+ tag.div do
6
+ yield
7
+ end
8
+ end
9
+ end
10
+ end
@@ -7,69 +7,83 @@
7
7
  <% tangible_things = tangible_things.order(:id) unless has_order?(tangible_things) %>
8
8
  <% pagy, tangible_things = pagy(tangible_things, page_param: :tangible_things_page) %>
9
9
 
10
- <%= render 'account/shared/box', pagy: pagy do |p| %>
11
- <% p.content_for :title, t(".contexts.#{context.class.name.underscore}.header") %>
12
- <% p.content_for :description do %>
13
- <%= t(".contexts.#{context.class.name.underscore}.description#{"_empty" unless tangible_things.any?}") %>
14
- <% end %>
10
+ <%= action_model_select_controller do %>
11
+ <%= updates_for context, collection do %>
12
+ <%= render 'account/shared/box', pagy: pagy do |p| %>
13
+ <% p.content_for :title, t(".contexts.#{context.class.name.underscore}.header") %>
14
+ <% p.content_for :description do %>
15
+ <%= t(".contexts.#{context.class.name.underscore}.description#{"_empty" unless tangible_things.any?}") %>
16
+ <% end %>
15
17
 
16
- <% p.content_for :table do %>
17
- <% if tangible_things.any? %>
18
- <table class="table">
19
- <thead>
20
- <tr>
21
- <%# 🚅 skip this section when scaffolding. %>
22
- <th><%= t('.fields.text_field_value.heading') %></th>
23
- <th><%= t('.fields.boolean_button_value.heading') %></th>
24
- <th><%= t('.fields.button_value.heading') %></th>
25
- <th><%= t('.fields.multiple_button_values.heading') %></th>
26
- <%# 🚅 stop any skipping we're doing now. %>
27
- <%# 🚅 super scaffolding will insert new field headers above this line. %>
28
- <th><%= t('.fields.created_at.heading') %></th>
29
- <th class="text-right"></th>
30
- </tr>
31
- </thead>
32
- <tbody>
33
- <% tangible_things.each do |tangible_thing| %>
34
- <% with_attribute_settings object: tangible_thing do %>
35
- <tr data-id="<%= tangible_thing.id %>">
18
+ <% p.content_for :table do %>
19
+ <% if tangible_things.any? %>
20
+ <table class="table">
21
+ <thead>
22
+ <tr>
23
+ <%= render "shared/tables/select_all" %>
36
24
  <%# 🚅 skip this section when scaffolding. %>
37
- <td><%= render 'shared/attributes/text', attribute: :text_field_value, url: [:account, tangible_thing] %></td>
38
- <td><%= render 'shared/attributes/boolean', attribute: :boolean_button_value %></td>
39
- <td><%= render 'shared/attributes/option', attribute: :button_value %></td>
40
- <td><%= render 'shared/attributes/options', attribute: :multiple_button_values %></td>
25
+ <th><%= t('.fields.text_field_value.heading') %></th>
26
+ <th><%= t('.fields.boolean_button_value.heading') %></th>
27
+ <th><%= t('.fields.button_value.heading') %></th>
28
+ <th><%= t('.fields.multiple_button_values.heading') %></th>
41
29
  <%# 🚅 stop any skipping we're doing now. %>
42
- <%# 🚅 super scaffolding will insert new fields above this line. %>
43
- <td><%= render 'shared/attributes/date_and_time', attribute: :created_at %></td>
44
- <td class="buttons">
45
- <% unless hide_actions %>
46
- <% if can? :edit, tangible_thing %>
47
- <%= link_to t('.buttons.shorthand.edit'), [:edit, :account, tangible_thing], class: 'button-secondary button-smaller' %>
48
- <% end %>
49
- <% if can? :destroy, tangible_thing %>
50
- <%= button_to t('.buttons.shorthand.destroy'), [:account, tangible_thing], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(tangible_thing)) }, class: 'button-secondary button-smaller' %>
51
- <% end %>
52
- <% end %>
53
- </td>
30
+ <%# 🚅 super scaffolding will insert new field headers above this line. %>
31
+ <th><%= t('.fields.created_at.heading') %></th>
32
+ <th class="text-right"></th>
54
33
  </tr>
34
+ </thead>
35
+ <tbody>
36
+ <% tangible_things.each do |tangible_thing| %>
37
+ <% with_attribute_settings object: tangible_thing do %>
38
+ <tr data-id="<%= tangible_thing.id %>">
39
+ <%= render "shared/tables/checkbox", object: tangible_thing %>
40
+ <%# 🚅 skip this section when scaffolding. %>
41
+ <td><%= render 'shared/attributes/text', attribute: :text_field_value, url: [:account, tangible_thing] %></td>
42
+ <td><%= render 'shared/attributes/boolean', attribute: :boolean_button_value %></td>
43
+ <td><%= render 'shared/attributes/option', attribute: :button_value %></td>
44
+ <td><%= render 'shared/attributes/options', attribute: :multiple_button_values %></td>
45
+ <%# 🚅 stop any skipping we're doing now. %>
46
+ <%# 🚅 super scaffolding will insert new fields above this line. %>
47
+ <td><%= render 'shared/attributes/date_and_time', attribute: :created_at %></td>
48
+ <td class="buttons">
49
+ <% unless hide_actions %>
50
+ <% if can? :edit, tangible_thing %>
51
+ <%= link_to t('.buttons.shorthand.edit'), [:edit, :account, tangible_thing], class: 'button-secondary button-smaller' %>
52
+ <% end %>
53
+ <% if can? :destroy, tangible_thing %>
54
+ <%= button_to t('.buttons.shorthand.destroy'), [:account, tangible_thing], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(tangible_thing)) }, class: 'button-secondary button-smaller' %>
55
+ <% end %>
56
+ <%# 🚅 super scaffolding will insert new action model buttons above this line. %>
57
+ <% end %>
58
+ </td>
59
+ </tr>
60
+ <% end %>
61
+ <% end %>
62
+ </tbody>
63
+ </table>
64
+ <% end %>
65
+ <% end %>
66
+
67
+ <% p.content_for :actions do %>
68
+ <% unless hide_actions %>
69
+ <% if context == absolutely_abstract_creative_concept %>
70
+ <% if can? :create, Scaffolding::CompletelyConcrete::TangibleThing.new(absolutely_abstract_creative_concept: absolutely_abstract_creative_concept) %>
71
+ <%= link_to t('.buttons.new'), [:new, :account, absolutely_abstract_creative_concept, :completely_concrete_tangible_thing], class: "#{first_button_primary(:completely_concrete_tangible_thing)} new" %>
55
72
  <% end %>
56
73
  <% end %>
57
- </tbody>
58
- </table>
59
- <% end %>
60
- <% end %>
61
74
 
62
- <% p.content_for :actions do %>
63
- <% unless hide_actions %>
64
- <% if context == absolutely_abstract_creative_concept %>
65
- <% if can? :create, Scaffolding::CompletelyConcrete::TangibleThing.new(absolutely_abstract_creative_concept: absolutely_abstract_creative_concept) %>
66
- <%= link_to t('.buttons.new'), [:new, :account, absolutely_abstract_creative_concept, :completely_concrete_tangible_thing], class: "#{first_button_primary(:completely_concrete_tangible_thing)} new" %>
75
+ <%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
76
+ <%= render "shared/bulk_action_select" %>
77
+
78
+ <% unless hide_back %>
79
+ <%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:completely_concrete_tangible_thing)} back" %>
80
+ <% end %>
67
81
  <% end %>
68
82
  <% end %>
69
83
 
70
- <% unless hide_back %>
71
- <%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:completely_concrete_tangible_thing)} back" %>
84
+ <% p.content_for :raw_footer do %>
85
+ <%# 🚅 super scaffolding will insert new action model index views above this line. %>
72
86
  <% end %>
73
87
  <% end %>
74
88
  <% end %>
75
- <% end %>
89
+ <% end %>
@@ -1,42 +1,49 @@
1
1
  <%= render 'account/shared/page' do |p| %>
2
2
  <% p.content_for :title, t('.section') %>
3
3
  <% p.content_for :body do %>
4
- <%= render 'account/shared/box', divider: true do |p| %>
5
- <% p.content_for :title, t('.header') %>
6
- <% p.content_for :description do %>
7
- <%= t('.description') %>
8
- <%= t('.manage_description') if can? :manage, @tangible_thing %>
9
- <% end %>
4
+ <%= updates_for @tangible_thing do %>
5
+ <%= render 'account/shared/box', divider: true do |p| %>
6
+ <% p.content_for :title, t('.header') %>
7
+ <% p.content_for :description do %>
8
+ <%= t('.description') %>
9
+ <%= t('.manage_description') if can? :manage, @tangible_thing %>
10
+ <% end %>
10
11
 
11
- <% p.content_for :body do %>
12
- <% with_attribute_settings object: @tangible_thing, strategy: :label do %>
13
- <%# 🚅 skip this section when scaffolding. %>
14
- <%= render 'shared/attributes/text', attribute: :text_field_value %>
15
- <%= render 'shared/attributes/boolean', attribute: :boolean_button_value %>
16
- <%= render 'shared/attributes/option', attribute: :button_value %>
17
- <%= render 'shared/attributes/options', attribute: :multiple_button_values %>
18
- <%= render 'shared/attributes/code', attribute: :color_picker_value %>
19
- <%= render 'shared/attributes/text', attribute: :cloudinary_image_value %>
20
- <%= render 'shared/attributes/date', attribute: :date_field_value %>
21
- <%= render 'shared/attributes/date_and_time', attribute: :date_and_time_field_value %>
22
- <%= render 'shared/attributes/email', attribute: :email_field_value %>
23
- <%= render 'shared/attributes/text', attribute: :password_field_value %>
24
- <%= render 'shared/attributes/phone_number', attribute: :phone_field_value %>
25
- <%= render 'shared/attributes/option', attribute: :option_value %>
26
- <%= render 'shared/attributes/options', attribute: :multiple_option_values %>
27
- <%= render 'shared/attributes/option', attribute: :super_select_value %>
28
- <%= render 'shared/attributes/options', attribute: :multiple_super_select_values %>
29
- <%= render 'shared/attributes/block', attribute: :text_area_value %>
30
- <%= render 'shared/attributes/html', attribute: :action_text_value %>
31
- <%# 🚅 stop any skipping we're doing now. %>
32
- <%# 🚅 super scaffolding will insert new fields above this line. %>
12
+ <% p.content_for :body do %>
13
+ <% with_attribute_settings object: @tangible_thing, strategy: :label do %>
14
+ <%# 🚅 skip this section when scaffolding. %>
15
+ <%= render 'shared/attributes/text', attribute: :text_field_value %>
16
+ <%= render 'shared/attributes/boolean', attribute: :boolean_button_value %>
17
+ <%= render 'shared/attributes/option', attribute: :button_value %>
18
+ <%= render 'shared/attributes/options', attribute: :multiple_button_values %>
19
+ <%= render 'shared/attributes/code', attribute: :color_picker_value %>
20
+ <%= render 'shared/attributes/text', attribute: :cloudinary_image_value %>
21
+ <%= render 'shared/attributes/date', attribute: :date_field_value %>
22
+ <%= render 'shared/attributes/date_and_time', attribute: :date_and_time_field_value %>
23
+ <%= render 'shared/attributes/email', attribute: :email_field_value %>
24
+ <%= render 'shared/attributes/text', attribute: :password_field_value %>
25
+ <%= render 'shared/attributes/phone_number', attribute: :phone_field_value %>
26
+ <%= render 'shared/attributes/option', attribute: :option_value %>
27
+ <%= render 'shared/attributes/options', attribute: :multiple_option_values %>
28
+ <%= render 'shared/attributes/option', attribute: :super_select_value %>
29
+ <%= render 'shared/attributes/options', attribute: :multiple_super_select_values %>
30
+ <%= render 'shared/attributes/block', attribute: :text_area_value %>
31
+ <%= render 'shared/attributes/html', attribute: :action_text_value %>
32
+ <%# 🚅 stop any skipping we're doing now. %>
33
+ <%# 🚅 super scaffolding will insert new fields above this line. %>
34
+ <% end %>
33
35
  <% end %>
34
- <% end %>
35
36
 
36
- <% p.content_for :actions do %>
37
- <%= link_to t('.buttons.edit'), [:edit, :account, @tangible_thing], class: first_button_primary if can? :edit, @tangible_thing %>
38
- <%= button_to t('.buttons.destroy'), [:account, @tangible_thing], method: :delete, class: first_button_primary, data: { confirm: t('.buttons.confirmations.destroy', model_locales(@tangible_thing)) } if can? :destroy, @tangible_thing %>
39
- <%= link_to t('global.buttons.back'), [:account, @absolutely_abstract_creative_concept, :completely_concrete_tangible_things], class: first_button_primary %>
37
+ <% p.content_for :actions do %>
38
+ <%= link_to t('.buttons.edit'), [:edit, :account, @tangible_thing], class: first_button_primary if can? :edit, @tangible_thing %>
39
+ <%# 🚅 super scaffolding will insert new action model buttons above this line. %>
40
+ <%= button_to t('.buttons.destroy'), [:account, @tangible_thing], method: :delete, class: first_button_primary, data: { confirm: t('.buttons.confirmations.destroy', model_locales(@tangible_thing)) } if can? :destroy, @tangible_thing %>
41
+ <%= link_to t('global.buttons.back'), [:account, @absolutely_abstract_creative_concept, :completely_concrete_tangible_things], class: first_button_primary %>
42
+ <% end %>
43
+
44
+ <% p.content_for :raw_footer do %>
45
+ <%# 🚅 super scaffolding will insert new action model index views above this line. %>
46
+ <% end %>
40
47
  <% end %>
41
48
  <% end %>
42
49
 
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.0.29"
3
+ VERSION = "1.0.32"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.29
4
+ version: 1.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: spring
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: indefinite_article
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +89,7 @@ files:
103
89
  - app/controllers/api/v1/scaffolding/completely_concrete.rb
104
90
  - app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_endpoint.rb
105
91
  - app/controllers/concerns/scaffolding/absolutely_abstract/creative_concepts/controller_support.rb
92
+ - app/helpers/super_scaffolding_helper.rb
106
93
  - app/models/scaffolding.rb
107
94
  - app/models/scaffolding/absolutely_abstract.rb
108
95
  - app/models/scaffolding/absolutely_abstract/creative_concept.rb
@@ -147,6 +134,9 @@ files:
147
134
  - app/views/account/scaffolding/completely_concrete/tangible_things/new.html.erb
148
135
  - app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb
149
136
  - app/views/account/scaffolding/completely_concrete/tangible_things/show.json.jbuilder
137
+ - app/views/shared/_bulk_action_select.html.erb
138
+ - app/views/shared/tables/_checkbox.html.erb
139
+ - app/views/shared/tables/_select_all.html.erb
150
140
  - config/locales/en/scaffolding/absolutely_abstract/creative_concepts.en.yml
151
141
  - config/locales/en/scaffolding/absolutely_abstract/creative_concepts/collaborators.en.yml
152
142
  - config/locales/en/scaffolding/completely_concrete/tangible_things.en.yml