Skip to content

Commit

Permalink
Remove underscore from iiif manifest representation in es
Browse files Browse the repository at this point in the history
  • Loading branch information
dodget committed Sep 29, 2020
1 parent bd6d0c7 commit db8c444
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
5 changes: 3 additions & 2 deletions giza/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '9w)eu)4tj*v(x%8^tz$fsc8^t@jj66_7_!_w2wo@9lcs)^xf6='
SECRET_KEY = SECURE_SETTINGS.get("DJANGO_SECRET_KEY", '9w)eu)4tj*v(x%8^tz$fsc8^t@jj66_7_!_w2wo@9lcs)^xf6=')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = [
'127.0.0.1',
'localhost',
'.local',
'.archimedes.digital',
Expand Down Expand Up @@ -95,7 +96,7 @@
'USER': SECURE_SETTINGS.get('DB_USER', 'postgres'),
'PASSWORD': SECURE_SETTINGS.get('DB_PASSWORD'),
'HOST': SECURE_SETTINGS.get('DB_HOST', '127.0.0.1'),
'PORT': SECURE_SETTINGS.get('DB_PORT', 5432), # Default postgres port
'PORT': SECURE_SETTINGS.get('DB_PORT', '5432'), # Default postgres port
}
}

Expand Down
2 changes: 1 addition & 1 deletion offline_scripts/elasticsearch_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ curl -XPUT 'http://localhost:9200/giza' -d '
}
}
},
"iiif_manifest" : {
"iiifmanifest" : {
"properties": {
"displaytext": {
"type" : "text",
Expand Down
2 changes: 1 addition & 1 deletion offline_scripts/iiif_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def compile_resources_by_site():

def save(manifest):
if manifest and 'id' in manifest:
elasticsearch_connection.add_or_update_item(manifest['id'], json.dumps(manifest), 'iiif_manifest')
elasticsearch_connection.add_or_update_item(manifest['id'], json.dumps(manifest), 'iiifmanifest')

def main():
process_sites_media_related_manifests()
Expand Down
36 changes: 36 additions & 0 deletions tms/templates/tms/iiif_manifest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div class="feature-block__body">
<ul class="feature-block__list multicol-2">
{% if object.constituenttype %}
<li>
<div class="media-object list-item list-item-textinfo">
<dl class="dl-slim">
<dt>Type</dt>
<dd>{{ object.constituenttype }}</dd>
</dl>
</div>
</li>
{% endif %}
{% if object.altnames %}
<li>
<div class="media-object list-item list-item-textinfo">
<dl class="dl-slim">
<dt>Also Known As</dt>
{% for name in object.altnames %}
<dd>{{ name.type }} : {{ name.name }}</dd>
{% endfor %}
</dl>
</div>
</li>
{% endif %}
{% if object.remarks %}
<li>
<div class="media-object list-item list-item-textinfo">
<dl class="dl-slim">
<dt>Remarks</dt>
<dd>{{ object.remarks }}</dd>
</dl>
</div>
</li>
{% endif %}
</ul>
</div>
8 changes: 4 additions & 4 deletions tms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def static_pages(request, page_name):
def get_type_html(request, type, id, view):
# get site in elasticsearch and render or return 404
# try:
if view == "intro":
view = "full"
type_object = models.get_item(id, type)
return render(request, 'pages/'+view+'.html', {'object': type_object, 'type': type})
if view == "intro":
view = "full"
type_object = models.get_item(id, type)
return render(request, 'pages/'+view+'.html', {'object': type_object, 'type': type})
# except:
# raise Http404("There was an error getting this item")

Expand Down
4 changes: 3 additions & 1 deletion utils/views_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
'videos' : 'Videos',
'audio' : 'Audio',
'microfilm' : 'Microfilm',
'document' : 'Document'
'document' : 'Document',
'iiifmanifest' : 'IIIF Manifest'
}

FIELDS_PER_CATEGORY = {
Expand Down Expand Up @@ -478,6 +479,7 @@
}
}
},
'iiifmanifest' : {},
'microfilm' : {},
'document' : {}
}

0 comments on commit db8c444

Please sign in to comment.