tramway-admin 1.11.0.1 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/tramway/admin/shared/_show.html.haml +2 -13
- data/app/views/tramway/admin/shared/show/_associations.html.haml +13 -0
- data/app/views/tramway/admin/shared/show/_attribute_tr.html.haml +1 -1
- data/lib/tramway/admin/record_routes_helper.rb +8 -4
- data/lib/tramway/admin/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0b72f16b791b5f4e02438b86c0158f146f67ec8c669e76f8394cfb8d2755b6a
|
4
|
+
data.tar.gz: 1fe10f082766bc7965a9457413093244a8e93c01c2317c7c163eb877ecfabab4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6576cc72537fe1db1c5e3d174d16ef35d9e36204ee65fac8443432f714bdb8aa2c5be1553a6a7cd7cf1e8a118b47d319851a765a8fde5ca83435842dffa52bbf
|
7
|
+
data.tar.gz: 4d6c24eeb41db4922aba8800d04a04e65769d16182e8d686e804b069ec71103d0523d8360bd43e0bc280b9995c7cf4c55c243e71dd5f261ca5703a7bb65d4e16
|
@@ -20,19 +20,8 @@
|
|
20
20
|
- object.class.show_attributes.each do |attribute_name|
|
21
21
|
- value = object.send attribute_name
|
22
22
|
= render 'tramway/admin/shared/show/attribute_tr', attribute_name: attribute_name, value: value, object: object
|
23
|
+
= render 'tramway/admin/shared/show/associations', object: object
|
23
24
|
- else
|
24
25
|
- object.attributes.each do |attribute_name, value|
|
25
26
|
= render 'tramway/admin/shared/show/attribute_tr', attribute_name: attribute_name, value: value, object: object
|
26
|
-
|
27
|
-
%tr
|
28
|
-
%td
|
29
|
-
= model_class.human_attribute_name association.name
|
30
|
-
= link_to fa_icon(:plus), new_record_path(model: association.class_name, redirect: current_model_record_path(object)), class: 'btn btn-primary'
|
31
|
-
%td{ colspan: 2 }
|
32
|
-
%table.table.table-striped.table-bordered
|
33
|
-
- object.send(association.name).each do |association_object|
|
34
|
-
%tr
|
35
|
-
%td
|
36
|
-
= association_object.id
|
37
|
-
%td
|
38
|
-
= association_object.name
|
27
|
+
= render 'tramway/admin/shared/show/associations', object: object
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- object.associations(:has_many).each do |association|
|
2
|
+
%tr
|
3
|
+
%td
|
4
|
+
= model_class.human_attribute_name association.name
|
5
|
+
= link_to fa_icon(:plus), new_record_path(model: association.class_name, redirect: current_model_record_path(object)), class: 'btn btn-primary'
|
6
|
+
%td{ colspan: 2 }
|
7
|
+
%table.table.table-striped.table-bordered
|
8
|
+
- object.send(association.name).each do |association_object|
|
9
|
+
%tr
|
10
|
+
%td
|
11
|
+
= association_object.id
|
12
|
+
%td
|
13
|
+
= link_to association_object.name, record_path(association_object.id, model: 'Project')
|
@@ -4,5 +4,5 @@
|
|
4
4
|
%td
|
5
5
|
= value
|
6
6
|
%td
|
7
|
-
- if attribute_name != 'state' && object.model.class.state_machines.keys.include?(attribute_name.to_sym)
|
7
|
+
- if attribute_name.to_s != 'state' && object.model.class.state_machines.keys.include?(attribute_name.to_sym)
|
8
8
|
= state_events_buttons object, state_method: attribute_name, model_param_name: :record, route_method: :current_model_record_path
|
@@ -2,19 +2,23 @@ module Tramway
|
|
2
2
|
module Admin
|
3
3
|
module RecordRoutesHelper
|
4
4
|
def record_path(*args, **options)
|
5
|
-
|
5
|
+
options[:model] ||= params[:model]
|
6
|
+
super args, options
|
6
7
|
end
|
7
8
|
|
8
9
|
def edit_record_path(*args, **options)
|
9
|
-
|
10
|
+
options[:model] ||= params[:model]
|
11
|
+
super args, options
|
10
12
|
end
|
11
13
|
|
12
14
|
def new_record_path(*args, **options)
|
13
|
-
|
15
|
+
options[:model] ||= params[:model]
|
16
|
+
super args, options
|
14
17
|
end
|
15
18
|
|
16
19
|
def records_path(*args, **options)
|
17
|
-
|
20
|
+
options[:model] ||= params[:model]
|
21
|
+
super args, options
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
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: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03
|
11
|
+
date: 2019-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap-kaminari-views
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- app/views/tramway/admin/shared/_input.html.haml
|
235
235
|
- app/views/tramway/admin/shared/_show.html.haml
|
236
236
|
- app/views/tramway/admin/shared/errors/server_error.html.haml
|
237
|
+
- app/views/tramway/admin/shared/show/_associations.html.haml
|
237
238
|
- app/views/tramway/admin/shared/show/_attribute_tr.html.haml
|
238
239
|
- app/views/tramway/admin/singletons/_form.html.haml
|
239
240
|
- app/views/tramway/admin/singletons/edit.html.haml
|