Skip to content

Commit

Permalink
Merge pull request #316 from IUBLibTech/AR-196_remediation
Browse files Browse the repository at this point in the history
AR-196 remediation
  • Loading branch information
randalldfloyd authored Jan 5, 2024
2 parents 2dcbf23 + dde840d commit 9d154e9
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 10 deletions.
17 changes: 9 additions & 8 deletions app/assets/javascripts/context_navigation.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ class ExpandButton {
constructor(data) {
var collapseIcon = `<img alt='collapse' src='<%= image_path('blacklight/collapse.svg') %>'>`;
var expandIcon = `<img alt='expand' src='<%= image_path('blacklight/expand.svg') %>'>`;

// Find Siblings count
var siblingCount = `&nbsp;<span class='al-count'>999</span>&nbsp;`;

this.collapseText = collapseIcon + `Hide`+ siblingCount + data.collapse;
this.expandText = expandIcon + `Show` + siblingCount + data.expand;


this.$el = $(`<button class="btn btn-link btn-sm">${this.expandText}</button>`);
this.handleClick = this.handleClick.bind(this);
this.$el.click(this.handleClick);
}

}

/**
Expand Down Expand Up @@ -187,11 +187,12 @@ class ContextNavigation {
const $span = $('<span></span>');
$span.addClass('divider');
$span.attr('text-position', 'left');
$span.attr('role', 'listitem');
$ul.append($span);

const button = new ExpandButton(this.data);
$span.append(button.$el);

return $ul;
}

Expand Down Expand Up @@ -268,15 +269,15 @@ class ContextNavigation {

prevParentList.append(renderedBeforeDocs);


} else {
renderedBeforeDocs = beforeDocs.map(newDoc => newDoc.render()).join('');
}

// Silly but works for now
this.ul.append(prevParentList || renderedBeforeDocs);


let itemDoc = newDocs.slice(newDocIndex, newDocIndex + 1);
let renderedItemDoc = itemDoc.map(doc => doc.render()).join('');

Expand Down Expand Up @@ -370,7 +371,7 @@ class ContextNavigation {
var srOnly = $('h2[data-sr-enable-me]');
toEnable.removeClass('disabled');
toEnable.text(srOnly.data('hasContents'));
srOnly.text(srOnly.data('hasContents'));
srOnly.text(srOnly.data('hasContents'));
}

showSiblingCount(){
Expand Down Expand Up @@ -409,5 +410,5 @@ Blacklight.onLoad(function () {
);
contextNavigation.getData();
});

});
11 changes: 11 additions & 0 deletions app/assets/stylesheets/iu-branding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,14 @@ li.al-collection-context .al-online-content-icon svg,
.toggle-delete:hover {
text-decoration: none;
}

// Increase contrast ratios for accessibility
.text-muted {
color: #34373a !important;
}

.facet-values {
.remove {
color: #34373a !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= link_to(
"##{document.id}-collapsible-hierarchy",
class: "al-toggle-view-children #{!show_expanded?(document) ? 'collapsed' : ''}",
'aria-label': "Toggle children",
'aria-label': "Children of #{document.level} #{document.normalized_title} #{document.number_of_children}",
data: {
toggle: 'collapse'
}
Expand Down
66 changes: 66 additions & 0 deletions app/views/catalog/_show_collection.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<% parents = Arclight::Parents.from_solr_document(document).as_parents %>
<div class='row'>
<div class='col-md-12'>
<% if document.digital_objects.present? %>
<%= content_tag :p, class: "media breadcrumb-item breadcrumb-item-#{parents.length + 3}" do %>
<span class="media-body al-online-content-icon" aria-hidden="true"><%= blacklight_icon :online %></span>
<span class="col text-muted">
<%= t('arclight.views.show.online_content_upper') %>
</span>
<%= render_document_partial(document, 'arclight_viewer') %>
<% end %>
<% end %>
<div class='row'>
<div class='col-lg-12' role='tablist' aria-owns='context-tab content-tab online-content-tab access-tab'>
<ul class='nav nav-tabs nav-fill' aria-label='<%= t('arclight.views.show.tablist_nav') %>'>
<li class='nav-item flex-fill'>
<a class='nav-link p-1 p-sm-2 active' id='context-tab' data-toggle='tab' href='#context' role='tab'>
<%= t 'arclight.views.show.overview' %>
</a>
</li>
<li class='nav-item flex-fill'>
<a class='nav-link p-1 p-sm-2 disabled' id='content-tab' data-toggle='tab' href='#contents' role='tab' data-hierarchy-enable-me='true'>
<%= t 'arclight.views.show.no_contents' %>
</a>
</li>
<% if document.online_content? %>
<li class='nav-item flex-fill'>
<a class='nav-link p-1 p-sm-2' id='online-content-tab' data-toggle='tab' href='#online-content' role='tab' data-arclight-online-content-tab='true'>
<%= t 'arclight.views.show.online_content' %>
</a>
</li>
<% end %>
<li class='nav-item flex-fill'>
<a class='nav-link p-1 p-sm-2' id='access-tab' data-toggle='tab' href='#access' role='tab'>
<%= t 'arclight.views.show.access' %>
</a>
</li>
</ul>
</div>
</div>

<div class='tab-content'>
<div class='tab-pane active' id='context' role='tabpanel'>
<%= render 'collection_context' %>
</div>
<div class='tab-pane' id='contents' role='tabpanel'>
<%= render 'collection_contents' %>
</div>
<% if document.online_content? %>
<div class='tab-pane' id='online-content' role='tabpanel'>
<%= render partial: 'collection_online_contents', locals: { document: document } %>
</div>
<% end %>
<div class='tab-pane' id='access' role='tabpanel'>
<h2 class="sr-only"><%= t 'arclight.views.show.access' %></h2>
<% unless blacklight_config.show.context_access_tab_items.nil? %>
<% items = blacklight_config.show.context_access_tab_items.select { |i| fields_have_content?(@document, i) } %>
<% items.each_with_index do |item, index| %>
<%= render partial: 'access_contents', locals: { document: @document, field_accessor: item, card_index: index} %>
<% end %>
<% end %>
</div>
</div>
</div>

</div>
2 changes: 1 addition & 1 deletion app/views/viewers/_universal_viewer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<iframe
src="<%= viewer.uv_host %>/uv/uv.html#?manifest=<%= viewer.manifest_url %>&config=<%= viewer.uv_config_host %>/uv/uv_config.json&m=0&cv=0"
width="1024" height="640" allowfullscreen frameborder="0">
title="Digital content viewer" width="1024" height="640" allowfullscreen frameborder="0">
</iframe>

</div>
Expand Down

0 comments on commit 9d154e9

Please sign in to comment.