|
|
|
@ -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> |
|
|
|
@ -53,19 +53,23 @@ See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
<%= observe_field(:principal_search, |
|
|
|
|
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') |
|
|
|
|
%> |
|
|
|
|
with: 'q') %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="grid-block"> |
|
|
|
|
<div class="grid-block medium-6"> |
|
|
|
|
<div class="grid-block"> |
|
|
|
|
<div id="principal_results"> |
|
|
|
|
<div class="grid-block" id="principal_results"> |
|
|
|
|
<%= render partial: 'members/autocomplete_for_member', locals: { principals: principals, roles: roles } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="grid-block roles"> |
|
|
|
|
<fieldset class="form--fieldset"> |
|
|
|
|
<legend class="form--fieldset-legend"><%= l(:label_role_plural) %></legend> |
|
|
|
@ -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> |
|
|
|
|
|
|
|
|
|