Merge pull request #4542 from ulferts/fix/add_member_accessibility

Fix/add member accessibility
pull/4545/head
Oliver Günther 8 years ago committed by GitHub
commit 60369a53e6
  1. 8
      app/views/members/_autocomplete_for_member.html.erb
  2. 34
      app/views/members/_member_form_impaired.html.erb

@ -27,14 +27,12 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset class="form--fieldset principals">
<legend class="form--fieldset-legend">
<%="#{l(:label_user_plural)}/#{l(:label_group_plural)}" %>
</legend>
<legend class="form--fieldset-legend"><%="#{l(:label_user_plural)}/#{l(:label_group_plural)}" %></legend>
<% if principals.empty? %>
<div class="form--field"><%= styled_label_tag(l('notice_no_principals_found'), l('notice_no_principals_found'), class: "form--label-with-check-box") %></div>
<%= l('notice_no_principals_found') %>
<% else %>
<% if principals.size > 20 %>
<div class="form--field"><%= styled_label_tag(l('notice_to_many_principals_to_display'), l('notice_to_many_principals_to_display'), class: "form--label-with-check-box")%></div>
<%= l('notice_to_many_principals_to_display') %>
<% else %>
<%= principals_check_box_tags 'member[user_ids][]', principals %>
<% end %>

@ -33,8 +33,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%= labelled_tabular_form_for(:member,
url: {controller: '/members', action: 'create', project_id: project},
method: :post,
loading: '$(\'member-add-submit\').disable();',
complete: 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable(); activateFlashError();',
loading: 'jQuery(\'#member-add-submit\').disable();',
complete: 'jQuery(\'#member-add-submit\').enable(); activateFlashError();',
html: {id: "members_add_form", class: "form -vertical"}) do |f| %>
<div class="form--section">
<div id="new-member-message"></div>
@ -51,20 +51,24 @@ See doc/COPYRIGHT.rdoc for more details.
<%= styled_label_tag :principal_search, user_id_title %>
<%= styled_text_field_tag :principal_search, nil %>
<%= observe_field(:principal_search,
frequency: 0.5,
update: :principal_results,
url: { controller: '/members', action: 'autocomplete_for_member', project_id: project },
with: 'q')
%>
frequency: 0.5,
update: :principal_results,
complete: 'if (jQuery(\'#principal_results .form--field\').length > 0 &&
jQuery(\'.roles .form--field\').length > 0) {
jQuery(\'#member-add-submit\').show();
}
else {
jQuery(\'#member-add-submit\').hide();
};',
url: { controller: '/members', action: 'autocomplete_for_member', project_id: project },
with: 'q') %>
</div>
</div>
</div>
<div class="grid-block">
<div class="grid-block medium-6">
<div class="grid-block">
<div id="principal_results">
<%= render partial: 'members/autocomplete_for_member', locals: { principals: principals, roles: roles } %>
</div>
<div class="grid-block" id="principal_results">
<%= render partial: 'members/autocomplete_for_member', locals: { principals: principals, roles: roles } %>
</div>
<div class="grid-block roles">
<fieldset class="form--fieldset">
@ -74,10 +78,10 @@ See doc/COPYRIGHT.rdoc for more details.
</div>
</div>
</div>
<% if roles.any? && (principals.any? && principals.size <= 20) %>
<%= f.button l(:button_add), id: 'member-add-submit',
class: 'button -highlight -with-icon icon-checkmark' %>
<% end %>
<%= f.button l(:button_add),
id: 'member-add-submit',
class: 'button -highlight -with-icon icon-checkmark',
style: roles.any? && (principals.any? && principals.size <= 20) ? "": "display:none" %>
<%= link_to I18n.t('button_cancel'), :back, class: 'button' %>
</div>

Loading…
Cancel
Save