app/views/tramway/admin/shared/show/associations/_table_row.html.haml in tramway-admin-3.0.1 vs app/views/tramway/admin/shared/show/associations/_table_row.html.haml in tramway-admin-3.0.1.1
- old
+ new
@@ -2,19 +2,21 @@
%tr{ id: "#{association.name}_#{association_object.id}" }
%td
= association_object.id
%td
= link_to association_object.name, record_path(association_object.id, model: association.options[:class_name])
+ - if association_object.model.class.state_machines_names.count > 1
+ %td
+ - association_object.model.class.state_machines_names.each do |state_method|
+ - unless state_method == 'default'
+ = 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 }
%td
- - association_object.model.class.state_machines_names.each do |state_method|
- - unless state_method == 'default'
- = 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 }
- %td
- - if update_is_available? association_object, object
- = 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
- = fa_icon 'pencil-alt'
- - if destroy_is_available? association_object, object
- = 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
- = fa_icon 'trash-alt'
- - if habtm_destroy_is_available? association_object, object
- = 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
- = fa_icon 'trash-alt'
+ .row{ style: 'justify-content: space-evenly' }
+ - if update_is_available? association_object, object
+ = 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', style: 'height: max-content' } do
+ = fa_icon 'pencil-alt'
+ - if destroy_is_available? association_object, object
+ = 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
+ = fa_icon 'trash-alt'
+ - if habtm_destroy_is_available? association_object, object
+ = 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
+ = fa_icon 'trash-alt'