Skip to content

Commit

Permalink
Merge pull request #5146 from ZitaNemeckova/fix_god_sort
Browse files Browse the repository at this point in the history
Unify sorting in GOD page
  • Loading branch information
mzazrivec committed Jan 14, 2019
2 parents d10a6ad + af2c922 commit d530394
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 41 deletions.
26 changes: 4 additions & 22 deletions app/views/generic_object_definition/_show_actions.html.haml
@@ -1,6 +1,6 @@
#main_div
= render :partial => "layouts/flash_msg"
- unless @record.custom_button_sets.empty?
- if @record.custom_button_sets.present?
%hr
%h3
= _('Button Groups')
Expand All @@ -13,32 +13,14 @@
= _('Hover Text')
%tbody
- @record.custom_button_sets.each do |obj|
%tr{:title => 'hi'}
%tr
%td.table-view-pf-select
%i{:class => obj.set_data[:button_icon], :style => obj.set_data.key?(:button_color) ? "color: #{obj.set_data[:button_color]};" : nil}
%td
= obj[:name]
%td
= obj[:description]
- unless @record.custom_buttons.empty?
%hr
%h3
= _('Buttons')
%table.table.table-bordered.table-hover.table-striped
%thead
%th.table-view-pf-select
%th
= _('Text')
%th
= _('Hover Text')
%tbody
- @record.custom_buttons.each do |obj|
%tr{:title => 'hi'}
%td.table-view-pf-select
%i{:class => obj.options[:button_icon], :style => obj.options.key?(:button_color) ? "color: #{obj.options[:button_color]};" : nil}
%td
= obj[:name]
%td
= obj[:description]
- if @record.custom_buttons.present?
= render :partial => 'table_button' , :locals => {:buttons => @record.custom_buttons.sort_by{ |button| button.name.downcase }}
:javascript
$('#searchbox').hide();
Expand Up @@ -31,25 +31,7 @@
%hr
= render :partial => 'layouts/info_msg', :locals => {:message => _("No Buttons found.")}
- else
%hr
%h3
= _('Buttons')
%table.table.table-bordered.table-hover.table-striped
%thead
%th.table-view-pf-select
%th
= _('Text')
%th
= _('Hover Text')
%tbody
- @record.custom_buttons.each do |obj|
%tr{:title => 'hi'}
%td.table-view-pf-select
%i{:class => obj.options[:button_icon], :style => obj.options.key?(:button_color) ? "color: #{obj.options[:button_color]};" : nil}
%td
= obj[:name]
%td
= obj[:description]
= render :partial => 'table_button', :locals => {:buttons => @record.set_data[:button_order].map{ |id| CustomButton.find_by(:id => id) }}

%generic-object-definition-toolbar#generic_object_definition_show_form{'record-id' => @record.id,
'entity' => _('Custom Button Group'),
Expand Down
19 changes: 19 additions & 0 deletions app/views/generic_object_definition/_table_button.html.haml
@@ -0,0 +1,19 @@
%hr
%h3
= _('Buttons')
%table.table.table-bordered.table-hover.table-striped
%thead
%th.table-view-pf-select
%th
= _('Text')
%th
= _('Hover Text')
%tbody
- buttons.each do |obj|
%tr
%td.table-view-pf-select
%i{:class => obj.options[:button_icon], :style => obj.options.key?(:button_color) ? "color: #{obj.options[:button_color]};" : nil}
%td
= obj[:name]
%td
= obj[:description]

0 comments on commit d530394

Please sign in to comment.