tramway-admin 4.0.0.1 → 4.0.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f49bf5b4e9e0ac337b90230037a618c730eb92fc0d11c2139a8452e4a44fc66
|
|
4
|
+
data.tar.gz: 1560fc7b9a504b76a78a3272f9feae6c672add55ce468255aee7593c4453f1dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27ce4b592fed1ea8a20b2c164187947313a35f044bea80cffa324647fad7191518e97b37e2b1eb6e0d2e23eae3d2afec95bddcdfbb03789ca5d93fbe1a3092f8
|
|
7
|
+
data.tar.gz: 3d44b49c30c6fea3c44db3e934613e8341cc0198e0c18280c6990965eedd91befa1bd8589a7c34f10816f4afe281830484839ecf54d5dbf144c281b519c45cd9
|
|
@@ -21,6 +21,16 @@ module Tramway::Admin::ActionsHelper
|
|
|
21
21
|
)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
def create_is_available?(association_class)
|
|
25
|
+
::Tramway::Admin.action_is_available?(
|
|
26
|
+
nil,
|
|
27
|
+
project: (@application_engine || @application.name),
|
|
28
|
+
model_name: association_class,
|
|
29
|
+
role: current_admin.role,
|
|
30
|
+
action: :create
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
24
34
|
# delete_button is in smart-buttons gem
|
|
25
35
|
|
|
26
36
|
def edit_button(url:, button_options:)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
%meta{ content: "width=device-width, initial-scale=1, maximum-scale=0.8", name: "viewport" }
|
|
5
5
|
%title
|
|
6
6
|
= yield :title
|
|
7
|
-
= stylesheet_link_tag 'tramway/admin/application', media:
|
|
7
|
+
= stylesheet_link_tag 'tramway/admin/application', media: :all
|
|
8
8
|
= javascript_include_tag 'tramway/admin/application'
|
|
9
9
|
- if File.exists?("#{Rails.root}/app/assets/javascripts/admin/application.js") || File.exists?("#{Rails.root}/app/assets/javascripts/admin/application.js.coffee")
|
|
10
10
|
= javascript_include_tag 'admin/application'
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
%td
|
|
8
8
|
= model_class.human_attribute_name association.name
|
|
9
9
|
%hr
|
|
10
|
-
- if association_type != :has_one || !object.send(association.name).present?
|
|
10
|
+
- if create_is_available?(association.name) && (association_type != :has_one || !object.send(association.name).present?)
|
|
11
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
12
|
%td{ colspan: 2 }
|
|
13
13
|
- if association_type.in? [ :has_one, :belongs_to ]
|
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: 4.0.
|
|
4
|
+
version: 4.0.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: 2022-02-
|
|
11
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tramway-core
|