tramway-admin 2.1.0.1 → 2.1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/tramway/admin/additional_buttons_builder.rb +2 -1
- data/app/views/tramway/admin/shared/show/associations/_row.html.haml +19 -16
- data/app/views/tramway/admin/shared/show/associations/_table_row.html.haml +3 -3
- data/lib/tramway/admin/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 546beae8f4da6b321d696e39c446439ba17a2ed03de194baf6f2b66aeb603e7d
|
4
|
+
data.tar.gz: bcfc6a18161c2138d83b029ffd057caced1559b6128b85f67989dfcc1c1eb05c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2b90fa18036b7608b6f931406c17f26f774fc2ee8b675c79c888faeab3cc74091ad4d4e093118e2b265752b06085d7f6a453e0bd17e4bf2f6860621aff586b6
|
7
|
+
data.tar.gz: f4b441e84898e5608ef190ea19a4e1b56b46c189bfe9369774a4a5bb48b4dc98ad2f896057d6fd07e1f0a6d82641146c7eeda098b6872f94ee74bf4e98dd9c58
|
@@ -3,7 +3,8 @@
|
|
3
3
|
module Tramway::Admin::AdditionalButtonsBuilder
|
4
4
|
def build_button(button)
|
5
5
|
options = button[:options] || {}
|
6
|
-
|
6
|
+
style = 'margin-right: 8px'
|
7
|
+
concat(link_to(button[:url], method: button[:method], class: "btn btn-#{button[:color]} btn-xs", style: style, **options) do
|
7
8
|
button[:inner]&.call
|
8
9
|
end)
|
9
10
|
end
|
@@ -1,16 +1,19 @@
|
|
1
|
-
- if object.class.show_associations.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
=
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
- if object.class.show_associations.nil?
|
2
|
+
= "Please, fill show associations method in decorator"
|
3
|
+
- else
|
4
|
+
- if object.class.show_associations.map(&:to_s).include? association.name.to_s
|
5
|
+
- association_type = association.class.to_s.split('::').last.sub(/Reflection$/, '').underscore.to_sym
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
= model_class.human_attribute_name association.name
|
9
|
+
%hr
|
10
|
+
- if association_type != :has_one || !object.send(association.name).present?
|
11
|
+
= link_to "#{I18n.t('helpers.actions.add')} #{model_class.human_attribute_name(association.name).singularize.downcase}", new_associated_record_path(association: association, object: object, as: object.send("#{association.name}_as")), class: 'btn btn-primary'
|
12
|
+
%td{ colspan: 2 }
|
13
|
+
- if association_type.in? [ :has_one, :belongs_to ]
|
14
|
+
%table.table.table-striped.table-bordered
|
15
|
+
= render 'tramway/admin/shared/show/associations/table_row', object: object, association: association, association_object: object.send(association.name)
|
16
|
+
- else
|
17
|
+
%table.table.table-striped.table-bordered
|
18
|
+
- object.send(association.name)&.each do |association_object|
|
19
|
+
= render 'tramway/admin/shared/show/associations/table_row', object: object, association: association, association_object: association_object
|
@@ -1,4 +1,3 @@
|
|
1
|
-
- association_state_machines = object.send("#{association.name}_state_machines")
|
2
1
|
- if (!association_object.is_a?(Array) || !association_object.empty?) && association_object.present?
|
3
2
|
%tr{ id: "#{association.name}_#{association_object.id}" }
|
4
3
|
%td
|
@@ -6,8 +5,9 @@
|
|
6
5
|
%td
|
7
6
|
= link_to association_object.name, record_path(association_object.id, model: association.options[:class_name])
|
8
7
|
%td
|
9
|
-
-
|
10
|
-
|
8
|
+
- association_object.model.class.state_machines_names.each do |state_method|
|
9
|
+
- unless state_method == 'default'
|
10
|
+
= state_events_buttons association_object, state_method: state_method, model_param_name: :record, controller: 'tramway/admin/records', action: :update, parameters: { redirect: current_model_record_path(object.id), model: association_object.class.model_name }, button_options: { class: :smart_button }
|
11
11
|
%td
|
12
12
|
- if update_is_available? association_object, object
|
13
13
|
= edit_button url: edit_record_path(association_object.id, model: association.options[:class_name], redirect: current_model_record_path(object.id)), button_options: { class: 'btn btn-xs btn-warning edit' } do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tramway-core
|
@@ -310,7 +310,7 @@ files:
|
|
310
310
|
- lib/tramway/admin/tramway_model_helper.rb
|
311
311
|
- lib/tramway/admin/version.rb
|
312
312
|
- lib/tramway/admin/welcome_page_actions.rb
|
313
|
-
homepage: https://github.com/
|
313
|
+
homepage: https://github.com/purple-magic/tramway-admin
|
314
314
|
licenses:
|
315
315
|
- MIT
|
316
316
|
metadata: {}
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
331
|
requirements: []
|
332
|
-
rubygems_version: 3.1.
|
332
|
+
rubygems_version: 3.1.6
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: Engine for admin
|