diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-02 17:48:51 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-03-02 17:48:51 -0800 |
commit | 464048c7cdfa861fe8b4c78000526413a7e2e145 (patch) | |
tree | 286b209a24d15e77acbbe50d77b1085725b68bdd /python | |
parent | a9046843fb3105e9db826dd0fbb2dc58d9b671f4 (diff) | |
download | fatcat-464048c7cdfa861fe8b4c78000526413a7e2e145.tar.gz fatcat-464048c7cdfa861fe8b4c78000526413a7e2e145.zip |
improve/fix deleted entity view
Diffstat (limited to 'python')
-rw-r--r-- | python/fatcat_web/routes.py | 14 | ||||
-rw-r--r-- | python/fatcat_web/templates/deleted_entity.html | 15 | ||||
-rw-r--r-- | python/fatcat_web/templates/entity_macros.html | 7 |
3 files changed, 15 insertions, 21 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 59f7d1db..2a8e8fa3 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -100,7 +100,7 @@ def container_view(ident): if entity.state == "redirect": return redirect('/container/{}'.format(entity.redirect)) if entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="container") if entity.state == "active": entity.es = container_to_elasticsearch(entity, force_bool=False) return render_template('container_view.html', @@ -161,7 +161,7 @@ def creator_view(ident): if entity.state == "redirect": return redirect('/creator/{}'.format(entity.redirect)) if entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="creator") return render_template('creator_view.html', creator=entity, releases=releases) @app.route('/file/<ident>/history', methods=['GET']) @@ -208,7 +208,7 @@ def file_view(ident): if entity.state == "redirect": return redirect('/file/{}'.format(entity.redirect)) elif entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="file") else: try: entity.releases = [] @@ -252,7 +252,7 @@ def fileset_view(ident): if entity.state == "redirect": return redirect('/fileset/{}'.format(entity.redirect)) elif entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="fileset") else: try: entity.releases = [] @@ -297,7 +297,7 @@ def webcapture_view(ident): if entity.state == "redirect": return redirect('/webcapture/{}'.format(entity.redirect)) elif entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="webcapture") else: try: entity.releases = [] @@ -370,7 +370,7 @@ def release_view(ident): if entity.state == "redirect": return redirect('/release/{}'.format(entity.redirect)) if entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="release") if entity.container and entity.container.state == "active": entity.container.es = container_to_elasticsearch(entity.container, force_bool=False) if entity.state == "active": @@ -418,7 +418,7 @@ def work_view(ident): if entity.state == "redirect": return redirect('/work/{}'.format(entity.redirect)) if entity.state == "deleted": - return render_template('deleted_entity.html', entity=entity) + return render_template('deleted_entity.html', entity=entity, entity_type="work") return render_template('work_view.html', work=entity, releases=releases) @app.route('/editgroup/<ident>', methods=['GET']) diff --git a/python/fatcat_web/templates/deleted_entity.html b/python/fatcat_web/templates/deleted_entity.html index af25da54..a19910e7 100644 --- a/python/fatcat_web/templates/deleted_entity.html +++ b/python/fatcat_web/templates/deleted_entity.html @@ -23,20 +23,11 @@ <div class="five wide column"> <div class="ui segment top attached"> -<b>Entity Type:</b> {{ entity_type }} -</div><div class="ui segment attached"> - -<b>Fatcat Bits</b> -<p>State is "{{ entity.state }}". Revision: -<br><small><code>{{ entity.revision }}</code></small> -<br><a href="https://api.{{ config.FATCAT_DOMAIN }}/v0/{{ entity_type }}/{{ entity.ident }}">As JSON object via API</a> - -</div> -<div class="two ui buttons bottom attached"> - <a href="/entity/{{ entity.ident }}/edit" class="ui blue button">Edit Metadata</a> - <a href="/entity/{{ entity.ident }}/history" class="ui button">View History</a> +<b>Entity Type:</b> <code>{{ entity_type }}</code> </div> +{{ entity_macros.fatcat_bits(entity, entity_type, "") }} + </div> </div> diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 2a4752f2..0fa93679 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -2,8 +2,11 @@ {% macro fatcat_bits(entity, entity_type, expand="") -%} <div class="ui segment attached"> <b>Fatcat Bits</b> - <p>State is "{{ entity.state }}". Revision: - <br><small><code>{{ entity.revision }}</code></small> + <p>State is "{{ entity.state }}". + {% if entity.state != "deleted" %} + Revision: + <br><small><code>{{ entity.revision }}</code></small> + {% endif %} <br><a href="https://api.{{ config.FATCAT_DOMAIN }}/v0/release/{{ entity.ident }}{% if expand %}?expand={{ expand}}{% endif %}">As JSON object via API</a> </div> |