Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [i51] Fix for collection sharing bug #2236

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading