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

add checked option to radio button #1833

Merged
merged 2 commits into from
Aug 9, 2022
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
27 changes: 27 additions & 0 deletions app/views/hyrax/dashboard/collections/_form_discovery.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<%# OVERRIDE HYRAX 3.4.1 to indicate what the current collection visibility is %>
<div class="set-access-controls">
<p><%= t('.para1') %></p>
<p><%= t('.para2') %></p>

<div class="form-group">
<label class="radio">
<%# OVERRIDE BEGIN: added check if true %>
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC, checked: @collection&.open_access? %>
<%# OVERRIDE END %>
<strong><%= t('hyrax.visibility.open.text') %></strong> - <%= t('hyrax.visibility.open.note_html') %>
</label>
<label class="radio">
<%# OVERRIDE BEGIN: added check if true %>
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED, checked: @collection&.authenticated_only_access? %>
<%# OVERRIDE END %>
<strong><%= t('hyrax.visibility.authenticated.text', institution: institution_name) %></strong> - <%= t('hyrax.visibility.authenticated.note_html', institution: institution_name) %>
</label>
<label class="radio">
<%# OVERRIDE BEGIN: added check if true %>
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE, checked: @collection&.private_access? %>
<%# OVERRIDE END %>
<strong><%= t('hyrax.visibility.restricted.text') %></strong>- <%= t('hyrax.visibility.restricted.note_html') %>
</label>
</div>

</div>