summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/fatcat_web/entity_helpers.py2
-rw-r--r--python/fatcat_web/routes.py146
-rw-r--r--python/fatcat_web/templates/container_view.html25
-rw-r--r--python/fatcat_web/templates/creator_view.html23
-rw-r--r--python/fatcat_web/templates/entity_base.html41
-rw-r--r--python/fatcat_web/templates/entity_history.html1
-rw-r--r--python/fatcat_web/templates/entity_macros.html29
-rw-r--r--python/fatcat_web/templates/entity_view_metadata.html (renamed from python/fatcat_web/templates/entity_metadata.html)0
-rw-r--r--python/fatcat_web/templates/file_view.html24
-rw-r--r--python/fatcat_web/templates/fileset_view.html24
-rw-r--r--python/fatcat_web/templates/release_view.html3
-rw-r--r--python/fatcat_web/templates/release_view_contribs.html (renamed from python/fatcat_web/templates/release_contribs.html)0
-rw-r--r--python/fatcat_web/templates/release_view_references.html (renamed from python/fatcat_web/templates/release_references.html)0
-rw-r--r--python/fatcat_web/templates/webcapture_view.html28
-rw-r--r--python/fatcat_web/templates/work_view.html24
15 files changed, 215 insertions, 155 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py
index b3cda67f..ab5eaea8 100644
--- a/python/fatcat_web/entity_helpers.py
+++ b/python/fatcat_web/entity_helpers.py
@@ -100,7 +100,7 @@ def generic_get_entity(entity_type, ident):
elif entity_type == 'release':
return enrich_release_entity(api.get_release(ident, expand="container,files,filesets,webcaptures"))
elif entity_type == 'work':
- return api.get_work(ident)
+ return enrich_work_entity(api.get_work(ident))
else:
raise NotImplementedError
except ApiException as ae:
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py
index 326d5807..fd948262 100644
--- a/python/fatcat_web/routes.py
+++ b/python/fatcat_web/routes.py
@@ -28,7 +28,6 @@ def container_history(ident):
app.log.info(ae)
abort(ae.status)
return render_template('entity_history.html',
- page_title=entity.name,
entity_type="container",
entity=entity,
history=history)
@@ -41,7 +40,6 @@ def creator_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=entity.display_name,
entity_type="creator",
entity=entity,
history=history)
@@ -54,7 +52,6 @@ def file_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=None,
entity_type="file",
entity=entity,
history=history)
@@ -67,7 +64,6 @@ def fileset_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=None,
entity_type="fileset",
entity=entity,
history=history)
@@ -80,7 +76,6 @@ def webcapture_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=None,
entity_type="webcapture",
entity=entity,
history=history)
@@ -93,7 +88,6 @@ def release_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=entity.title,
entity_type="release",
entity=entity,
history=history)
@@ -106,7 +100,6 @@ def work_history(ident):
except ApiException as ae:
abort(ae.status)
return render_template('entity_history.html',
- page_title=None,
entity_type="work",
entity=entity,
history=history)
@@ -205,6 +198,15 @@ def generic_entity_view(entity_type, ident, view_template):
return render_template(view_template, entity_type=entity_type, entity=entity, editgroup_id=None)
+def generic_entity_revision_view(entity_type, revision_id, view_template):
+ entity = generic_get_entity_revision(entity_type, revision_id)
+
+ metadata = entity.to_dict()
+ metadata.pop('extra')
+ entity._metadata = metadata
+
+ return render_template(view_template, entity_type=entity_type, entity=entity, editgroup_id=None)
+
def generic_editgroup_entity_view(editgroup_id, entity_type, ident, view_template):
try:
editgroup = api.get_editgroup(editgroup_id)
@@ -224,106 +226,214 @@ def generic_editgroup_entity_view(editgroup_id, entity_type, ident, view_templat
def container_view(ident):
return generic_entity_view('container', ident, 'container_view.html')
+@app.route('/container/<ident>/metadata', methods=['GET'])
+def container_view_metadata(ident):
+ return generic_entity_view('container', ident, 'entity_view_metadata.html')
+
@app.route('/container/rev/<revision_id>', methods=['GET'])
def container_revision_view(revision_id):
- entity = generic_get_entity_revision('container', revision_id)
- return render_template('container_view.html', entity=entity, editgroup=None)
+ return generic_entity_revision_view('container', revision_id, 'container_view.html')
+
+@app.route('/container/rev/<revision_id>/metadata', methods=['GET'])
+def container_revision_view_metadata(revision_id):
+ return generic_entity_revision_view('container', revision_id, 'entity_view_metadata.html')
@app.route('/editgroup/<editgroup_id>/container/<ident>', methods=['GET'])
def container_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'container', ident, 'container_view.html')
+@app.route('/editgroup/<editgroup_id>/container/<ident>/metadata', methods=['GET'])
+def container_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'container', ident, 'entity_view_metadata.html')
+
@app.route('/creator/<ident>', methods=['GET'])
def creator_view(ident):
return generic_entity_view('creator', ident, 'creator_view.html')
+@app.route('/creator/<ident>/metadata', methods=['GET'])
+def creator_view_metadata(ident):
+ return generic_entity_view('creator', ident, 'entity_view_metadata.html')
+
@app.route('/creator/rev/<revision_id>', methods=['GET'])
def creator_revision_view(revision_id):
entity = generic_get_entity_revision('creator', revision_id)
- return render_template('creator_view.html', creator=entity, editgroup=None)
+ return render_template('creator_view.html', entity_type='creator', entity=entity, editgroup=None)
+
+@app.route('/creator/rev/<revision_id>/metadata', methods=['GET'])
+def creator_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('creator', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='creator', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/creator/<ident>', methods=['GET'])
def creator_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'creator', ident, 'creator_view.html')
+@app.route('/editgroup/<editgroup_id>/creator/<ident>/metadata', methods=['GET'])
+def creator_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'creator', ident, 'entity_view_metadata.html')
+
+
@app.route('/file/<ident>', methods=['GET'])
def file_view(ident):
return generic_entity_view('file', ident, 'file_view.html')
+@app.route('/file/<ident>/metadata', methods=['GET'])
+def file_view_metadata(ident):
+ return generic_entity_view('file', ident, 'entity_view_metadata.html')
+
@app.route('/file/rev/<revision_id>', methods=['GET'])
def file_revision_view(revision_id):
entity = generic_get_entity_revision('file', revision_id)
- return render_template('file_view.html', entity=entity, editgroup=None)
+ return render_template('file_view.html', entity_type='file', entity=entity, editgroup=None)
+
+@app.route('/file/rev/<revision_id>/metadata', methods=['GET'])
+def file_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('file', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='file', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/file/<ident>', methods=['GET'])
def file_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'file', ident, 'file_view.html')
+@app.route('/editgroup/<editgroup_id>/file/<ident>/metadata', methods=['GET'])
+def file_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'file', ident, 'entity_view_metadata.html')
+
+
@app.route('/fileset/<ident>', methods=['GET'])
def fileset_view(ident):
return generic_entity_view('fileset', ident, 'fileset_view.html')
+@app.route('/fileset/<ident>/metadata', methods=['GET'])
+def fileset_view_metadata(ident):
+ return generic_entity_view('fileset', ident, 'entity_view_metadata.html')
+
@app.route('/fileset/rev/<revision_id>', methods=['GET'])
def fileset_revision_view(revision_id):
entity = generic_get_entity_revision('fileset', revision_id)
- return render_template('fileset_view.html', entity=entity, editgroup=None)
+ return render_template('fileset_view.html', entity_type='fileset', entity=entity, editgroup=None)
+
+@app.route('/fileset/rev/<revision_id>/metadata', methods=['GET'])
+def fileset_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('fileset', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='fileset', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/fileset/<ident>', methods=['GET'])
def fileset_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'fileset', ident, 'fileset_view.html')
+@app.route('/editgroup/<editgroup_id>/fileset/<ident>/metadata', methods=['GET'])
+def fileset_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'fileset', ident, 'entity_view_metadata.html')
+
+
@app.route('/webcapture/<ident>', methods=['GET'])
def webcapture_view(ident):
return generic_entity_view('webcapture', ident, 'webcapture_view.html')
+@app.route('/webcapture/<ident>/metadata', methods=['GET'])
+def webcapture_view_metadata(ident):
+ return generic_entity_view('webcapture', ident, 'entity_view_metadata.html')
+
@app.route('/webcapture/rev/<revision_id>', methods=['GET'])
def webcapture_revision_view(revision_id):
entity = generic_get_entity_revision('webcapture', revision_id)
- return render_template('webcapture_view.html', entity=entity, editgroup=None)
+ return render_template('webcapture_view.html', entity_type='webcapture', entity=entity, editgroup=None)
+
+@app.route('/webcapture/rev/<revision_id>/metadata', methods=['GET'])
+def webcapture_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('webcapture', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='webcapture', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/webcapture/<ident>', methods=['GET'])
def webcapture_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'webcapture', ident, 'webcapture_view.html')
+@app.route('/editgroup/<editgroup_id>/webcapture/<ident>/metadata', methods=['GET'])
+def webcapture_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'webcapture', ident, 'entity_view_metadata.html')
+
+
@app.route('/release/<ident>', methods=['GET'])
def release_view(ident):
return generic_entity_view('release', ident, 'release_view.html')
@app.route('/release/<ident>/contribs', methods=['GET'])
def release_view_contribs(ident):
- return generic_entity_view('release', ident, 'release_contribs.html')
+ return generic_entity_view('release', ident, 'release_view_contribs.html')
@app.route('/release/<ident>/references', methods=['GET'])
def release_view_references(ident):
- return generic_entity_view('release', ident, 'release_references.html')
+ return generic_entity_view('release', ident, 'release_view_references.html')
@app.route('/release/<ident>/metadata', methods=['GET'])
def release_view_metadata(ident):
- return generic_entity_view('release', ident, 'entity_metadata.html')
+ return generic_entity_view('release', ident, 'entity_view_metadata.html')
@app.route('/release/rev/<revision_id>', methods=['GET'])
def release_revision_view(revision_id):
entity = generic_get_entity_revision('release', revision_id)
- return render_template('release_view.html', entity=entity, editgroup=None)
+ return render_template('release_view.html', entity_type='release', entity=entity, editgroup=None)
+
+@app.route('/release/rev/<revision_id>/contribs', methods=['GET'])
+def release_revision_view_contribs(revision_id):
+ entity = generic_get_entity_revision('release', revision_id)
+ return render_template('release_view_contribs.html', entity_type='release', entity=entity, editgroup=None)
+
+@app.route('/release/rev/<revision_id>/references', methods=['GET'])
+def release_revision_view_references(revision_id):
+ entity = generic_get_entity_revision('release', revision_id)
+ return render_template('release_view_references.html', entity_type='release', entity=entity, editgroup=None)
+
+@app.route('/release/rev/<revision_id>/metadata', methods=['GET'])
+def release_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('release', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='release', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/release/<ident>', methods=['GET'])
def release_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'release', ident, 'release_view.html')
+@app.route('/editgroup/<editgroup_id>/release/<ident>/contribs', methods=['GET'])
+def release_editgroup_view_contribs(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'release', ident, 'release_view_contribs.html')
+
+@app.route('/editgroup/<editgroup_id>/release/<ident>/references', methods=['GET'])
+def release_editgroup_view_references(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'release', ident, 'release_view_references.html')
+
+@app.route('/editgroup/<editgroup_id>/release/<ident>/metadata', methods=['GET'])
+def release_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'release', ident, 'entity_view_metadata.html')
+
+
@app.route('/work/<ident>', methods=['GET'])
def work_view(ident):
return generic_entity_view('work', ident, 'work_view.html')
+@app.route('/work/<ident>/metadata', methods=['GET'])
+def work_view_metadata(ident):
+ return generic_entity_view('work', ident, 'entity_view_metadata.html')
+
@app.route('/work/rev/<revision_id>', methods=['GET'])
def work_revision_view(revision_id):
entity = generic_get_entity_revision('work', revision_id)
- return render_template('work_view.html', entity=entity, editgroup=None)
+ return render_template('work_view.html', entity_type='release', entity=entity, editgroup=None)
+
+@app.route('/work/rev/<revision_id>/metadata', methods=['GET'])
+def work_revision_view_metadata(revision_id):
+ entity = generic_get_entity_revision('work', revision_id)
+ return render_template('entity_view_metadata.html', entity_type='work', entity=entity, editgroup=None)
@app.route('/editgroup/<editgroup_id>/work/<ident>', methods=['GET'])
def work_editgroup_view(editgroup_id, ident):
return generic_editgroup_entity_view(editgroup_id, 'work', ident, 'work_view.html')
+@app.route('/editgroup/<editgroup_id>/work/<ident>/metadata', methods=['GET'])
+def work_editgroup_view_metadata(editgroup_id, ident):
+ return generic_editgroup_entity_view(editgroup_id, 'work', ident, 'entity_view_metadata.html')
+
### Views ###################################################################
diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html
index b86b1aa7..f945a91a 100644
--- a/python/fatcat_web/templates/container_view.html
+++ b/python/fatcat_web/templates/container_view.html
@@ -1,20 +1,12 @@
{% set container = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">{{ container.name }}
- <span class="sub header"><code>container {{ container.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
+<div class="column" style="font-size: 16px; flex: 1;">
{% if (container.extra != None) and (container.extra['urls'] != None) and (container.extra['urls']|length > 0) %}
<div style="text-overflow: ellipsis; overflow: hidden; width: 100%;">
@@ -39,15 +31,8 @@
</form>
{% endif %}
-
-{% if entity.extra %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
-
-
</div>
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
<div class="ui segment top attached">
{% if container._es and container._es.is_oa == True %}
diff --git a/python/fatcat_web/templates/creator_view.html b/python/fatcat_web/templates/creator_view.html
index 63f83917..1b550316 100644
--- a/python/fatcat_web/templates/creator_view.html
+++ b/python/fatcat_web/templates/creator_view.html
@@ -1,20 +1,12 @@
{% set creator = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">{{ creator.display_name }}
- <span class="sub header"><code>creator {{ creator.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
+<div class="column" style="font-size: 16px; flex: 1;">
{% if creator.given_name or creator.surname %}
<table class="ui definition single line fixed compact small unstackable table">
@@ -31,11 +23,6 @@
</table>
{% endif %}
-{% if entity.extra != None %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
-
<br>
<h3>Releases</h3>
{% if creator._releases != [] %}
@@ -46,7 +33,7 @@ This creator has not contributed to any releases.
{% endif %}
</div>
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
<div class="ui segment top attached">
{% if creator.orcid or creator.wikidata_qid %}
diff --git a/python/fatcat_web/templates/entity_base.html b/python/fatcat_web/templates/entity_base.html
index 0768f5a9..ba25e3f9 100644
--- a/python/fatcat_web/templates/entity_base.html
+++ b/python/fatcat_web/templates/entity_base.html
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% macro entity_tab(name, text, url_suffix, count=None) %}
-<a href ="/{{ entity_type }}/{{ entity.ident }}{{ url_suffix }}" class="{% if entity_view == name %}active{% endif %} item" style="padding: 0em 1.2em;">{{ text }}{% if count != None %} ({{ count }}){% endif %}</a>
+<a href ="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{% if entity.ident %}{{ entity.ident }}{% elif entity.revision %}rev/{{ entity.revision }}{% endif %}{{ url_suffix }}" class="{% if entity_view == name %}active{% endif %} item" style="padding: 0em 1.2em;">{{ text }}{% if count != None %} ({{ count }}){% endif %}</a>
{% endmacro %}
{% block fullmain %}
@@ -10,14 +10,35 @@
<div class="ui centered grid">
<div class="fifteen wide large screen sixteen wide column" style="padding-bottom: 0px;">
<h1 class="ui header">
- {% if entity_type == "release" %}
+ {% if entity_type == "container" %}
+ {{ entity.name }}
+ {% elif entity_type == "creator" %}
+ {{ entity.display_name }}
+ {% elif entity_type == "file" %}
+ {% elif entity_type == "fileset" %}
+ {% elif entity_type == "webcapture" %}
+ {% if entity.original_url %}
+ <a href="{{ entity.original_url }}" style="color: black;"><code>{{ entity.original_url }}</code></a>
+ {% endif %}
+ {% elif entity_type == "release" %}
<span itemprop="headline"><span itemprop="name">{{ entity.title }}</span></span>
{% if entity.subtitle %}
<br><span style="font-size: smaller; font-weight: normal;">{{ entity.subtitle }}</span>
{% endif %}
{% endif %}
<span class="sub header">
- <code>{{ entity_type }}_{{ entity.ident }}</code>
+ <code>
+ {% if entity.ident %}
+ {{ entity_type }}_{{ entity.ident }}
+ {% elif entity.revision %}
+ {{ entity_type }}_rev_{{ entity.revision }}
+ {% endif %}
+ {% if editgroup %}
+ <a href="/editgroup/{{ editgroup.editgroup_id }}" style="color: purple;">
+ [as of editgroup_{{ editgroup.editgroup_id }}]
+ </a>
+ {% endif %}
+ </code>
</span>
</h1>
{% if entity_type == "release" %}
@@ -44,10 +65,16 @@
{% endif %}
{{ entity_tab("metadata", "Metadata", "/metadata") }}
</div>
- <div class="ui small tabular compact menu floated right">
- {{ entity_tab("edit", "Edit", "/edit") }}
- {{ entity_tab("history", "History", "/history") }}
- </div>
+ {% if entity.ident %}
+ <div class="ui small tabular compact menu floated right">
+ {% if not editgroup or not (editgroup.changelog_index or editgroup.submitted ) %}
+ {{ entity_tab("edit", "Edit", "/edit") }}
+ {% endif %}
+ {% if not editgroup %}
+ {{ entity_tab("history", "History", "/history") }}
+ {% endif %}
+ </div>
+ {% endif %}
</div>
</div>
</div>
diff --git a/python/fatcat_web/templates/entity_history.html b/python/fatcat_web/templates/entity_history.html
index 73a3df92..2079b464 100644
--- a/python/fatcat_web/templates/entity_history.html
+++ b/python/fatcat_web/templates/entity_history.html
@@ -1,5 +1,4 @@
{% set entity_view = "history" %}
-{% set entity_type = "release" %}
{% extends "entity_base.html" %}
{% block entity_main %}
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html
index 1d798dfb..4b70651f 100644
--- a/python/fatcat_web/templates/entity_macros.html
+++ b/python/fatcat_web/templates/entity_macros.html
@@ -1,16 +1,24 @@
{% macro fatcat_bits(entity, entity_type, expand="", editgroup=None) -%}
-{% if entity.state == None and editgroup.editgroup_id %}
-<div class="ui segment pink inverted attached">
- <b>Edit In Progress</b>
- <p>You are viewing this entity as of a specific editgroup (which may or may not have been merged yet):
- <b><a href="/editgroup/{{ editgroup.editgroup_id }}">{{ editgroup.editgroup_id }}</a></b>
-</div>
+{% if entity.state == None and editgroup %}
+ <div class="ui segment pink inverted attached">
+ {% if editgroup.changelog_index %}
+ <b>Accepted Edit Version</b>
+ <p>This is the version of the entity as of a specific merged editgroup:
+ {% elif editgroup.submitted %}
+ <b>Submitted Edit Version</b>
+ <p>This is a version of the entity that has been submitted for approval as part of an editgroup:
+ {% else %}
+ <b>Edit In Progress</b>
+ <p>This is a version of the entity that has not yet been submitted for approval, part of an editgroup:
+ {% endif %}
+ <b><a href="/editgroup/{{ editgroup.editgroup_id }}" style="color: white; font-weight: bold;">{{ editgroup.editgroup_id }}</a></b>
+ </div>
{% elif entity.state == None and entity.ident == None %}
<div class="ui segment pink inverted attached">
<b>Revision</b>
- <p>You are viewing a specific revision of an entity.
+ <p>This is a specific, static metadata record, not necessarily linked to any current entity in the catalog.
</div>
{% elif entity.state == "wip" %}
<div class="ui segment pink inverted attached">
@@ -21,10 +29,13 @@
<div class="ui segment attached">
<b>Fatcat Bits</b>
- <p>State is "{{ entity.state }}".
+ <p>
+ {% if entity.state %}
+ State is "{{ entity.state }}".
+ {% endif %}
{% if entity.state != "deleted" %}
Revision:
- <br><small><code>{{ entity.revision }}</code></small>
+ <br><small><code><a href="/{{ entity_type }}/rev/{{ entity.revision }}">{{ entity.revision }}</a></code></small>
{% endif %}
<br><a href="{% if config.FATCAT_DOMAIN == 'dev.fatcat.wiki' %}http://localhost:9411{% else %}https://api.{{ config.FATCAT_DOMAIN }}{% endif %}/v0/{{ entity_type }}/{{ entity.ident }}{% if expand %}?expand={{ expand}}{% endif %}">As JSON object via API</a>
</div>
diff --git a/python/fatcat_web/templates/entity_metadata.html b/python/fatcat_web/templates/entity_view_metadata.html
index 5ce97d10..5ce97d10 100644
--- a/python/fatcat_web/templates/entity_metadata.html
+++ b/python/fatcat_web/templates/entity_view_metadata.html
diff --git a/python/fatcat_web/templates/file_view.html b/python/fatcat_web/templates/file_view.html
index 39ffaaa0..d60ea49d 100644
--- a/python/fatcat_web/templates/file_view.html
+++ b/python/fatcat_web/templates/file_view.html
@@ -1,25 +1,12 @@
{% set file = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">
- <span class="sub header"><code>file {{ file.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
-
-{% if entity.extra %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
+<div class="column" style="font-size: 16px; flex: 1;">
<h3>Releases</h3>
{% if entity.releases != [] %}
@@ -55,7 +42,7 @@ No known public URL, mirror, or archive for this file.
</table>
</div>
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
{% if file.urls != None and file.urls != [] %}
<a href="{{ file.urls[0].url }}" class="ui top attached fluid huge green button"><i class="file icon"></i>Download File</a>
@@ -80,5 +67,4 @@ No known public URL, mirror, or archive for this file.
</div>
</div>
-
{% endblock %}
diff --git a/python/fatcat_web/templates/fileset_view.html b/python/fatcat_web/templates/fileset_view.html
index 7bc46d45..27d5b6da 100644
--- a/python/fatcat_web/templates/fileset_view.html
+++ b/python/fatcat_web/templates/fileset_view.html
@@ -1,25 +1,12 @@
{% set fileset = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">
- <span class="sub header"><code>fileset {{ entity.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
-
-{% if entity.extra %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
+<div class="column" style="font-size: 16px; flex: 1;">
<h3>Releases</h3>
{% if entity.releases != [] %}
@@ -62,7 +49,7 @@ No known public URL, mirror, or archive for this File Set.
{% endif %}
</div>
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
{% if fileset._total_size != None %}
<div class="ui segment attached">
@@ -75,5 +62,4 @@ No known public URL, mirror, or archive for this File Set.
</div>
</div>
-
{% endblock %}
diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html
index 2212741a..5b019b3c 100644
--- a/python/fatcat_web/templates/release_view.html
+++ b/python/fatcat_web/templates/release_view.html
@@ -246,7 +246,7 @@
<a href="{{ entity.files[0].urls[0].url }}" class="ui top attached fluid huge green button"><i class="file pdf outline icon"></i>Download Full Text</a>
{% elif entity.state == 'active' and entity.webcaptures != [] and entity.webcaptures[0].archive_urls != [] and entity.webcaptures[0].archive_urls[0].rel == "wayback" %}
<a href="{{ entity.webcaptures[0].archive_urls[0].url }}{{ entity.webcaptures[0]._wayback_suffix }}" class="ui top attached fluid huge green button"><i class="file archive outline icon"></i>View Web Archive</a>
-{% else %}
+{% elif entity.state == 'active' %}
<span class="ui top attached fluid huge grey button"><i class="file cross icon"></i>No Full Text Available</span>
{% endif %}
@@ -390,6 +390,7 @@
</div>
</div>
+
{% endblock %}
{% block postscript %}
diff --git a/python/fatcat_web/templates/release_contribs.html b/python/fatcat_web/templates/release_view_contribs.html
index 55cdf133..55cdf133 100644
--- a/python/fatcat_web/templates/release_contribs.html
+++ b/python/fatcat_web/templates/release_view_contribs.html
diff --git a/python/fatcat_web/templates/release_references.html b/python/fatcat_web/templates/release_view_references.html
index 22ebaddf..22ebaddf 100644
--- a/python/fatcat_web/templates/release_references.html
+++ b/python/fatcat_web/templates/release_view_references.html
diff --git a/python/fatcat_web/templates/webcapture_view.html b/python/fatcat_web/templates/webcapture_view.html
index b5495cee..16e5c03e 100644
--- a/python/fatcat_web/templates/webcapture_view.html
+++ b/python/fatcat_web/templates/webcapture_view.html
@@ -1,29 +1,12 @@
{% set webcapture = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">
- {% if webcapture.original_url %}
- <a href="{{ webcapture.original_url }}" style="color: black;"><code>{{ webcapture.original_url }}</code></a>
- {% endif %}
- <span class="sub header"><code>webcapture {{ webcapture.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
-
-
-{% if entity.extra %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
+<div class="column" style="font-size: 16px; flex: 1;">
<h3>Releases</h3>
{% if entity.releases != [] %}
@@ -70,7 +53,7 @@ This web capture is empty (contains no resources).
{% endif %}
</div>
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
{% if webcapture.timestamp != None %}
<div class="ui segment attached">
@@ -83,5 +66,4 @@ This web capture is empty (contains no resources).
</div>
</div>
-
{% endblock %}
diff --git a/python/fatcat_web/templates/work_view.html b/python/fatcat_web/templates/work_view.html
index aa32ba39..3e976597 100644
--- a/python/fatcat_web/templates/work_view.html
+++ b/python/fatcat_web/templates/work_view.html
@@ -1,25 +1,12 @@
{% set work = entity %}
+{% set entity_view = "overview" %}
{% import "entity_macros.html" as entity_macros %}
-{% extends "base.html" %}
+{% extends "entity_base.html" %}
-{% block fullbody %}
+{% block entity_main %}
<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="fifteen wide column">
- <h1 class="ui header">
- <span class="sub header"><code>work {{ work.ident }}</code></span></h1>
-</div>
-</div>
-
-<div class="ui stackable mobile reversed grid centered">
-<div class="one wide column"></div>
-<div class="ten wide column" style="font-size: 16px;">
-
-{% if entity.extra != None %}
- <h3>Extra Metadata (raw JSON)</h3>
- {{ entity_macros.extra_metadata(entity.extra) }}
-{% endif %}
+<div class="column" style="font-size: 16px; flex: 1;">
<h3>Releases</h3>
{% if work._releases != [] and work._releases != None %}
@@ -39,8 +26,7 @@ pre-print and a published article may contain small differences, but still
reference the same underlying "work".
</div>
-
-<div class="five wide column">
+<div class="column" style="flex: 0 0 24em;">
{{ entity_macros.fatcat_bits(entity, "work", "", editgroup) }}