Skip to content

Commit

Permalink
🧹 Post review adjustments
Browse files Browse the repository at this point in the history
These are adjustments made after the PR has been reviewed.
  • Loading branch information
kirkkwang committed Dec 18, 2023
1 parent 64a630a commit c94feea
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 27 deletions.
20 changes: 18 additions & 2 deletions app/views/hyrax/admin/appearances/_theme_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
</div>
</div>
<hr />
<div class="row">
<div class="col-md-6">
<% search_options = @search_themes.map { |s| [s[0], s[1], { 'data-image' => image_path("themes/search/#{s[1]}.jpg") }] } %>
<%= f.input :search_theme, label: 'Search Results Page Theme' do %>
<%= f.select :search_theme, search_options, {}, { prompt: 'Select search results page theme...', class: 'form-control' } %>
<% end %>
<h4>Search Results Theme notes:</h4>
<ul>
<li>This will select a default view for the search results page. Users can select their preferred views on the search results page that will override this selection.</li>
</ul>
</div>
<div id="search-wireframe" class="col-md-6">
<%= image_tag "themes/search/list_view.jpg", class: "img-fluid" %>
</div>
</div>
<hr />
<div class="row">
<div class="col-sm-6">
<% show_options = @show_theme_names.map { |g| [g[0], g[1], { 'data-image' => image_path("themes/#{g[1]}/#{g[1]}.jpg") }] } %>
Expand All @@ -45,7 +61,7 @@
</div>
<hr />
</div>
<div class="panel-footer">
<%= f.submit class: 'btn btn-primary pull-right' %>
<div class="card-footer text-right">
<%= f.submit class: 'btn btn-secondary' %>
</div>
<% end %>
17 changes: 8 additions & 9 deletions app/views/hyrax/contact_form/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
<% em = '' %>
<% end %>
<%= form_for @contact_form, url: hyrax.contact_form_index_path,
html: { class: '' } do |f| %>
<%= form_for @contact_form, url: hyrax.contact_form_index_path, html: { class: 'needs-validation' } do |f| %>
<%= raw negative_captcha(@captcha) %>
<%= f.text_field :contact_method, class: 'hide' %>
<%= f.text_field :contact_method, class: 'd-none' %>

<div class="form-group row">
<%= f.label :category, t('hyrax.contact_form.type_label'), class: "col-sm-2 col-form-label" %>
Expand All @@ -30,13 +29,13 @@
</div>

<div class="form-group row">
<%= f.label :name, t('hyrax.contact_form.name_label'), class: "col-sm-2 col-form-label" %>
<div class="col-sm-10"><%= f.text_field :name, value: nm, class: 'form-control', required: true %></div>
<%= negative_label_tag(@captcha, :name, t('hyrax.contact_form.name_label'), class: "col-sm-2 col-form-label") %>
<div class="col-sm-10"><%= negative_text_field_tag(@captcha, :name, value: nm, class: 'form-control', required: true) %></div>
</div>

<div class="form-group row">
<%= f.label :email, t('hyrax.contact_form.email_label'), class: "col-sm-2 col-form-label" %>
<div class="col-sm-10"><%= f.text_field :email, value: em, class: 'form-control', required: true %></div>
<%= negative_label_tag(@captcha, :email, t('hyrax.contact_form.email_label'), class: "col-sm-2 col-form-label") %>
<div class="col-sm-10"><%= negative_text_field_tag(@captcha, :email, value: em, class: 'form-control', required: true) %></div>
</div>

<div class="form-group row">
Expand All @@ -45,8 +44,8 @@
</div>

<div class="form-group row">
<%= f.label :message, t('hyrax.contact_form.message_label'), class: "col-sm-2 col-form-label" %>
<div class="col-sm-10"><%= f.text_area :message, rows: 4, class: 'form-control', required: true %></div>
<%= negative_label_tag(@captcha, :message, t('hyrax.contact_form.message_label'), class: "col-sm-2 col-form-label") %>
<div class="col-sm-10"><%= negative_text_area_tag(@captcha, :message, rows: 4, class: 'form-control', required: true) %></div>
</div>

