Skip to content

Commit

Permalink
Merge pull request #2236 from samvera/i51-collection-sharing-bug
Browse files Browse the repository at this point in the history
🐛 [i51] Fix for collection sharing bug
  • Loading branch information
Shana Moore authored Jun 17, 2024
2 parents 0c5793b + 7fa2bc0 commit 43043e3
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions app/views/hyrax/dashboard/collections/_form_share.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%# OVERRIDE Hyrax v5.0.0rc2 Use Hyrax::Groups for groups select box %>
<% access_options = options_for_select([
[t('hyrax.dashboard.collections.form_share.access_options.manager'), t('manage')],
[t('hyrax.dashboard.collections.form_share.access_options.depositor'), t('deposit')],
[t('hyrax.dashboard.collections.form_share.access_options.viewer'), t('view')]]) %>
[t('hyrax.dashboard.collections.form_share.access_options.manager'), 'manage'],
[t('hyrax.dashboard.collections.form_share.access_options.depositor'), 'deposit'],
[t('hyrax.dashboard.collections.form_share.access_options.viewer'), 'view']]) %>

<div id="participants" class="tab-pane">
<div class="edit-sharing-tab">
Expand All @@ -28,44 +28,41 @@
Hyrax::Group.all.map { |g| [g.humanized_name, g.name] },
{ prompt: "Select a group..." },
class: 'form-control' %>
as
<%= 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 ml-2', :disabled => true %>
</div>
</div>
<% end %>
</div>

<!-- Add user form -->
<div class="form-add-sharing-wrapper" data-id="<%= @form.id %>">
<%= simple_form_for collection_permission_template_form_for(form: @form),
url: [hyrax, :dashboard, @form, :permission_template],
html: { id: 'user-participants-form' } do |f| %>
<div class="form-inline sharing-row-form add-users">
<%= simple_form_for collection_permission_template_form_for(form: @form),
url: [hyrax, :dashboard, @form, :permission_template],
html: { id: 'user-participants-form' } do |f| %>
<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| %>
<div class="form-inline add-users">
<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>
<% end %>
<%= f.submit t('helpers.submit.hyrax_permission_template_access.create'), class: 'btn btn-info edit-collection-add-sharing-button ml-2', :disabled => true %>
</div>
<% end %>
</div>
<% end %>
</div>

<p class="form-text mt-2"><em><%= t('hyrax.admin.admin_sets.form.note') %></em></p>
Expand Down

0 comments on commit 43043e3

Please sign in to comment.