rows_controller 3.1.0 → 3.1.1

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: 840152ce4423af0a90562cc0594b9a5f05d8b39767f42dad0cfa9944da884868
4
- data.tar.gz: 65146a898776b18679c0523451a8d1e0bad90f7217d8ec812323d2f314fbe8ca
3
+ metadata.gz: 608e308317430650c974be5dcc19c0d63bf4dce16c4a85844d568caf2c4fcc63
4
+ data.tar.gz: 0dbbd3d8229975a7b0c3e37dec220bd983c7c0476d15de3687f708907930df30
5
5
  SHA512:
6
- metadata.gz: f89d5202e843191e42e619dca4541eb45b8cbda77cb14a3e554df4d58e7c399c96abcf4ad68df0fd714d97ba5829a463fbc9bd1518353c5f069ac1dcbcc05053
7
- data.tar.gz: 856c0c3afa6f6dc00285e08ebac7eff104f9076ce974737b025134f36f90917790d36971821687701dba1dc6c2ef2ab3b40ed49386bc8cf337d70e27514bc7cb
6
+ metadata.gz: 13d43c53f9b359eaf673b4048ff4f8ce3790533402bf897dae3ae1dbb4a36d34b9abebf49e2ada94674d4cfdebc65619a7a6abe301abb041c6bced77a4e547b2
7
+ data.tar.gz: 153b05355ee37847f683f576f96566534dd07c2a358d1f35ccf9c4d2e90c1fbfdf3979d806992bb2e6471aec6bedc257060b12b99479729e6d9a3b8e6d014c64
data/MIT-LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2012-2022 Dittmar Krall - www.matiq.com
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2012-2023 Dittmar Krall (www.matiq.com)
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # RowsController
2
2
  [![Gem Version](https://badge.fury.io/rb/rows_controller.svg)](https://badge.fury.io/rb/rows_controller)
3
+ [![GEM Downloads](https://img.shields.io/gem/dt/rows_controller?color=168AFE&logo=ruby&logoColor=FE1616)](https://rubygems.org/gems/rows_controller)
3
4
 
4
5
  DRYs Rails controllers. Imagine replacing that @order by 'resource' in the
5
6
  controllers/views and, imho, an area for DRYing appears.
@@ -139,4 +140,9 @@ Look for:
139
140
  - inherited_resources
140
141
  - decent_exposure
141
142
 
142
- Copyright (c) 2009-2022 [Dittmar Krall], released under the MIT license.
143
+ ## Miscellaneous
144
+
145
+ Copyright (c) 2009-2023 Dittmar Krall (www.matiq.com),
146
+ released under the MIT license:
147
+
148
+ * https://opensource.org/licenses/MIT
@@ -9,11 +9,13 @@ table.rows-list
9
9
  thead
10
10
  tr
11
11
  = render 'list_header', columns: columns
12
+ /= render 'list_header', columns:
12
13
 
13
14
  tbody
14
15
  - resources.each do |resource|
15
16
  - cnt += 1
16
17
  tr id=dom_id(resource) class="#{odd_even.at(cnt % 2)}"
17
18
  = render 'list_row', resource: resource, columns: columns
19
+ /= render 'list_row', resource:, columns:
18
20
  td
19
21
  = render 'row_buttons', row: resource
@@ -2,11 +2,11 @@
2
2
 
3
3
  module Rows::Resources
4
4
  def resource
5
- @_resource
5
+ @_resource || set_resource
6
6
  end
7
7
 
8
8
  def resources
9
- @_resources
9
+ @_resources || set_resources
10
10
  end
11
11
 
12
12
  def set_resource(row = nil)
data/lib/rows/version.rb CHANGED
@@ -1,12 +1,13 @@
1
1
  module Rows
2
- VERSION = "3.1.0" # 2022-09-18
3
- # VERSION = '3.0.5' # 2021-06-24
4
- # VERSION = '3.0.3' # 2020-07-14
5
- # VERSION = '3.0.2' # 2020-04-27
6
- # VERSION = '3.0.1' # 2020-03-01
7
- # VERSION = '3.0.0' # 2019-10-03
8
- # VERSION = '2.2.3' # 2019-10-03
9
- # VERSION = '2.2.2' # 2019-05-06
10
- # VERSION = '2.2.1' # 2019-02-18
2
+ VERSION = "3.1.1" # 2023-04-20
3
+ # VERSION = "3.1.0" # 2022-09-18
4
+ # VERSION = '3.0.5' # 2021-06-24
5
+ # VERSION = '3.0.3' # 2020-07-14
6
+ # VERSION = '3.0.2' # 2020-04-27
7
+ # VERSION = '3.0.1' # 2020-03-01
8
+ # VERSION = '3.0.0' # 2019-10-03
9
+ # VERSION = '2.2.3' # 2019-10-03
10
+ # VERSION = '2.2.2' # 2019-05-06
11
+ # VERSION = '2.2.1' # 2019-02-18
11
12
  # VERSION = '2.2.0'
12
13
  end
@@ -1,5 +1,5 @@
1
1
  module Rows
2
- VERSION = "3.1.0" # 2022-09-18
2
+ VERSION = "3.1.0" # 2022-09-18
3
3
  # VERSION = '3.0.5' # 2021-06-24
4
4
  # VERSION = '3.0.3' # 2020-07-14
5
5
  # VERSION = '3.0.2' # 2020-04-27
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rows_controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-29 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,33 +104,24 @@ files:
104
104
  - MIT-LICENSE
105
105
  - README.md
106
106
  - app/controllers/rows_controller.rb
107
- - app/controllers/rows_ext_controller.rb.bak
108
107
  - app/views/rows/_form.slim
109
108
  - app/views/rows/_list.slim
110
109
  - app/views/rows/_list_footer.slim
111
- - app/views/rows/_list_footer.slim.bak
112
110
  - app/views/rows/_list_header.slim
113
111
  - app/views/rows/_list_row.slim
114
112
  - app/views/rows/_row_buttons.slim
115
113
  - app/views/rows/_submit.slim
116
- - app/views/rows/_submit.slim.bak
117
114
  - app/views/rows/_submit_part.slim
118
115
  - app/views/rows/destroy.turbo_stream.erb
119
116
  - app/views/rows/edit.slim
120
- - app/views/rows/edit.slim.bak
121
117
  - app/views/rows/index.slim
122
- - app/views/rows/index.slim.bak
123
118
  - app/views/rows/new.slim
124
- - app/views/rows/new.slim.bak
125
119
  - app/views/rows/show.slim
126
- - app/views/rows/show.slim.bak
127
120
  - app/views/shared/_error_explanation.slim
128
121
  - app/views/shared/_show_flash.slim
129
122
  - lib/rows/engine.rb
130
123
  - lib/rows/locales/de.yml
131
- - lib/rows/locales/de.yml.bak
132
124
  - lib/rows/locales/en.yml
133
- - lib/rows/locales/en.yml.bak
134
125
  - lib/rows/model.rb
135
126
  - lib/rows/resources.rb
136
127
  - lib/rows/utils.rb
@@ -157,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
148
  - !ruby/object:Gem::Version
158
149
  version: '0'
159
150
  requirements: []
160
- rubygems_version: 3.3.7
151
+ rubygems_version: 3.4.10
161
152
  signing_key:
162
153
  specification_version: 4
163
154
  summary: RowsController DRYs your controllers.
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Extensions
4
- class RowsExtController < RowsController
5
- def copy
6
- set_resource
7
- @_resource = resource.dup
8
- resource.id = nil
9
- respond_to do |format|
10
- format.html { render action: :new }
11
- end
12
- end
13
-
14
- def multi_deletion
15
- items = params[:multi_tick] || []
16
- items -= [""]
17
- items.map { |id| model_class.find_by_id(id.to_i).destroy }
18
- redirect_to action: :index
19
- end
20
- end
@@ -1,5 +0,0 @@
1
- / Default list footer presenting a 'Create' button linked to action new.
2
- / May be overwriten for e.g. pagination
3
-
4
- .list-footer
5
- = link_to t('button.create').html_safe, url_for(action: :new), class: 'button'
@@ -1,20 +0,0 @@
1
- ruby:
2
- # submit links and/or buttons
3
- # Requires
4
- # content_for(:submit_<left|right>)
5
- # left|right (links names)
6
-
7
- # left|right must be used inside a form.
8
- # The clean content_for variant may be used unbounded.
9
-
10
- left ||= nil
11
- right ||= nil
12
-
13
- /.rows-submit style="width:100%" data= { turbo: 'false' }
14
- .rows-submit style="width:100%"
15
- input style="display:none" type="submit" name="commit" value="OK"
16
- p style="float:left"
17
- = render '/rows/submit_part', content: :submit_left, names: left
18
- p style="float:right"
19
- = render '/rows/submit_part', content: :submit_right, names: right
20
- div style="clear:both"
@@ -1,18 +0,0 @@
1
- ruby:
2
- # Template for RowsController (edit)
3
- # Requires resource model_name model_symbol
4
- # partial 'form' template
5
-
6
- content_for(:submit_left) do
7
- link_to t('button.back').html_safe, "/#{controller_name}", class: 'button'
8
- end
9
-
10
- fieldset class="wide mask" id=model_symbol
11
- legend = t('ui.editing', model: model_name).html_safe
12
- = render '/shared/error_explanation'
13
-
14
- /"/#{controller_name}/update/#{@row.id}"
15
- = form_with resource,
16
- url: "/#{controller_name}/#{@row.id}" do |f|
17
- = render 'form', f: f
18
- = render '/rows/submit', right: %w[update OK]
@@ -1,11 +0,0 @@
1
- / Template for RowsController (index)
2
- / Requires resources model_name resource_columns
3
-
4
- - if resources.length.positive?
5
- h1 = model_symbol_plural.capitalize
6
- /= render '/rows/list', resources: resources, columns: resource_columns
7
- = render '/rows/list', resources:, columns: resource_columns
8
- - else
9
- h1 = t('ui.empty_list', model: model_name).html_safe
10
-
11
- = render 'list_footer'
@@ -1,16 +0,0 @@
1
- ruby:
2
- # Template for RowsController (new)
3
- # Requires resource model_name model_symbol
4
- # partial 'form' template
5
-
6
- content_for(:submit_left) do
7
- link_to t('button.back').html_safe, "/#{controller_name}", class: 'button'
8
- end
9
-
10
- fieldset.wide class="mask" id=model_symbol
11
- legend = t('ui.new', model: model_name).html_safe
12
- = render '/shared/error_explanation'
13
-
14
- = form_with resource do |f|
15
- = render 'form', f: f
16
- = render '/rows/submit', right: %w[create OK]
@@ -1,19 +0,0 @@
1
- ruby:
2
- # Template for RowsController (show)
3
- # Requires resource model_name model_symbol
4
- # partial 'form' template
5
-
6
- content_for(:submit_left) do
7
- link_to t('button.back').html_safe, url_for(action: :index), class: 'button'
8
- end
9
- content_for(:submit_right) do
10
- link_to t('button.edit').html_safe, url_for(action: :edit), class: 'button'
11
- end
12
-
13
- fieldset.show class="wide mask" id=model_symbol
14
- legend = t('ui.showing', model: model_name).html_safe
15
- = render '/shared/error_explanation'
16
-
17
- = form_with model: resource do |f|
18
- = render 'form', f: f
19
- = render '/rows/submit'
@@ -1,21 +0,0 @@
1
- de:
2
-
3
- ui:
4
- created: "%{model} erstellt."
5
- destroyed: "%{model} gel&ouml;scht."
6
- editing: "Editiere %{model}"
7
- empty_list: "Liste %{model} ist leer."
8
- new: "Neue(r/s) %{model}"
9
- showing: "Zeige %{model}"
10
- updated: "%{model} ge&auml;ndert."
11
-
12
- button:
13
- back: "Zur&uuml;ck"
14
- cancel: Abbrechen
15
- clone: Klonen
16
- create: Erstelle
17
- delete: "L&ouml;sche"
18
- edit: Editieren
19
- ok: OK
20
- show: Zeige
21
- update: Speichern
@@ -1,21 +0,0 @@
1
- en:
2
-
3
- ui:
4
- created: "%{model} created."
5
- destroyed: "%{model} deleted."
6
- editing: "Editing %{model}"
7
- empty_list: "List %{model} is empty"
8
- new: "New %{model}"
9
- showing: "Showing %{model}"
10
- updated: "%{model} updated."
11
-
12
- button:
13
- back: Back
14
- cancel: Cancel
15
- clone: Clone
16
- create: Create
17
- delete: Delete
18
- edit: Edit
19
- ok: OK
20
- show: Show
21
- update: Update