-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Admin Set Participants tab layout match Collections Sharing tab …
…layout. Also update the add users and add group forms to use Bootstrap inline-forms with cleaner markup
- Loading branch information
1 parent
30b9abe
commit 69d7e0d
Showing
5 changed files
with
129 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 57 additions & 52 deletions
109
app/views/hyrax/admin/admin_sets/_form_participants.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,73 @@ | ||
<div id="participants" class="tab-pane"> | ||
<div class="panel panel-default labels"> | ||
<div class="panel panel-default labels edit-sharing-tab"> | ||
<div class="panel-body"> | ||
<h2><%= t('.add_participants') %></h2> | ||
<% access_options = options_for_select([['Manager', 'manage'], ['Depositor', 'deposit'], ['Viewer', 'view']]) %> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :admin, @form, :permission_template], | ||
html: { id: 'group-participants-form' } do |f| %> | ||
<div class="clearfix spacer"> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'group'), | ||
index: 0 do |builder| %> | ||
<div class="form-inline"> | ||
<label class="col-md-2 col-xs-4 control-label"><%= t('.add_group') %></label> | ||
<section class="section-add-sharing clearfix"> | ||
<h3><%= t('.add_participants') %></h3> | ||
<% access_options = options_for_select([['Manager', 'manage'], ['Depositor', 'deposit'], ['Viewer', 'view']]) %> | ||
<div class="sharing-row-form"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :admin, @form, :permission_template], | ||
html: { id: 'group-participants-form', class: 'form-inline' } do |f| %> | ||
<div class="col-md-10 col-xs-8 form-group"> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a group...", | ||
class: 'form-control' %> | ||
as | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'group'), | ||
index: 0 do |builder| %> | ||
<div class="form-group"> | ||
<label><%= t('.add_group') %></label> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a group...", | ||
class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<label>as</label> | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
</div> | ||
<% end %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info' %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info' %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :admin, @form, :permission_template], | ||
html: { id: 'user-participants-form' } do |f| %> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'user'), | ||
index: 0 do |builder| %> | ||
<div class="form-inline add-users"> | ||
<label class="col-md-2 col-xs-4 control-label"><%= t('.add_user') %></label> | ||
<div class="sharing-row-form"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :admin, @form, :permission_template], | ||
html: { id: 'user-participants-form', class: 'form-inline add-users' } do |f| %> | ||
<div class="col-md-10 col-xs-8 form-group"> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a user..." %> | ||
as | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'user'), | ||
index: 0 do |builder| %> | ||
<div class="form-group"> | ||
<label><%= t('.add_user') %></label> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a user..." %> | ||
</div> | ||
<div class="form-group"> | ||
<label>as</label> | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
</div> | ||
<% end %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info' %> | ||
<% end %> | ||
</div> | ||
|
||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info' %> | ||
<p class="help-block"><%= t('hyrax.admin.admin_sets.form.note') %></p> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<p class="help-block"><%= t('hyrax.admin.admin_sets.form.note') %></p> | ||
</section> | ||
|
||
<fieldset class="admin-set-participants"> | ||
<fieldset class="admin-set-participants section-collection-sharing"> | ||
<legend><%= t(".current_participants") %></legend> | ||
<%= render 'form_participant_table', access: 'managers', filter: :manage? %> | ||
<%= render 'form_participant_table', access: 'depositors', filter: :deposit? %> | ||
<%= render 'form_participant_table', access: 'viewers', filter: :view? %> | ||
</fieldset> | ||
</div> | ||
|
||
</div><!-- /.panel-body --> | ||
</div> | ||
</div> |
136 changes: 67 additions & 69 deletions
136
app/views/hyrax/dashboard/collections/_form_share.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,83 @@ | ||
<% access_options = options_for_select([['Manager', 'manage'], ['Depositor', 'deposit'], ['Viewer', 'view']]) %> | ||
|
||
<div id="participants" class="tab-pane"> | ||
<div class="panel panel-default labels edit-sharing-tab"> | ||
<div class="panel-body"> | ||
<div class="edit-sharing-tab"> | ||
<section class="section-add-sharing"> | ||
<p><%= t('.note') %></p> | ||
<h3><%= t('.add_sharing') %></h3> | ||
|
||
<section class="section-add-sharing"> | ||
<p><%= t('.note') %></p> | ||
<h3><%= t('.add_sharing') %></h3> | ||
<!-- Add group form --> | ||
<div class="form-add-sharing-wrapper" data-id="<%= @form.id %>"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :dashboard, @form, :permission_template], | ||
html: { id: 'group-participants-form' } do |f| %> | ||
|
||
<!-- Add group form --> | ||
<div class="form-add-sharing-wrapper" data-id="<%= @form.id %>"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :dashboard, @form, :permission_template], | ||
html: { id: 'group-participants-form' } do |f| %> | ||
<div class="clearfix spacer"> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'group'), | ||
index: 0 do |builder| %> | ||
<div class="form-inline add-sharing-form sharing-row-form"> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'group'), | ||
index: 0 do |builder| %> | ||
|
||
<div class="form-inline add-sharing-form"> | ||
<label class="col-md-2 col-xs-4 control-label"><%= t('.add_group') %>:</label> | ||
<div class="col-md-10 col-xs-8 form-group"> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a group...", | ||
class: 'form-control search-input' %> | ||
as | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info edit-collection-add-sharing-button', :disabled => true %> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="form-group"> | ||
<label><%= t('.add_group') %>:</label> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a group...", | ||
class: 'form-control search-input' %> | ||
</div> | ||
<div class="form-group"> | ||
<label>as</label> | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
</div> | ||
<% end %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info edit-collection-add-sharing-button', :disabled => true %> | ||
|
||
<!-- Add user form --> | ||
<div class="form-add-sharing-wrapper" data-id="<%= @form.id %>"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :dashboard, @form, :permission_template], | ||
html: { id: 'user-participants-form' } do |f| %> | ||
<div class="clearfix spacer"> | ||
</div><!-- /.form-inline --> | ||
<% end %> | ||
</div> | ||
|
||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'user'), | ||
index: 0 do |builder| %> | ||
<!-- Add user form --> | ||
<div class="form-add-sharing-wrapper" data-id="<%= @form.id %>"> | ||
<%= simple_form_for @form.permission_template, | ||
url: [hyrax, :dashboard, @form, :permission_template], | ||
html: { id: 'user-participants-form' } do |f| %> | ||
|
||
<div class="form-inline add-users"> | ||
<label class="col-md-2 col-xs-4 control-label"><%= t('.add_user') %>:</label> | ||
<div class="col-md-10 col-xs-8 form-group"> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a user..." %> | ||
as | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
<div class="form-inline sharing-row-form add-users"> | ||
<%= f.fields_for 'access_grants_attributes', | ||
f.object.access_grants.build(agent_type: 'user'), | ||
index: 0 do |builder| %> | ||
|
||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info edit-collection-add-sharing-button', :disabled => true %> | ||
</div> | ||
<div class="form-group"> | ||
<label><%= t('.add_user') %>:</label> | ||
<%= builder.hidden_field :agent_type %> | ||
<%= builder.text_field :agent_id, | ||
placeholder: "Search for a user..." %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="form-group"> | ||
<label>as</label> | ||
<%= builder.select :access, | ||
access_options, | ||
{ prompt: "Select a role..." }, | ||
class: 'form-control' %> | ||
</div> | ||
<% end %> | ||
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info edit-collection-add-sharing-button', :disabled => true %> | ||
|
||
<p class="help-block"><%= t('hyrax.admin.admin_sets.form.note') %></p> | ||
</section> | ||
</div> <!-- /.form-inline --> | ||
<% end %> | ||
</div> | ||
|
||
<section class="section-collection-sharing"> | ||
<legend><%= t(".current_shared") %></legend> | ||
<%= render 'form_share_table', access: 'managers', filter: :manage? %> | ||
<%= render 'form_share_table', access: 'depositors', filter: :deposit? %> | ||
<%= render 'form_share_table', access: 'viewers', filter: :view? %> | ||
</section> | ||
<p class="help-block"><%= t('hyrax.admin.admin_sets.form.note') %></p> | ||
</section> | ||
|
||
</div> | ||
<section class="section-collection-sharing"> | ||
<legend><%= t(".current_shared") %></legend> | ||
<%= render 'form_share_table', access: 'managers', filter: :manage? %> | ||
<%= render 'form_share_table', access: 'depositors', filter: :deposit? %> | ||
<%= render 'form_share_table', access: 'viewers', filter: :view? %> | ||
</section> | ||
</div> | ||
</div> |