tramway-admin 2.1.1.1 → 2.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tramway/admin/application.js +3 -1
- data/app/controllers/tramway/admin/records_controller.rb +1 -1
- data/app/views/tramway/admin/shared/show/associations/_habtm_row.html.haml +5 -2
- data/app/views/tramway/admin/shared/show/associations/_list.html.haml +21 -0
- data/app/views/tramway/admin/shared/show/associations/_table_row.html.haml +3 -3
- data/lib/tramway/admin/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeabc39d2bc0ce9ea3504bf578a0016a46e6278cbb27cdfbe8f393bf68f482fd
|
4
|
+
data.tar.gz: 6d65c6e3b06f0b6ef86a285a7dad3bbd713eaa7cecb72d0440be493f8381eb88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 900820722317c55bcc7cafb5a64632d75af778e91a6009b7edcc6dbf8a19ba6a6c5a21bbc18af6037f71e8a839d844fec7a244b4e0964758dea0b8f47cbdff98
|
7
|
+
data.tar.gz: 36830caf1c44bba27810e610cda58030470511dd2c8c854ff0e10ce7a9fc6d5b5aa47e4cc70686e6ced584743d934abda6cae0d3956e2d1f3f8f02226f858b6f
|
@@ -1,7 +1,6 @@
|
|
1
1
|
//= require tramway/core/application
|
2
2
|
//= require jquery
|
3
3
|
//= require jquery_ujs
|
4
|
-
//= require popper
|
5
4
|
//= require bootstrap-sprockets
|
6
5
|
//= require ckeditor/init
|
7
6
|
//= require selectize
|
@@ -10,4 +9,7 @@
|
|
10
9
|
|
11
10
|
$(document).ready(function() {
|
12
11
|
let clipboard = new Clipboard('.clipboard-btn');
|
12
|
+
$(function () {
|
13
|
+
$('[data-toggle="popover"]').popover()
|
14
|
+
})
|
13
15
|
})
|
@@ -9,7 +9,7 @@ class Tramway::Admin::RecordsController < ::Tramway::Admin::ApplicationControlle
|
|
9
9
|
if params[:filter].is_a? String
|
10
10
|
params[:filter] = JSON.parse params[:filter]
|
11
11
|
end
|
12
|
-
records = records.ransack(params[:filter]).result
|
12
|
+
records = records.ransack(params[:filter]).result(distinct: true)
|
13
13
|
end
|
14
14
|
params[:list_filters]&.each do |filter, value|
|
15
15
|
case decorator_class.list_filters[filter.to_sym][:type]
|
@@ -5,7 +5,10 @@
|
|
5
5
|
%hr
|
6
6
|
- association_form = object.send("add_#{association.name}_form")
|
7
7
|
= simple_form_for association_form, url: { controller: :has_and_belongs_to_many_records, action: :create, form: association_form.class, model_class: model_class, object_id: object.id }, method: :post do |f|
|
8
|
-
|
9
|
-
|
8
|
+
- association_form.associations.each do |association_name|
|
9
|
+
- associations = association_form.model.class.reflect_on_all_associations.map(&:name)
|
10
|
+
- if associations.include? association_name
|
11
|
+
= f.association association_name, label: false
|
12
|
+
= f.button :submit, "#{I18n.t('helpers.actions.add')} #{model_class.human_attribute_name(association.name).singularize.downcase}", class: 'btn-success'
|
10
13
|
%td{ colspan: 2 }
|
11
14
|
= render 'tramway/admin/shared/show/associations/list', object: object, association: association
|
@@ -0,0 +1,21 @@
|
|
1
|
+
- association_state_machines = object.send("#{association.name}_state_machines")
|
2
|
+
%table.table.table-striped.table-bordered
|
3
|
+
- object.send(association.name)&.each do |association_object|
|
4
|
+
%tr{ id: "#{association.name}_#{association_object.id}" }
|
5
|
+
%td
|
6
|
+
= association_object.id
|
7
|
+
%td
|
8
|
+
= link_to association_object.name, record_path(association_object.id, model: association.options[:class_name])
|
9
|
+
%td
|
10
|
+
- association_state_machines.each do |state_method|
|
11
|
+
= 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 }
|
12
|
+
%td
|
13
|
+
- if update_is_available? association_object, object
|
14
|
+
= 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
|
15
|
+
= fa_icon 'pencil-alt'
|
16
|
+
- if destroy_is_available? association_object, object
|
17
|
+
= 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
|
18
|
+
= fa_icon 'trash-alt'
|
19
|
+
- if habtm_destroy_is_available? association_object, object
|
20
|
+
= delete_button url: has_and_belongs_to_many_record_path(association_object.id, model_class: object.model.class, object_id: object.id, form: "Admin::#{object.model.class.to_s.pluralize}::Remove#{association_object.model.class.to_s}Form", redirect: current_model_record_path(object.id)), button_options: { class: 'btn btn-xs btn-danger delete' } do
|
21
|
+
= fa_icon 'trash-alt'
|
@@ -1,4 +1,3 @@
|
|
1
|
-
- association_state_machines = AASM::StateMachineStore.fetch(association_object.model.class).machine_names - ['default']
|
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.3.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: 2021-08-
|
11
|
+
date: 2021-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tramway-core
|
@@ -278,6 +278,7 @@ files:
|
|
278
278
|
- app/views/tramway/admin/shared/errors/server_error.html.haml
|
279
279
|
- app/views/tramway/admin/shared/show/_attribute_tr.html.haml
|
280
280
|
- app/views/tramway/admin/shared/show/associations/_habtm_row.html.haml
|
281
|
+
- app/views/tramway/admin/shared/show/associations/_list.html.haml
|
281
282
|
- app/views/tramway/admin/shared/show/associations/_row.html.haml
|
282
283
|
- app/views/tramway/admin/shared/show/associations/_table_row.html.haml
|
283
284
|
- app/views/tramway/admin/singletons/_form.html.haml
|
@@ -329,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
330
|
- !ruby/object:Gem::Version
|
330
331
|
version: '0'
|
331
332
|
requirements: []
|
332
|
-
rubygems_version: 3.
|
333
|
+
rubygems_version: 3.1.6
|
333
334
|
signing_key:
|
334
335
|
specification_version: 4
|
335
336
|
summary: Engine for admin
|