Skip to content

Commit

Permalink
Ongoing review of files that were different in 3 or more repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Apr 10, 2024
1 parent 72372d7 commit 6f29c63
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 116 deletions.
9 changes: 9 additions & 0 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

# Generated by hyrax:models
class Collection < ActiveFedora::Base

property :bulkrax_identifier, predicate: ::RDF::URI("https://hykucommons.org/terms/bulkrax_identifier"), multiple: false do |index|
index.as :stored_searchable, :facetable
end

property :collection_subtitle, predicate: ::RDF::URI('https://hykucommons.org/terms/collection_subtitle') do |index|
index.as :stored_searchable, :facetable
end

include ::Hyrax::CollectionBehavior
# You can replace these metadata if they're not suitable
include Hyrax::BasicMetadata
Expand Down
8 changes: 8 additions & 0 deletions app/models/file_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,13 @@

# Generated by hyrax:models:install
class FileSet < ActiveFedora::Base
property :is_derived,
predicate: ::RDF::URI.intern('https://hykucommons.org/terms/isDerived'),
multiple: false do |index|
index.as :stored_searchable
end
property :bulkrax_identifier, predicate: ::RDF::URI("https://hykucommons.org/terms/bulkrax_identifier"), multiple: false do |index|
index.as :stored_searchable, :facetable
end
include ::Hyrax::FileSetBehavior
end
1 change: 1 addition & 0 deletions app/views/_head_tag_extras.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<%= render_gtm_head(request.original_url) %>

<!-- generics -->
<link rel="icon" href="<%= Site&.favicon&.url(:v32) %>" sizes="32x32">
<link rel="icon" href="<%= Site&.favicon&.url(:v57) %>" sizes="57x57">
Expand Down
20 changes: 11 additions & 9 deletions app/views/_logo.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<% if logo_image %>
<a id="logo" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<i class="fa fa-globe" role="img" aria-label="<%= application_name %>" aria-hidden="true"></i>
<%= image_tag logo_image, alt: block_for(name: 'logo_image_text') %>
</a>
<% else %>
<a id="logo" class="navbar-brand" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<span class="institution_name"><%= application_name %></span>
</a>
<% unless controller.controller_name == 'splash' %>
<% if logo_image %>
<a id="logo" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<span class="glyphicon glyphicon-globe" role="img" aria-label="<%= application_name %>" aria-hidden="true"></span>
<%= image_tag logo_image, alt_text: block_for(name: 'logo_image_text') %>
</a>
<% else %>
<a id="logo" class="navbar-brand" href="<%= hyrax.root_path %>" data-no-turbolink="true">
<span class="institution_name"><%= application_name %></span>
</a>
<% end %>
<% end %>
160 changes: 80 additions & 80 deletions app/views/hyrax/admin/stats/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,94 @@
<h1><span class="fa fa-edit"></span> Statistics for <%= application_name %></h1>
<% end %>

<div class="card tabs">
<!-- Nav tabs -->
<ul id="statistics-tabs" class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#collections" role="tab" data-toggle="tab">Collections</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#works" role="tab" data-toggle="tab">Works</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#downloads" role="tab" data-toggle="tab">Downloads</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#users" role="tab" data-toggle="tab">Users</a>
</li>
</ul>
<div class="card tabs">
<!-- Nav tabs -->
<ul id="statistics-tabs" class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#collections" role="tab" data-toggle="tab">Collections</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#works" role="tab" data-toggle="tab">Works</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#downloads" role="tab" data-toggle="tab">Downloads</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#users" role="tab" data-toggle="tab">Users</a>
</li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="collections">
<div class="card labels">
<div class="card-body">
<h2>Collections over time</h2>
<%=
graph_tag('collection-graph', [Hyrax::Statistics::Collections::OverTime.new.points], {
xaxis: {
mode: 'time',
minTickSize: [7, 'day']
},
yaxis: {
minTickSize: 1,
tickDecimals: 0,
min: 0
}
})
%>
</div>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="collections">
<div class="card labels">
<div class="card-body">
<h2>Collections over time</h2>
<%=
graph_tag('collection-graph', [Hyrax::Statistics::Collections::OverTime.new.points], {
xaxis: {
mode: 'time',
minTickSize: [7, 'day']
},
yaxis: {
minTickSize: 1,
tickDecimals: 0,
min: 0
}
})
%>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="works">
<div class="card labels">
<div class="card-body">
<h2>Works over time</h2>
<%=
graph_tag('works-graph', [Hyrax::Statistics::Works::OverTime.new.points], {
xaxis: {
mode: 'time',
minTickSize: [7, 'day']
},
yaxis: {
minTickSize: 1,
tickDecimals: 0,
min: 0
}
})
%>
<h2>Works by type:</h2>
<%=
graph_tag('works-by-type', Hyrax::Statistics::Works::ByResourceType.new.query, series: {
pie: {
show: true,
}
})
%>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="works">
<div class="card labels">
<div class="card-body">
<h2>Works over time</h2>
<%=
graph_tag('works-graph', [Hyrax::Statistics::Works::OverTime.new.points], {
xaxis: {
mode: 'time',
minTickSize: [7, 'day']
},
yaxis: {
minTickSize: 1,
tickDecimals: 0,
min: 0
}
})
%>
<h2>Works by type:</h2>
<%=
graph_tag('works-by-type', Hyrax::Statistics::Works::ByResourceType.new.query, series: {
pie: {
show: true,
}
})
%>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="downloads">
<div class="card labels">
<div class="card-body">
...
</div>
</div>
<div role="tabpanel" class="tab-pane" id="downloads">
<div class="card labels">
<div class="card-body">
...
</div>
</div>
<div role="tabpanel" class="tab-pane" id="users">
<div class="card labels">
<div class="card-body">
<%= render "hyrax/admin/stats/stats_by_date" %>
<%= render "hyrax/admin/stats/top_data" %>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="users">
<div class="card labels">
<div class="card-body">
<%= render "hyrax/admin/stats/stats_by_date" %>
<%= render "hyrax/admin/stats/top_data" %>
</div>
</div>
<script>
Blacklight.onLoad(function() {
var stats = require('statistics_tab_manager');
new stats.Tab('#collections').show();
new stats.Tab('#works');
});
</script>
</div>
<script>
Blacklight.onLoad(function() {
var stats = require('statistics_tab_manager');
new stats.Tab('#collections').show();
new stats.Tab('#works');
});
</script>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/hyrax/contact_form/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
</div>

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

