Merge pull request #5462 from opf/feature/show_add_members_initially

allow to show add members section initially via param

[ci skip]
pull/5468/head
Oliver Günther 8 years ago committed by GitHub
commit d4bea2e013
  1. 4
      app/assets/javascripts/members_form.js
  2. 7
      app/views/members/index.html.erb

@ -48,6 +48,10 @@ jQuery(document).ready(function($) {
if (jQuery("#errorExplanation").text() != "") { if (jQuery("#errorExplanation").text() != "") {
showAddMemberForm(); showAddMemberForm();
} }
if (jQuery('#add-member-button').attr('data-trigger-initially')) {
showAddMemberForm();
}
}); });
function toggleMemberFilter() { function toggleMemberFilter() {

@ -40,7 +40,12 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<% if authorize_for(:members, :new) %> <% if authorize_for(:members, :new) %>
<li class="toolbar-item"> <li class="toolbar-item">
<button id="add-member-button" aria-label="<%= I18n.t(:button_add_member) %>" title="<%= I18n.t(:button_add_member) %>" onClick="showAddMemberForm()" class="button -alt-highlight"> <button id="add-member-button"
aria-label="<%= I18n.t(:button_add_member) %>"
title="<%= I18n.t(:button_add_member) %>"
onClick="showAddMemberForm()"
class="button -alt-highlight"
<%= params[:show_add_members] ? 'data-trigger-initially="true"' : '' %> >
<%= op_icon('button--icon icon-add') %> <%= op_icon('button--icon icon-add') %>
<span class="button--text"><%= t('activerecord.models.member') %></span> <span class="button--text"><%= t('activerecord.models.member') %></span>
</button> </button>

Loading…
Cancel
Save