From 7e328f5554826b721ef342455d8d7ca686e19aa3 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 23 Jun 2024 14:37:15 +0200 Subject: [PATCH] feat: format html templates and update VS Code settings Formatted multiple HTML templates in the project for better readability and maintainability. Introduced indentation, adjusted spacing, and improved overall structure without altering the business logic or functionality. Added VS Code settings to associate HTML files with Jinja syntax highlighting to enhance the development experience. No functional changes introduced, focused solely on code readability and development efficiency improvements. --- .vscode/settings.json | 5 + .../templates/accounts/email_sent.html | 13 +- .../templates/accounts/send_login_email.html | 32 +-- freedoi/resolver/templates/resolver/home.html | 197 ++++++++++-------- .../resolver/identifier_confirm_delete.html | 30 ++- .../templates/resolver/identifier_detail.html | 53 ++--- .../templates/resolver/identifier_form.html | 51 +++-- .../templates/resolver/identifier_list.html | 44 ++-- .../resolver/pending_suffixes_list.html | 3 + .../resolver/prefix_confirm_delete.html | 19 +- .../templates/resolver/prefix_detail.html | 41 ++-- .../templates/resolver/prefix_form.html | 39 ++-- .../templates/resolver/prefix_list.html | 29 ++- .../resolver/suffix_approval_form.html | 28 +-- .../resolver/suffix_confirm_delete.html | 25 ++- .../templates/resolver/suffix_detail.html | 69 +++--- .../templates/resolver/suffix_form.html | 60 ++++-- .../templates/resolver/suffix_list.html | 37 ++-- 18 files changed, 439 insertions(+), 336 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..85b4294 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.html": "jinja-html" + } +} \ No newline at end of file diff --git a/freedoi/accounts/templates/accounts/email_sent.html b/freedoi/accounts/templates/accounts/email_sent.html index a77bff6..d36aef5 100644 --- a/freedoi/accounts/templates/accounts/email_sent.html +++ b/freedoi/accounts/templates/accounts/email_sent.html @@ -1,9 +1,8 @@ -{% extends "base_generic.html" %} {% block title %}Email Sent{% endblock %} +{% extends "base_generic.html" %} +{% block title %}Email Sent{% endblock %} {% block content %} -
-

Email Sent

-

- A login link has been sent to your email address. Please check your inbox. -

-
+
+

Email Sent

+

A login link has been sent to your email address. Please check your inbox.

+
{% endblock %} diff --git a/freedoi/accounts/templates/accounts/send_login_email.html b/freedoi/accounts/templates/accounts/send_login_email.html index f749826..dda5d65 100644 --- a/freedoi/accounts/templates/accounts/send_login_email.html +++ b/freedoi/accounts/templates/accounts/send_login_email.html @@ -1,14 +1,20 @@ -{% extends "base_generic.html" %} {% block title %}Email Login{% endblock %} -{% block content %}{% load crispy_forms_tags %} -
-

Login

-

Please login to access FreeDOI. If you don't have an - account yet, one will be created for you.

-
- {% csrf_token %} {{ form | crispy }} -

We will send you an email with a link to login. - By submitting this form, you agree to our Privacy Policy.

- -
-
+{% extends "base_generic.html" %} +{% block title %}Email Login{% endblock %} +{% block content %} + {% load crispy_forms_tags %} +
+

Login

+

+ Please login to access FreeDOI. If you don't have an + account yet, one will be created for you. +

+
+ {% csrf_token %} {{ form | crispy }} +

+ We will send you an email with a link to login. + By submitting this form, you agree to our Privacy Policy. +

+ +
+
{% endblock %} diff --git a/freedoi/resolver/templates/resolver/home.html b/freedoi/resolver/templates/resolver/home.html index 89f01c4..e01ad4a 100644 --- a/freedoi/resolver/templates/resolver/home.html +++ b/freedoi/resolver/templates/resolver/home.html @@ -1,93 +1,106 @@ {% extends "base_generic.html" %} -{% block title %}Welcome to FreeDOI{% endblock%} {% block content %} -
-

Welcome to FreeDOI

-

