From ef7fafdcb664f9c419069b41d743f69382571f98 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 12 Jun 2019 19:36:10 -0700 Subject: continue large refactors of entity views - container views generic - editgroup edit deletion and re-editing - /editgroup/entity/ident views --- python/fatcat_web/templates/container_edit.html | 4 ++-- python/fatcat_web/templates/container_view.html | 2 +- python/fatcat_web/templates/edit_macros.html | 8 ++++---- python/fatcat_web/templates/editgroup_view.html | 24 ++++++++++++++++-------- python/fatcat_web/templates/entity_macros.html | 17 ++++++++++++++--- 5 files changed, 37 insertions(+), 18 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_edit.html b/python/fatcat_web/templates/container_edit.html index 553bedb6..6a08b1ae 100644 --- a/python/fatcat_web/templates/container_edit.html +++ b/python/fatcat_web/templates/container_edit.html @@ -6,12 +6,12 @@

Edit Container Entity

-
+ {% endblock %} {{ form.hidden_tag() }}
- {{ edit_macros.editgroup_dropdown(form) }} + {{ edit_macros.editgroup_dropdown(form, editgroup) }}

The Basics


diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index 619bd647..ef4335fb 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -124,7 +124,7 @@ {% endif %}
-{{ entity_macros.fatcat_bits(entity, "container", "") }} +{{ entity_macros.fatcat_bits(entity, "container", "", editgroup) }} diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index 9bd14596..66da04e7 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -35,13 +35,13 @@ {%- endmacro %} -{% macro editgroup_dropdown(form) -%} +{% macro editgroup_dropdown(form, editgroup=None) -%}
-
+

Editgroup Meta

-
- {% if editgroup_id %} +
+ {% if editgroup %}

You have an editgroup in progress, and this edit will be included by default. You can override this below. {% else %} diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index 8b454bb2..52b55d43 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -3,7 +3,7 @@ {% block body %} -{% macro edit_list(edits, entity_type, entity_name) -%} +{% macro edit_list(auth_to, editgroup, edits, entity_type, entity_name) -%}

{{ entity_name }} Edits ({{ edits|count }})

@@ -22,6 +22,14 @@ {% else %} updated {% endif %} + [view edit] + {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %} + [re-edit] + + + + + {% endif %}
{% if edit.revision %} Revision: {{ edit.revision }} @@ -99,13 +107,13 @@ reviewable bundle.

- {{ edit_list(editgroup.edits.releases, "release", "Release") }} - {{ edit_list(editgroup.edits.works, "work", "Work") }} - {{ edit_list(editgroup.edits.containers, "container", "Container") }} - {{ edit_list(editgroup.edits.creators, "creator", "Creator") }} - {{ edit_list(editgroup.edits.files, "file", "File") }} - {{ edit_list(editgroup.edits.filesets, "fileset", "File Set") }} - {{ edit_list(editgroup.edits.webcaptures, "webcapture", "Web Capture") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.releases, "release", "Release") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.works, "work", "Work") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.containers, "container", "Container") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.creators, "creator", "Creator") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.files, "file", "File") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.filesets, "fileset", "File Set") }} + {{ edit_list(auth_to, editgroup, editgroup.edits.webcaptures, "webcapture", "Web Capture") }}

diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index a2b2f996..77d4ff81 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -1,7 +1,18 @@ -{% macro fatcat_bits(entity, entity_type, expand="") -%} +{% macro fatcat_bits(entity, entity_type, expand="", editgroup=None) -%} -{% if entity.state == "wip" %} +{% if entity.state == None and editgroup.editgroup_id %} +
+ Edit In Progress +

You are viewing this entity as of a specific editgroup (which may or may not have been merged yet): + {{ editgroup.editgroup_id }} +

+{% elif entity.state == None and entity.ident == None %} +
+ Revision +

You are viewing a specific revision of an entity. +

+{% elif entity.state == "wip" %}
Work In Progress

This entity has not been "accepted" into the official database yet. @@ -19,7 +30,7 @@

{%- endmacro %} -- cgit v1.2.3