tramway-admin 1.26 → 1.26.1

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: 3bd2a0e29a7da7e51b34b7040faf3554d31c8e3d62782700497283cd1edc5f81
4
- data.tar.gz: db5c2b60ddb4511153633c10b1015e54e36f8d6b4d6453d5c093972cccc97fd6
3
+ metadata.gz: 75ba7ea302dbcf40204001ef1b1c4da36d8770e03e9ddc66003599675a3dfc60
4
+ data.tar.gz: 90dcc8b1b71bc8736f355fb460f66262ce3068bbf7781470215901c28902a18e
5
5
  SHA512:
6
- metadata.gz: 07d5ac7855e789ebfc6b119d8e0326762b3ca4f24785fa16890fb75ac6f03abade1cf0db10ea91c8fb4e84a9f3adab8d67707369d093194385cf9a32487daf87
7
- data.tar.gz: 0c9f8a55011a621d84d13cf720dcb66df5953dec647db2bb4cd1bbf5b1f6cd6b50f5ec3c81fefb5a739593363fe6d23498066b781219d06cf8613640c656557a
6
+ metadata.gz: fdcb05da2908890b5febaaedc3fc5766126a3713d323d88f664eccb950b539af3850af9437aa77933a80993a2b1d65ff03d463388f9499cfea0956b8545f8c74
7
+ data.tar.gz: 9f436e8682481b4ecfd29ce785317fb2b192d939881b04708578db204ccc701e14ed2ad70a25c6cbb0d28319da325eb2d6597ac40c9d76db58c265fed55890dd
data/README.md CHANGED
@@ -148,6 +148,40 @@ Example:
148
148
  end
149
149
  ```
150
150
 
151
+ ## Navbar management
152
+
153
+ ### Navbar structure
154
+
155
+ You can manage your navbar easy
156
+
157
+ *config/initializers/tramway.rb*
158
+ ```ruby
159
+ Tramway::Admin.navbar_structure(
160
+ YourModel, # this line will create first-level link in your navbar, which will send you to the YourModel management
161
+ {
162
+ my_dropdown: [ # this line contains dropdown link name
163
+ AnotherYourModel # this line will create 2nd-level link in your navbar, which will send you to the YourModel management,
164
+ :divider # this line adds bootstrap divider to the dropdown list
165
+ ]
166
+ }
167
+ )
168
+ ```
169
+
170
+ **NOTE:** navbar structure is the same for all roles, but users will see only available models for them
171
+
172
+ ### Dropdown localization
173
+
174
+ To set human-read name for dropdown link you can use i18n:
175
+
176
+ *config/locales/admin.yml*
177
+
178
+ ```yaml
179
+ en:
180
+ admin:
181
+ navbar:
182
+ links:
183
+ my_dropdown: Very important dropdown
184
+ ```
151
185
 
152
186
  ## Contributing
153
187
  Contribution directions go here.
@@ -18,5 +18,5 @@
18
18
  = 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 }
19
19
  %td
20
20
  - if ::Tramway::Admin.action_is_available?(association_object, project: (@application_engine || @application.name), model: association_object.model.class, role: current_user.role, action: :destroy)
21
- = delete_button url: record_path(association_object.id, model: association.options[:class_name], redirect: current_model_record_path(object.id)), button_options: { class: 'btn btn-xs btn-danger' } do
21
+ = delete_button url: record_path(association_object.id, model: association.options[:class_name], redirect: current_model_record_path(object.id)), button_options: { class: 'btn btn-xs btn-danger delete' } do
22
22
  = fa_icon 'trash-alt'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Admin
5
- VERSION = '1.26'
5
+ VERSION = '1.26.1'
6
6
  end
7
7
  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.26'
4
+ version: 1.26.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: 2020-02-27 00:00:00.000000000 Z
11
+ date: 2020-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views