- FreeDOI is a system for managing and resolving Digital Object Identifiers - (DOIs) for various fields such as open source software, literature, personal - use, and more. Our system is designed to be flexible, user-friendly, and - free to use. -

-
-

- Our goal is to provide a free, flexible system for assigning and resolving - identifiers for digital content, similar to the official DOI system. -

- -
- -
-

What is FreeDOI?

-

- FreeDOI is an alternative DOI system that allows users to create and manage - DOIs for various types of digital content. Our system uses a range of - prefixes (20. to 29.) to categorize different fields, such as: -

- -

- FreeDOI also supports resolving official DOI prefixes (10.) to access - content from the official DOI system. -

- -

How Does It Work?

-

- FreeDOI provides a simple and intuitive interface for creating and managing - DOIs. Here's how you can get started: -

-
    -
  1. - Register: Create an account to start managing DOIs. -
  2. -
  3. - Create Suffixes: Define suffixes for your organization or - project. -
  4. -
  5. - Assign DOIs: Create and manage DOIs for your digital - content. -
  6. -
  7. - Resolve DOIs: Use our resolver to access the content - associated with any DOI. -
  8. -
- -

Get Started

- {% if user.is_authenticated %} -

- Welcome back, {{ user.email }}! Use the navigation links above to - manage your suffixes, and identifiers. -

- Manage Suffixes - {% else %} -

- Ready to get started? Create an account or log in to begin managing your - DOIs. -

- Login or Sign Up - {% endif %} -
- -
-

Contact Us

-

- If you have any questions or need assistance, feel free to reach out to our - support team at - support@freedoi.org. -

-
-{% endblock %} +{% block title %}Welcome to FreeDOI{% endblock title %} + {% block content %} +
+

Welcome to FreeDOI

+

+ FreeDOI is a system for managing and resolving Digital Object Identifiers + (DOIs) for various fields such as open source software, literature, personal + use, and more. Our system is designed to be flexible, user-friendly, and + free to use. +

+
+

+ Our goal is to provide a free, flexible system for assigning and resolving + identifiers for digital content, similar to the official DOI system. +

+ +
+
+

What is FreeDOI?

+

+ FreeDOI is an alternative DOI system that allows users to create and manage + DOIs for various types of digital content. Our system uses a range of + prefixes (20. to 29.) to categorize different fields, such as: +

+ +

+ FreeDOI also supports resolving official DOI prefixes (10.) to access + content from the official DOI system. +

+

How Does It Work?

+

+ FreeDOI provides a simple and intuitive interface for creating and managing + DOIs. Here's how you can get started: +

+
    +
  1. + Register: Create an account to start managing DOIs. +
  2. +
  3. + Request Suffixes: Get suffixes for your organization or + project. +
  4. +
  5. + Assign DOIs: Create and manage DOIs for your digital + content. +
  6. +
  7. + Resolve DOIs: Use our resolver to access the content + associated with any DOI. +
  8. +
+

Get Started

+ {% if user.is_authenticated %} +

+ Welcome back, {{ user.email }}! Use the navigation links above to + manage your suffixes, and identifiers. +

+ Manage Suffixes + {% else %} +

+ Ready to get started? Create an account or log in to begin managing your + DOIs. +

+ Login or Sign Up + {% endif %} +
+
+

Contact Us

+

+ If you have any questions or need assistance, feel free to reach out to our + support team at + support@freedoi.org. +

+
+ {% endblock content %} diff --git a/freedoi/resolver/templates/resolver/identifier_confirm_delete.html b/freedoi/resolver/templates/resolver/identifier_confirm_delete.html index 2407cd4..fd1ea12 100644 --- a/freedoi/resolver/templates/resolver/identifier_confirm_delete.html +++ b/freedoi/resolver/templates/resolver/identifier_confirm_delete.html @@ -1,16 +1,14 @@ -{% extends "base_generic.html" %} {% block title %}Delete Identifier -{% endblock %} {% block content %} -
-

Delete Identifier

-

Are you sure you want to delete "{{ object.identifier }}"?

-
- {% csrf_token %} - -
- Back to identifiers -
-{% endblock %} +{% extends "base_generic.html" %} +{% block title %}Delete Identifier{% endblock title %} +{% block content %} +
+

