-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from IUBLibTech/custom-metadata
IULRDC-5 Implement custom metadata for data catalog
- Loading branch information
Showing
6 changed files
with
221 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module Hyrax | ||
class DataSetPresenter < Hyrax::WorkShowPresenter | ||
delegate :summary, :documentation, :access_summary, :access_process, :data_location, :time_frame, | ||
:file_format, :hosting_unit, :public_contact, | ||
delegate :abstract, :description, :related_url, :rights_notes, :time_period, :subject, | ||
:geographic_location, :domain_subject, :creator, :location_physical, :digital_specifications, | ||
:expert, :holding_location, :campus, :rights_statement, :bibliographic_citations, | ||
to: :solr_document | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
app/renderers/hyrax/renderers/markdown_attribute_renderer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
module Hyrax | ||
module Renderers | ||
class MarkdownAttributeRenderer < AttributeRenderer | ||
private | ||
|
||
def attribute_value_to_html(value) | ||
# text = value.join("\n\n") | ||
text = value | ||
DataCatalog::MarkdownService.call(text).html_safe | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
<%= presenter.attribute_to_html(:documentation, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:access_summary, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:access_process, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:time_frame, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:subject, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:data_location, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:file_format, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:public_contact, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:hosting_unit, render_as: :faceted, html_dl: true) %> | ||
|
||
<%= presenter.attribute_to_html(:alternative_title, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:abstract, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:date_modified, label: t('hyrax.base.show.last_modified'), html_dl: true) %> | ||
<%= presenter.attribute_to_html(:creator, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:contributor, render_as: :faceted, html_dl: true) %> | ||
|
||
<%= presenter.attribute_to_html(:publisher, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:bibliographic_citation, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:language, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:identifier, render_as: :linked, search_field: 'identifier_tesim', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:keyword, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:date_created, render_as: :linked, search_field: 'date_created_tesim', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:based_near_label, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:related_url, render_as: :external_link, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:resource_type, render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:source, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:extent, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:rights_notes, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:access_right, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:license, render_as: :license, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:abstract, label: 'Summary', render_as: :markdown, html_dl: true) %> | ||
<%#= presenter.attribute_to_html(:description, label: 'Description', render_as: :markdown, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:related_url, label: 'Documentation', render_as: :external_link, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:rights_notes, label: 'Access Instructions', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:time_period, label: 'Timeframe', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:subject, label: 'Keyword Subject', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:geographic_location, label: 'Spatial Subject', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:domain_subject, label: 'Domain Subject', render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:creator, label: 'Creator', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:location_physical, label: 'Data Location', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:digital_specifications, label: 'File Format(s)', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:expert, label: 'Public Contact', html_dl: true) %> | ||
<%= presenter.attribute_to_html(:holding_location, label: 'Hosting Unit', render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:campus, label: 'Campus', render_as: :faceted, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:rights_statement, label: 'Access Restrictions', render_as: :rights_statement, html_dl: true) %> | ||
<%= presenter.attribute_to_html(:bibliographic_citation, label: 'Bibliographic Citation', html_dl: true) %> |
Oops, something went wrong.