<div class="form-group row">
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% menu = Hyrax::MenuPresenter.new(self) %>
<% menu = Hyku::MenuPresenter.new(self) %>
<div class="sidebar-toggle"><span class="fa fa-chevron-circle-right"></span></div>
<nav aria-label="sidebar-nav">
<ul class="nav nav-pills flex-column">
Expand Down
40 changes: 20 additions & 20 deletions app/views/hyrax/dashboard/collections/_form_share.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@
<!-- Add group 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: 'group-participants-form' } do |f| %>
url: [hyrax, :dashboard, @form, :permission_template],
html: { id: 'group-participants-form' } do |f| %>

<div class="form-inline add-sharing-form sharing-row-form">
<%= f.fields_for 'access_grants_attributes',
f.object.access_grants.build(agent_type: 'group'),
index: 0 do |builder| %>
f.object.access_grants.build(agent_type: 'group'),
index: 0 do |builder| %>

<div class="form-group mr-2">
<label class="mr-2"><%= t('.add_group') %>:</label>
<%= builder.hidden_field :agent_type %>
<%= builder.text_field :agent_id,
placeholder: t('.search_for_a_group'),
class: 'form-control search-input' %>
placeholder: t('.search_for_a_group'),
class: 'form-control search-input' %>
</div>
<div class="form-group">
<label class="mr-2">as</label>
<%# OVERRIDE: Change select to use Hyrax::Groups %>
<%= builder.select :agent_id,
Hyrax::Group.all.map { |g| [g.humanized_name, g.name] },
{ prompt: t('.select_a_group') },
class: 'form-control' %>
<%# OVERRIDE: Change select to use Hyrax::Groups %>
<%= builder.select :agent_id,
Hyrax::Group.all.map { |g| [g.humanized_name, g.name] },
{ prompt: t('.select_a_group') },
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 %>
Expand All @@ -46,26 +46,26 @@
<!-- 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| %>
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| %>
f.object.access_grants.build(agent_type: 'user'),
index: 0 do |builder| %>

<div class="form-group">
<label class="mr-2"><%= t('.add_user') %>:</label>
<%= builder.hidden_field :agent_type %>
<%= builder.text_field :agent_id,
placeholder: t('.search_for_a_user') %>
placeholder: t('.search_for_a_user') %>
</div>
<div class="form-group">
<label class="mx-2">as</label>
<%= builder.select :access,
access_options,
{ prompt: t('.select_a_role') },
class: 'form-control' %>
access_options,
{ prompt: t('.select_a_role') },
class: 'form-control' %>
</div>
<% end %>
Expand All @@ -80,7 +80,7 @@

<h2 class="h3"><%= t(".current_shared") %></h2>
<section class="section-collection-sharing">

<legend><%= t(".current_shared") %></legend>

<%= render 'form_share_table', access: 'managers', filter: :manage? %>
<%= render 'form_share_table', access: 'depositors', filter: :deposit? %>
Expand Down
10 changes: 10 additions & 0 deletions spec/models/generic_work_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
describe 'class configuration' do
subject { described_class }

describe '#iiif_print_config#pdf_splitter_service' do
subject { described_class.new.iiif_print_config.pdf_splitter_service }

it { is_expected.to eq(IiifPrint::TenantConfig::PdfSplitter) }
end

describe "metadata" do
it { is_expected.to have_property(:bulkrax_identifier).with_predicate("https://hykucommons.org/terms/bulkrax_identifier") }
end

its(:migrating_from) { is_expected.to eq(GenericWork) }
its(:migrating_to) { is_expected.to eq(GenericWorkResource) }

Expand Down
Loading

0 comments on commit 6f29c63

Please sign in to comment.