This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
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.
- Loading branch information
Showing
69 changed files
with
300 additions
and
10,487 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
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 |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
- name: Clone settings repository locally | ||
git: | ||
repo: '[email protected]:Princeton-CDH/deployment.git' | ||
# Use lookup here because we're working on the machine running ansible | ||
dest: "{{ lookup('env', 'HOME') }}/.deploy/" | ||
dest: "{{ home }}/.deploy/" | ||
version: 'master' | ||
delegate_to: localhost | ||
- name: Clone the repo if doesn't already exist and make sure it's on gitref | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,13 @@ | |
{% block page-subtitle %}{{ page.meta_title }} ‖ {% endblock %} | ||
{% block nav-title %} {{ page.title }} {% endblock %} | ||
|
||
{% block preview_meta %} | ||
{# override preview image #} | ||
{% with page_meta_image='img/banner/[email protected]' twitter_card='summary_large_image' %} | ||
{{ block.super }} | ||
{% endwith %} | ||
{% endblock %} | ||
|
||
{% block header_class %}mdl-layout__header--transparent{% endblock %} | ||
|
||
{% block page-context-id %}books-list{% endblock %} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,13 @@ | |
{% block page-subtitle %}{{ page.meta_title }} ‖ {% endblock %} | ||
{% block nav-title %} {{ page.title }} {% endblock %} | ||
|
||
{% block preview_meta %} | ||
{# override preview image #} | ||
{% with page_meta_image='img/banner/[email protected]' twitter_card='summary_large_image' %} | ||
{{ block.super }} | ||
{% endwith %} | ||
{% endblock %} | ||
|
||
{% block header_class %}mdl-layout__header--transparent{% endblock %} | ||
|
||
{% block page-context-id %}citations-list{% endblock %} | ||
|
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
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 |
---|---|---|
|
@@ -58,37 +58,6 @@ def get_queryset(self): | |
instances = super(InstanceDetailView, self).get_queryset() | ||
return instances.filter(digital_edition__isnull=False) | ||
|
||
def get_context_data(self, *args, **kwargs): | ||
'''Insert manifest license data into template context.''' | ||
context_data = super(InstanceDetailView, self).get_context_data() | ||
instance = context_data['object'] | ||
license_text = None | ||
# PUL seeAlso data contains an "edm_rights" section with | ||
# a label for the rights statement. Use that if possible | ||
for data in instance.digital_edition.extra_data.values(): | ||
if 'edm_rights' in data: | ||
license_text = data['edm_rights']['pref_label'] | ||
break | ||
|
||
# if license text not found, look up label based on license uri | ||
if not license_text: | ||
license_url = instance.digital_edition.license | ||
if license_url: | ||
# NOTE: url logic is specific to rightsstatements.org | ||
data_url = license_url.replace('vocab', 'data') | ||
response = requests.get(data_url) | ||
if response.status_code == 200: | ||
# This should be safe for all rightsstatments.org | ||
# prefLabels as they seem to be setting English as their | ||
# default using @ notation. | ||
license_text = response.json()['prefLabel']['@value'] | ||
|
||
if license_text: | ||
context_data['license_text'] = license_text | ||
|
||
return context_data | ||
|
||
|
||
class InstanceReferenceDetailView(InstanceDetailView): | ||
|
||
template_name = 'books/detail/references.html' | ||
|
@@ -247,8 +216,6 @@ def get_context_data(self, **kwargs): | |
'facets': facets, # now includes ranges as facets.ranges | ||
'total': self.queryset.count(), | ||
'form': self.form, | ||
# specify preview image for metadata | ||
'page_meta_image': 'img/banner/[email protected]' | ||
}) | ||
return context | ||
|
||
|
@@ -381,8 +348,6 @@ def get_context_data(self, **kwargs): | |
'facets': facets, | ||
'total': self.queryset.count(), | ||
'form': self.form, | ||
# specify preview image for metadata | ||
'page_meta_image': 'img/banner/[email protected]' | ||
}) | ||
return context | ||
|
||
|
@@ -712,7 +677,14 @@ def get_proxy_url(self, *args, **kwargs): | |
''' | ||
Return a proxy url for client browsers to access IIIF images from. | ||
''' | ||
|
||
instance = get_object_or_404(Instance, slug=self.kwargs['slug']) | ||
|
||
# if instance has no digital edition associated, there are | ||
# no images to be found | ||
if not instance.digital_edition: | ||
raise Http404 | ||
|
||
canvas_id = self.kwargs.get('short_id', None) | ||
if canvas_id and canvas_id != 'default': | ||
canvas = instance.images() \ | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,13 @@ | |
{% block page-subtitle %}{{ page.meta_title }} ‖ {% endblock %} | ||
{% block nav-title %} {{ page.title }} {% endblock %} | ||
|
||
{% block preview_meta %} | ||
{# override preview image #} | ||
{% with page_meta_image='img/banner/[email protected]' twitter_card='summary_large_image' %} | ||
{{ block.super }} | ||
{% endwith %} | ||
{% endblock %} | ||
|
||
{% block header_class %}mdl-layout__header--transparent{% endblock %} | ||
|
||
{% block page-context-id %}interventions-list{% endblock %} | ||
|
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 |
---|---|---|
|
@@ -281,7 +281,5 @@ def get_context_data(self, **kwargs): | |
'facets': facets, | ||
'total': self.queryset.count(), | ||
'form': self.form, | ||
# specify preview image for metadata | ||
'page_meta_image': 'img/banner/[email protected]' | ||
}) | ||
return context |
Oops, something went wrong.