Delete Identifier

+

Are you sure you want to delete "{{ object.identifier }}"?

+
+ {% csrf_token %} + +
+ Back to identifiers +
+{% endblock content %} diff --git a/freedoi/resolver/templates/resolver/identifier_detail.html b/freedoi/resolver/templates/resolver/identifier_detail.html index 9028ca8..fac8c36 100644 --- a/freedoi/resolver/templates/resolver/identifier_detail.html +++ b/freedoi/resolver/templates/resolver/identifier_detail.html @@ -1,26 +1,27 @@ -{% extends "base_generic.html" %} {% block title %}Identifier Detail -{% endblock %} {% block content %} -
-

{{ object.identifier }}

-

Suffix: {{ object.suffix }}

-

Target URL: {{ object.target_url }}

- Edit -
- {% csrf_token %} - -
- Back to identifiers -
-{% endblock %} +{% extends "base_generic.html" %} +{% block title %} + Identifier Detail +{% endblock title %} +{% block content %} +
+

{{ object.suffix.prefix.prefix }}.{{ object.suffix.suffix }}/{{ object.identifier }}

+

+ Prefix: {{ object.suffix.prefix.prefix }} ({{ object.suffix.prefix.name }}) +

+ Suffix: {{ object.suffix.suffix }} ({{ object.suffix.name }}) +

+

+ Target URL: {{ object.target_url }} +

+ Edit +
+ {% csrf_token %} + +
+ Back to identifiers +
+ {% endblock content %} diff --git a/freedoi/resolver/templates/resolver/identifier_form.html b/freedoi/resolver/templates/resolver/identifier_form.html index 562b314..b3a5ce7 100644 --- a/freedoi/resolver/templates/resolver/identifier_form.html +++ b/freedoi/resolver/templates/resolver/identifier_form.html @@ -1,21 +1,30 @@ -{% extends "base_generic.html" %} {% block title %} - {% if form.instance.pk %}Edit{% else %}Create{% endif %} Identifier -{% endblock %} {% load crispy_forms_tags %} {% block content %} -
-

{% if form.instance.pk %}Edit{% else %}Create{% endif %} Identifier

-
- {% if form.errors %} - - {% endif %} - {% csrf_token %} {{ form | crispy }} - -
- Back to identifiers -
-{% endblock %} +{% extends "base_generic.html" %} +{% load crispy_forms_tags %} +{% block title %} + {% if form.instance.pk %} + Edit + {% else %} + Create + {% endif %} + Identifier +{% endblock title %} +{% block content %} +
+

+ {% if form.instance.pk %} + Edit + {% else %} + Create + {% endif %} + Identifier +

+
+ {% if form.errors %}{% endif %} + {% csrf_token %} + {{ form | crispy }} + +
+ Back to identifiers +
+{% endblock content %} diff --git a/freedoi/resolver/templates/resolver/identifier_list.html b/freedoi/resolver/templates/resolver/identifier_list.html index 97e4b9e..cca777e 100644 --- a/freedoi/resolver/templates/resolver/identifier_list.html +++ b/freedoi/resolver/templates/resolver/identifier_list.html @@ -1,24 +1,22 @@ -{% extends "base_generic.html" %} {% block title %}Identifiers{% endblock %} +{% extends "base_generic.html" %} +{% block title %} + Identifiers +{% endblock title %} {% block content %} -
-

Identifiers{% if suffix %} for {{ suffix.name }}{% endif %}

- - Create new identifier - Back to suffixes -
-{% endblock %} +
+

+ Identifiers + {% if suffix %}for {{ suffix.name }}{% endif %} +

+ + Create new identifier + Back to suffixes +
+{% endblock content %} diff --git a/freedoi/resolver/templates/resolver/pending_suffixes_list.html b/freedoi/resolver/templates/resolver/pending_suffixes_list.html index 745f421..3fea395 100644 --- a/freedoi/resolver/templates/resolver/pending_suffixes_list.html +++ b/freedoi/resolver/templates/resolver/pending_suffixes_list.html @@ -3,6 +3,9 @@

Pending Suffixes