generated from CollectionBuilder/collectionbuilder-csv
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tabbed style to metadata and transcriptions
- Loading branch information
Showing
7 changed files
with
105 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% comment %} | ||
|
||
Adds Item page button links, styled as a Bootstrap btn-group. | ||
Features: | ||
|
||
- View on Map -- if item has "latitude" and "longitude" value, links to location on map. | ||
- View on ContentDM | ||
- No download buttons | ||
{%- endcomment -%} | ||
<div class="btn-group" role="group" aria-label="Item options"> | ||
<!--{% if page.object_transcript %}<button class="btn btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTranscript" aria-expanded="false" aria-controls="collapseExample">View Transcript</button>{% endif %} --> | ||
{% if page.date %}{%- capture year -%}{% if page.date contains "-" %}{{ page.date | split: "-" | first }}{% elsif page.date contains "/" %}{{ page.date | split: "/" | last }}{% else %}{{ page.date }}{% endif %}{%- endcapture -%} | ||
<a href="{{ year | strip | prepend: '/timeline.html#y' | relative_url }}" class="btn btn-outline-primary">View on Timeline</a>{% endif %} | ||
{% if page.latitude and page.longitude %} | ||
<a href="{{ '/map.html?location=' | append: page.latitude | append: ',' | append: page.longitude | append: '&marker=' | append: page.objectid | relative_url }}" class="btn btn-outline-primary">View on Map</a>{% endif %} | ||
<a href="{{page.link}}" class="btn btn-outline-primary">View on ContentDM</a> | ||
</div> | ||
<!-- {% if page.object_transcript %} | ||
<div class="collapse mt-3" id="collapseTranscript"> | ||
<div class="card card-body text-start"> | ||
{% assign transcript_type = page.object_transcript | slice: 0,1 %} | ||
{% if transcript_type == '/' %} | ||
{% assign transcript_location = page.object_transcript | remove_first: '/' %} | ||
{% assign transcript = site.pages | where: 'path', transcript_location | first %} | ||
{{ transcript.content | markdownify }} | ||
{% else %} | ||
{{ page.object_transcript | markdownify }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} --> |
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,51 @@ | ||
{% comment %} | ||
Adds item metadata and transcription tabs | ||
{%- endcomment -%} | ||
|
||
<ul class="nav nav-tabs" id="myTab" role="tablist"> | ||
<li class="nav-item"> | ||
<button class="nav-link active" id="metadatas-tab" data-bs-toggle="tab" data-bs-target="#metadatas" type="button" role="tab" aria-controls="metadatas" aria-selected="true">Metadata</button> | ||
</li> | ||
{% if page.object_transcript %} | ||
<li class="nav-item"> | ||
<button class="nav-link" id="transcript-tab" data-bs-toggle="tab" data-bs-target="#transcript" type="button" role="tab" aria-controls="transcript" aria-selected="false">Transcript</button> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
|
||
<div class="tab-content py-3" id="myTabContent"> | ||
<div class="tab-pane fade show active" id="metadatas" role="tabpanel" aria-labelledby="metadatas-tab"> | ||
{%- assign fields = site.data.config-metadata | where_exp: 'item', 'item.display_name != nil' -%} | ||
<dl> | ||
{% for f in fields %}{% if page[f.field] %} | ||
<dt class="field">{{ f.display_name }}:</dt> | ||
<dd class="field-value"> | ||
{% if f.browse_link == "true" %} | ||
{% assign topics = page[f.field] | split: ";" %} | ||
{% for t in topics %} | ||
<a class="me-3" href="{{ t | strip | url_param_escape | prepend: '/browse.html#' | relative_url }}">{{ t | strip }}</a> | ||
{% endfor %} | ||
{% elsif f.external_link == "true" %} | ||
<a href="{{ page[f.field] }}" target="_blank" rel="noopener">{{ page[f.field] }}</a> | ||
{% else %} | ||
{{ page[f.field] | replace: '""','"' }}{% endif %} | ||
</dd> | ||
{% endif %}{% endfor %} | ||
</dl> | ||
</div> | ||
<div class="tab-pane fade" id="transcript" role="tabpanel" aria-labelledby="transcript-tab"> | ||
{% if page.object_transcript %} | ||
{% assign transcript_type = page.object_transcript | slice: 0,1 %} | ||
{% if transcript_type == '/' %} | ||
{% assign transcript_location = page.object_transcript | remove_first: '/' %} | ||
{% assign transcript = site.pages | where: 'path', transcript_location | first %} | ||
{{ transcript.content | markdownify }} | ||
{% else %} | ||
{{ page.object_transcript | markdownify }} | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
|
||
|
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,16 @@ | ||
<ul class="nav nav-tabs" id="myTab" role="tablist"> | ||
<li class="nav-item" role="presentation"> | ||
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">Home</button> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Profile</button> | ||
</li> | ||
<li class="nav-item" role="presentation"> | ||
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">Contact</button> | ||
</li> | ||
</ul> | ||
<div class="tab-content" id="myTabContent"> | ||
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div> | ||
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div> | ||
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div> | ||
</div> |
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
Large diffs are not rendered by default.
Oops, something went wrong.