aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-06-12 19:36:10 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-06-12 19:38:00 -0700
commitef7fafdcb664f9c419069b41d743f69382571f98 (patch)
tree37e0f8ab5e59c5c91a05036a49c40630565aaee0 /python/fatcat_web/templates
parent13f2faaeb3f01478eba32ba22972a2a8ec07df51 (diff)
downloadfatcat-ef7fafdcb664f9c419069b41d743f69382571f98.tar.gz
fatcat-ef7fafdcb664f9c419069b41d743f69382571f98.zip
continue large refactors of entity views
- container views generic - editgroup edit deletion and re-editing - /editgroup/entity/ident views
Diffstat (limited to 'python/fatcat_web/templates')
-rw-r--r--python/fatcat_web/templates/container_edit.html4
-rw-r--r--python/fatcat_web/templates/container_view.html2
-rw-r--r--python/fatcat_web/templates/edit_macros.html8
-rw-r--r--python/fatcat_web/templates/editgroup_view.html24
-rw-r--r--python/fatcat_web/templates/entity_macros.html17
5 files changed, 37 insertions, 18 deletions
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 @@
<div class="ui segment">
<h1 class="ui header">Edit Container Entity</h1>
-<form class="ui form" id="edit_container_form" method="POST" action="/container/{{ entity.ident }}/edit">
+<form class="ui form" id="edit_container_form" method="POST" action="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/container/{{ existing_ident }}/edit">
{% endblock %}
{{ form.hidden_tag() }}
<br>
- {{ edit_macros.editgroup_dropdown(form) }}
+ {{ edit_macros.editgroup_dropdown(form, editgroup) }}
<h3 class="ui dividing header">The Basics</h3>
<br>
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 %}
</div>
-{{ entity_macros.fatcat_bits(entity, "container", "") }}
+{{ entity_macros.fatcat_bits(entity, "container", "", editgroup) }}
</div>
</div>
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 @@
</div>
{%- endmacro %}
-{% macro editgroup_dropdown(form) -%}
+{% macro editgroup_dropdown(form, editgroup=None) -%}
<div class="ui accordion">
- <div class="{% if not editgroup_id %}active{% endif %} title">
+ <div class="{% if not editgroup %}active{% endif %} title">
<h3><i class="dropdown icon"></i>Editgroup Meta</h3>
</div>
- <div class="{% if not editgroup_id %}active{% endif %} content">
- {% if editgroup_id %}
+ <div class="{% if not editgroup %}active{% endif %} content">
+ {% if editgroup %}
<p>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) -%}
<div class="{% if edits %}active{% endif %} title">
<h3><i class="dropdown icon"></i>{{ entity_name }} Edits ({{ edits|count }})</h3>
</div><div class="{% if edits %}active{% endif %} content" style="padding-bottom: 0.5em;">
@@ -22,6 +22,14 @@
{% else %}
updated
{% endif %}
+ <a href="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/{{ edit.ident }}">[view edit]</a>
+ {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %}
+ <a href="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/{{ edit.ident }}/edit" style="color: green;">[re-edit]</a>
+ <form id="submit_edit_delete" method="POST" action="/editgroup/{{ editgroup.editgroup_id }}/{{ entity_type }}/edit/{{ edit.edit_id }}/delete" style="display:inline;">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
+ <input type="submit" value="[delete-edit]" style="background:none; color: red; border: none; padding:9;font-weight:bold;cursor:pointer;"></input>
+ </form>
+ {% endif %}
</div>
{% if edit.revision %}
Revision: <small><code>{{ edit.revision }}</code></small>
@@ -99,13 +107,13 @@ reviewable bundle.
<br><br clear="all">
<div class="ui styled fluid accordion">
- {{ 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") }}
</div>
<br>
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 %}
+<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>
+{% 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.
+</div>
+{% elif entity.state == "wip" %}
<div class="ui segment pink inverted attached">
<b>Work In Progress</b>
<p>This entity has not been "accepted" into the official database yet.
@@ -19,7 +30,7 @@
</div>
<div class="two ui buttons bottom attached">
- <a href="/{{ entity_type }}/{{ entity.ident }}/edit" class="ui blue button">Edit Metadata</a>
+ <a href="{% if editgroup %}/editgroup/{{ editgroup.editgroup_id }}{% endif %}/{{ entity_type }}/{{ entity.ident }}/edit" class="ui blue button">Edit Metadata</a>
<a href="/{{ entity_type }}/{{ entity.ident }}/history" class="ui button">View History</a>
</div>
{%- endmacro %}