Skip to content

Commit

Permalink
Merge pull request #1316 from lpichler/display_tag_name_in_tag_contro…
Browse files Browse the repository at this point in the history
…l_dialog

Fix displaying tag from DialogFieldTagControl
  • Loading branch information
martinpovolny authored May 16, 2017
2 parents ae43593 + 3aa70f1 commit 9d0d1d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/shared/dialogs/_dialog_field.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
= button_tag(_("Save"), :class => edit ? 'btn btn-primary' : 'btn btn-primary disabled')

- when 'DialogFieldTagControl'
- if edit
- if edit
= select_tag(field.name,
options_for_select(dialog_dropdown_select_values(field), wf.value(field.name)),
drop_down_options(field, url))
:javascript
dialogFieldRefresh.initializeDialogSelectPicker('#{field.name}', undefined, '#{url}', JSON.parse('#{j(auto_refresh_options.to_json)}'));

- else
- value = wf.value(field.name) || ''
- classification_ids = value.split(',')
= h(Classification.where(:id => classification_ids).collect(&:description).join(', '))
- value = wf.value(field.name) || '' # it returns in format for example Clasification::id
- _, classification_id = value.split('::')
= h(Classification.find(classification_id).description)

:javascript
dialogFieldRefresh.setVisible($('#field_#{field.id}_tr'), #{field.visible});

0 comments on commit 9d0d1d0

Please sign in to comment.