Merge pull request #167 from okriuchykhin/ok_SCI-470

Fix issue with long tags in dropdown list [fixes SCI-470]
This commit is contained in:
okriuchykhin 2016-09-23 13:00:06 +02:00 committed by GitHub
commit 4f0fb7074b
3 changed files with 4 additions and 2 deletions

View file

@ -63,7 +63,7 @@
<%= bootstrap_form_for [@my_module, @new_mmt], remote: true, format: :json, html: { class: 'add-tag-form' } do |f| %>
<div class="col-xs-6">
<div class="well well-sm">
<%= collection_select(:my_module_tag, :tag_id, @unassigned_tags, :id, :name, {}, { class: 'selectpicker' }) %>
<%= collection_select(:my_module_tag, :tag_id, @unassigned_tags.collect{ |t| t.name = t.name.truncate(DROPDOWN_TEXT_MAX_LENGTH, omission: '...'); t }, :id, :name, {}, { class: 'selectpicker' }) %>
<%= f.button class: 'btn btn-primary' do %>
<span class="glyphicon glyphicon-plus"></span>
<span class="hidden-xs"><%= t("experiments.canvas.modal_manage_tags.create") %></span>

View file

@ -11,4 +11,4 @@
</div>
</div>
</div>
</div>
</div>

View file

@ -38,6 +38,8 @@ TABLE_JSON_MAX_SIZE = 20
FILE_MAX_SIZE = 50
# Max uploaded user avatar size in MB
AVATAR_MAX_SIZE = 0.2
# Max characters for text in dropdown list
DROPDOWN_TEXT_MAX_LENGTH = 15
SEARCH_LIMIT = 20