From 4a08a4ef405e451db0a8251c05a193874b64cddb Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 1 Apr 2019 22:09:48 -0700 Subject: basic release editing --- python/fatcat_web/templates/edit_macros.html | 36 ++++ python/fatcat_web/templates/release_create.html | 254 +----------------------- python/fatcat_web/templates/release_edit.html | 231 +++++++++++++++++++++ 3 files changed, 272 insertions(+), 249 deletions(-) create mode 100644 python/fatcat_web/templates/edit_macros.html create mode 100644 python/fatcat_web/templates/release_edit.html (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html new file mode 100644 index 00000000..ad563066 --- /dev/null +++ b/python/fatcat_web/templates/edit_macros.html @@ -0,0 +1,36 @@ + +{% macro form_field_errors(field) -%} + {% if field.errors %} +
+ {% for err in field.errors %} + {{ err }} + {% endfor %} +
+ {% endif %} +{%- endmacro %} + +{% macro form_field_basic(field, div_classes="") -%} +
+ {{ field.label }} + {{ field() }} + {{ form_field_errors(field) }} +
+{%- endmacro %} + +{% macro form_field_inline(field, div_classes="") -%} +
+
+
+ {{ field.label }} +
+
+
+
+ {{ field() }} + {{ form_field_errors(field) }} +
+
+
+
+
+{%- endmacro %} diff --git a/python/fatcat_web/templates/release_create.html b/python/fatcat_web/templates/release_create.html index 7ede5dfd..5ea3470d 100644 --- a/python/fatcat_web/templates/release_create.html +++ b/python/fatcat_web/templates/release_create.html @@ -1,260 +1,16 @@ -{% extends "base.html" %} +{% extends "release_edit.html" %} -{% macro form_field_errors(field) -%} - {% if field.errors %} -
- {% for err in field.errors %} - {{ err }} - {% endfor %} -
- {% endif %} -{%- endmacro %} - -{% macro form_field_basic(field, div_classes="") -%} -
- {{ field.label }} - {{ field() }} - {{ form_field_errors(field) }} -
-{%- endmacro %} - -{% macro form_field_inline(field, div_classes="") -%} -
-
-
- {{ field.label }} -
-
-
-
- {{ field() }} - {{ form_field_errors(field) }} -
-
-
-
-
-{%- endmacro %} - -{% block body %} +{% block edit_form_prefix %}

Create New Release Entity

+
+{% endblock %} - - {{ form.hidden_tag() }} - -
-
-
-

Editgroup Meta

-
-
- {% if editgroup_id %} -

You have an editgroup in progress, and this edit will be included by - default. You can override this below. - {% else %} -

No existing editgroup is in progress (or at least, not is selected). - An existing ID can be pasted in, or if you leave that blank but give a - description, a new editgroup will be created for this edit. - {% endif %} - {{ form_field_inline(form.editgroup_id) }} - {{ form_field_inline(form.editgroup_description) }} -

-
- -
-

The Basics

-
-
-
-
- {{ form_field_basic(form.release_type, "required") }} - {{ form_field_basic(form.release_status) }} -
-
-
-
- - {{ form_field_inline(form.title, "required") }} - {{ form_field_inline(form.original_title) }} - {{ form_field_inline(form.work_id) }} - {{ form_field_inline(form.release_date) }} -
-
-
-
- {{ form_field_basic(form.language) }} - {{ form_field_basic(form.license_slug) }} -
-
-
-
- -
-

Contributors

-
- {% for cform in form.contribs %} -
-
- -
-
-
- {{ cform.role }} -
-
-
-
- {{ cform.raw_name}} -
-
-
- -
-
- {% endfor %} -
-
- -
- -
-

Identifers

-
- {{ form_field_inline(form.doi) }} - {{ form_field_inline(form.wikidata_qid) }} - {{ form_field_inline(form.isbn13) }} -
-
-
-
- {{ form_field_basic(form.pmid) }} - {{ form_field_basic(form.pmcid) }} -
-
-
-
- -
-

Container

-
- {{ form_field_inline(form.container_id) }} - {{ form_field_inline(form.publisher) }} -
-
-
-
-
- {{ form_field_basic(form.pages) }} - {{ form_field_basic(form.volume) }} - {{ form_field_basic(form.issue) }} -
-
-
-
- -

-

Submit

- {{ form_field_basic(form.edit_description) }} - This description will be attached to this specific action, not to the - editgroup as a whole. +{% block edit_form_suffix %}

-
-
{% endblock %} -{% block postscript %} - - -{% endblock %} diff --git a/python/fatcat_web/templates/release_edit.html b/python/fatcat_web/templates/release_edit.html new file mode 100644 index 00000000..867ae665 --- /dev/null +++ b/python/fatcat_web/templates/release_edit.html @@ -0,0 +1,231 @@ +{% import "edit_macros.html" as edit_macros %} +{% extends "base.html" %} + +{% block body %} +{% block edit_form_prefix %} +
+

Edit Release Entity

+ +
+{% endblock %} + {{ form.hidden_tag() }} + +
+
+
+

Editgroup Meta

+
+
+ {% if editgroup_id %} +

You have an editgroup in progress, and this edit will be included by + default. You can override this below. + {% else %} +

No existing editgroup is in progress (or at least, not is selected). + An existing ID can be pasted in, or if you leave that blank but give a + description, a new editgroup will be created for this edit. + {% endif %} + {{ edit_macros.form_field_inline(form.editgroup_id) }} + {{ edit_macros.form_field_inline(form.editgroup_description) }} +

+
+ +
+

The Basics

+
+
+
+
+ {{ edit_macros.form_field_basic(form.release_type, "required") }} + {{ edit_macros.form_field_basic(form.release_status) }} +
+
+
+
+ + {{ edit_macros.form_field_inline(form.title, "required") }} + {{ edit_macros.form_field_inline(form.original_title) }} + {{ edit_macros.form_field_inline(form.work_id) }} + {{ edit_macros.form_field_inline(form.release_date) }} +
+
+
+
+ {{ edit_macros.form_field_basic(form.language) }} + {{ edit_macros.form_field_basic(form.license_slug) }} +
+
+
+
+ +
+

Contributors

+
+ {% for cform in form.contribs %} +
+ {{ cform.hidden_tag() }} +
+ +
+
+
+ {{ cform.role() }} +
+
+
+
+ {{ cform.raw_name() }} +
+
+
+ +
+
+ {% endfor %} +
+
+ +
+ +
+

Identifers

+
+ {{ edit_macros.form_field_inline(form.doi) }} + {{ edit_macros.form_field_inline(form.wikidata_qid) }} + {{ edit_macros.form_field_inline(form.isbn13) }} +
+
+
+
+ {{ edit_macros.form_field_basic(form.pmid) }} + {{ edit_macros.form_field_basic(form.pmcid) }} +
+
+
+
+ +
+

Container

+
+ {{ edit_macros.form_field_inline(form.container_id) }} + {{ edit_macros.form_field_inline(form.publisher) }} +
+
+
+
+
+ {{ edit_macros.form_field_basic(form.pages) }} + {{ edit_macros.form_field_basic(form.volume) }} + {{ edit_macros.form_field_basic(form.issue) }} +
+
+
+
+ +

+

Submit

+ {{ edit_macros.form_field_basic(form.edit_description) }} + This description will be attached to this specific action, not to the + editgroup as a whole. +{% block edit_form_suffix %} +

+ +
+
+{% endblock %} +{% endblock %} + +{% block postscript %} + + +{% endblock %} -- cgit v1.2.3