<%= f.submit value: t('hyrax.contact_form.button_label'), class: "btn btn-primary" %>
Expand Down
35 changes: 22 additions & 13 deletions app/views/hyrax/dashboard/collections/_form_discovery.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,65 @@
<p><%= t('.para2') %></p>

<%# OVERRIDE: add conditional title %>
<div class="form-check" <% if cannot?(:manage_discovery, @collection) %>title="<%= t('permissions.collections.cannot.manage_discovery') %>"<% end %>>
<label class="form-check-label">
<div class="form-group" <% if cannot?(:manage_discovery, @collection) %>title="<%= t('permissions.collections.cannot.manage_discovery') %>"<% end %>>
<div class="custom-control custom-radio">
<input
type="radio"
id="visibility_open"
name="<%= f.object_name %>[visibility]"
value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>"
class="custom-control-input"
<% if @collection.open_access? %>
checked="true"
checked="checked"
<% end %>
<%# OVERRIDE: add conditional disable %>
<% if cannot?(:manage_discovery, @collection) %>
disabled="disabled"
<% end %>
/>
<strong><%= t('hyrax.visibility.open.text') %></strong> - <%= t('hyrax.visibility.open.note_html') %>
</label>
<label class="custom-control-label" for="visibility_open">
<strong><%= t('hyrax.visibility.open.text') %></strong> - <%= t('hyrax.visibility.open.note_html') %>
</label>
</div>

<label class="form-check-label">
<div class="custom-control custom-radio">
<input
type="radio"
id="visibility_registered"
name="<%= f.object_name %>[visibility]"
value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>"
class="custom-control-input"
<% if @collection.authenticated_only_access? %>
checked="true"
checked="checked"
<% end %>
<%# OVERRIDE: add conditional disable %>
<% if cannot?(:manage_discovery, @collection) %>
disabled="disabled"
<% end %>
/>
<strong><%= t('hyrax.visibility.authenticated.text', institution: institution_name) %></strong> - <%= t('hyrax.visibility.authenticated.note_html', institution: institution_name) %>
</label>
<label class="custom-control-label" for="visibility_registered">
<strong><%= t('hyrax.visibility.authenticated.text', institution: institution_name) %></strong> - <%= t('hyrax.visibility.authenticated.note_html', institution: institution_name) %>
</label>
</div>

<label class="form-check-label">
<div class="custom-control custom-radio">
<input
type="radio"
id="visibility_restricted"
name="<%= f.object_name %>[visibility]"
value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE %>"
class="custom-control-input"
<% if @collection.private_access? %>
checked="true"
checked="checked"
<% end %>
<%# OVERRIDE: add conditional disable %>
<% if cannot?(:manage_discovery, @collection) %>
disabled="disabled"
<% end %>
/>
<strong><%= t('hyrax.visibility.restricted.text') %></strong>- <%= t('hyrax.visibility.restricted.note_html') %>
</label>
<label class="custom-control-label" for="visibility_restricted">
<strong><%= t('hyrax.visibility.restricted.text') %></strong> - <%= t('hyrax.visibility.restricted.note_html') %>
</label>
</div>
</div>
</div>
2 changes: 0 additions & 2 deletions app/views/hyrax/my/_collection_action_menu.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@
<% end %>
</li>

<%# OVERRIDE begin %>
<% if Hyrax::CollectionType.any_nestable? %>
<%# OVERRIDE end %>
<% # The user should have deposit access to the parent we are adding, and read access to the child (the collection we are linking here). %>
<li class="dropdown-item" role="menuitem" tabindex="-1">
<%= link_to "#",
Expand Down
3 changes: 2 additions & 1 deletion app/views/single_signon/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<br />
<%= t('.sign_in_with_provider', provider: ip.name) %>
</div>
<span class='sso-button-fake btn btn-primary'>Sign In</span>
<% end %>
</div>
<% end %>
Expand All @@ -18,6 +19,6 @@
<% if @identity_providers.count == 1 %>
<script>
$('form.button_to').submit();
$('form.button_to').submit();
</script>
<% end %>

0 comments on commit c94feea

Please sign in to comment.