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.
This commit is contained in:
Kumi 2024-06-23 14:37:15 +02:00
parent 1ba8f68a0e
commit 7e328f5554
Signed by: kumi
GPG key ID: ECBCC9082395383F
18 changed files with 439 additions and 336 deletions

5
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,5 @@
{
"files.associations": {
"*.html": "jinja-html"
}
}

View file

@ -1,9 +1,8 @@
{% extends "base_generic.html" %} {% block title %}Email Sent{% endblock %} {% extends "base_generic.html" %}
{% block title %}Email Sent{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h2>Email Sent</h2> <h2>Email Sent</h2>
<p> <p>A login link has been sent to your email address. Please check your inbox.</p>
A login link has been sent to your email address. Please check your inbox. </div>
</p>
</div>
{% endblock %} {% endblock %}

View file

@ -1,14 +1,20 @@
{% extends "base_generic.html" %} {% block title %}Email Login{% endblock %} {% extends "base_generic.html" %}
{% block content %}{% load crispy_forms_tags %} {% block title %}Email Login{% endblock %}
<div class="container"> {% block content %}
<h2>Login</h2> {% load crispy_forms_tags %}
<p class="text-muted">Please login to access FreeDOI. If you don't have an <div class="container">
account yet, one will be created for you.</p> <h2>Login</h2>
<form method="post"> <p class="text-muted">
{% csrf_token %} {{ form | crispy }} Please login to access FreeDOI. If you don't have an
<p class="text-muted">We will send you an email with a link to login. account yet, one will be created for you.
By submitting this form, you agree to our Privacy Policy.</p> </p>
<button type="submit" class="btn btn-primary">Send Login Link</button> <form method="post">
</form> {% csrf_token %} {{ form | crispy }}
</div> <p class="text-muted">
We will send you an email with a link to login.
By submitting this form, you agree to our Privacy Policy.
</p>
<button type="submit" class="btn btn-primary">Send Login Link</button>
</form>
</div>
{% endblock %} {% endblock %}

View file

@ -1,93 +1,106 @@
{% extends "base_generic.html" %} {% extends "base_generic.html" %}
{% block title %}Welcome to FreeDOI{% endblock%} {% block content %} {% block title %}Welcome to FreeDOI{% endblock title %}
<div class="jumbotron text-center"> {% block content %}
<h1 class="display-4">Welcome to FreeDOI</h1> <div class="jumbotron text-center">
<p class="lead"> <h1 class="display-4">Welcome to FreeDOI</h1>
FreeDOI is a system for managing and resolving Digital Object Identifiers <p class="lead">
(DOIs) for various fields such as open source software, literature, personal FreeDOI is a system for managing and resolving Digital Object Identifiers
use, and more. Our system is designed to be flexible, user-friendly, and (DOIs) for various fields such as open source software, literature, personal
free to use. use, and more. Our system is designed to be flexible, user-friendly, and
</p> free to use.
<hr class="my-4" /> </p>
<p> <hr class="my-4" />
Our goal is to provide a free, flexible system for assigning and resolving <p>
identifiers for digital content, similar to the official DOI system. Our goal is to provide a free, flexible system for assigning and resolving
</p> identifiers for digital content, similar to the official DOI system.
<div class="alert alert-warning" role="alert"> </p>
<strong>Important:</strong> FreeDOI is not affiliated with the official DOI <div class="alert alert-warning" role="alert">
system. DOIs created with FreeDOI are not registered with the official DOI <strong>Important:</strong> FreeDOI is not affiliated with the official DOI
system and cannot be resolved using https://doi.org &dash; the other way system. DOIs created with FreeDOI are not registered with the official DOI
around is possible, however. system and cannot be resolved using https://doi.org &dash; the other way
</div> around is possible, however.
</div> </div>
</div>
<div id="learn-more" class="container mt-5"> <div id="learn-more" class="container mt-5">
<h2>What is FreeDOI?</h2> <h2>What is FreeDOI?</h2>
<p> <p>
FreeDOI is an alternative DOI system that allows users to create and manage 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 DOIs for various types of digital content. Our system uses a range of
prefixes (20. to 29.) to categorize different fields, such as: prefixes (20. to 29.) to categorize different fields, such as:
</p> </p>
<ul> <ul>
<li><strong>20.</strong> Science / Research / Education</li> <li>
<li><strong>21.</strong> Computers / IT</li> <strong>20.</strong> Science / Research / Education
<li><strong>22.</strong> Entertainment / Art / Music / Video</li> </li>
<li><strong>23.</strong> Literature</li> <li>
<li><strong>24.</strong> Charity / Non-Profit</li> <strong>21.</strong> Computers / IT
<li><strong>25.</strong> Business</li> </li>
<li><strong>26.</strong> Government</li> <li>
<li><strong>29.</strong> Personal / Other</li> <strong>22.</strong> Entertainment / Art / Music / Video
</ul> </li>
<p> <li>
FreeDOI also supports resolving official DOI prefixes (10.) to access <strong>23.</strong> Literature
content from the official DOI system. </li>
</p> <li>
<strong>24.</strong> Charity / Non-Profit
<h2>How Does It Work?</h2> </li>
<p> <li>
FreeDOI provides a simple and intuitive interface for creating and managing <strong>25.</strong> Business
DOIs. Here's how you can get started: </li>
</p> <li>
<ol> <strong>26.</strong> Government
<li> </li>
<strong>Register:</strong> Create an account to start managing DOIs. <li>
</li> <strong>29.</strong> Personal / Other
<li> </li>
<strong>Create Suffixes:</strong> Define suffixes for your organization or </ul>
project. <p>
</li> FreeDOI also supports resolving official DOI prefixes (10.) to access
<li> content from the official DOI system.
<strong>Assign DOIs:</strong> Create and manage DOIs for your digital </p>
content. <h2>How Does It Work?</h2>
</li> <p>
<li> FreeDOI provides a simple and intuitive interface for creating and managing
<strong>Resolve DOIs:</strong> Use our resolver to access the content DOIs. Here's how you can get started:
associated with any DOI. </p>
</li> <ol>
</ol> <li>
<strong>Register:</strong> Create an account to start managing DOIs.
<h2>Get Started</h2> </li>
{% if user.is_authenticated %} <li>
<p> <strong>Request Suffixes:</strong> Get suffixes for your organization or
Welcome back, {{ user.email }}! Use the navigation links above to project.
manage your suffixes, and identifiers. </li>
</p> <li>
<a class="btn btn-primary" href="{% url 'suffix_list' %}">Manage Suffixes</a> <strong>Assign DOIs:</strong> Create and manage DOIs for your digital
{% else %} content.
<p> </li>
Ready to get started? Create an account or log in to begin managing your <li>
DOIs. <strong>Resolve DOIs:</strong> Use our resolver to access the content
</p> associated with any DOI.
<a class="btn btn-primary" href="{% url 'login' %}">Login or Sign Up</a> </li>
{% endif %} </ol>
</div> <h2>Get Started</h2>
{% if user.is_authenticated %}
<div class="container mt-5"> <p>
<h2>Contact Us</h2> Welcome back, {{ user.email }}! Use the navigation links above to
<p> manage your suffixes, and identifiers.
If you have any questions or need assistance, feel free to reach out to our </p>
support team at <a class="btn btn-primary" href="{% url 'suffix_list' %}">Manage Suffixes</a>
<a href="mailto:support@freedoi.org">support@freedoi.org</a>. {% else %}
</p> <p>
</div> Ready to get started? Create an account or log in to begin managing your
{% endblock %} DOIs.
</p>
<a class="btn btn-primary" href="{% url 'login' %}">Login or Sign Up</a>
{% endif %}
</div>
<div class="container mt-5">
<h2>Contact Us</h2>
<p>
If you have any questions or need assistance, feel free to reach out to our
support team at
<a href="mailto:support@freedoi.org">support@freedoi.org</a>.
</p>
</div>
{% endblock content %}

View file

@ -1,16 +1,14 @@
{% extends "base_generic.html" %} {% block title %}Delete Identifier {% extends "base_generic.html" %}
{% endblock %} {% block content %} {% block title %}Delete Identifier{% endblock title %}
<div class="container mt-5"> {% block content %}
<h1>Delete Identifier</h1> <div class="container mt-5">
<p>Are you sure you want to delete "{{ object.identifier }}"?</p> <h1>Delete Identifier</h1>
<form method="post"> <p>Are you sure you want to delete "{{ object.identifier }}"?</p>
{% csrf_token %} <form method="post">
<button type="submit" class="btn btn-danger">Delete</button> {% csrf_token %}
</form> <button type="submit" class="btn btn-danger">Delete</button>
<a </form>
class="btn btn-link mt-3" <a class="btn btn-link mt-3"
href="{% url 'identifier_list' suffix_pk=object.suffix.pk %}" href="{% url 'identifier_list' suffix_pk=object.suffix.pk %}">Back to identifiers</a>
>Back to identifiers</a </div>
> {% endblock content %}
</div>
{% endblock %}

View file

@ -1,26 +1,27 @@
{% extends "base_generic.html" %} {% block title %}Identifier Detail {% extends "base_generic.html" %}
{% endblock %} {% block content %} {% block title %}
<div class="container mt-5"> Identifier Detail
<h1>{{ object.identifier }}</h1> {% endblock title %}
<p><strong>Suffix:</strong> {{ object.suffix }}</p> {% block content %}
<p><strong>Target URL:</strong> {{ object.target_url }}</p> <div class="container mt-5">
<a <h1>{{ object.suffix.prefix.prefix }}.{{ object.suffix.suffix }}/{{ object.identifier }}</h1>
class="btn btn-secondary" <p>
href="{% url 'identifier_update' suffix_pk=object.suffix.pk pk=object.pk %}" <strong>Prefix:</strong> {{ object.suffix.prefix.prefix }} ({{ object.suffix.prefix.name }})
>Edit</a <p>
> <strong>Suffix:</strong> {{ object.suffix.suffix }} ({{ object.suffix.name }})
<form </p>
method="post" <p>
action="{% url 'identifier_delete' suffix_pk=object.suffix.pk pk=object.pk %}" <strong>Target URL:</strong> {{ object.target_url }}
style="display: inline" </p>
> <a class="btn btn-secondary"
{% csrf_token %} href="{% url 'identifier_update' suffix_pk=object.suffix.pk pk=object.pk %}">Edit</a>
<input class="btn btn-danger" type="submit" value="Delete" /> <form method="post"
</form> action="{% url 'identifier_delete' suffix_pk=object.suffix.pk pk=object.pk %}"
<a style="display: inline">
class="btn btn-link" {% csrf_token %}
href="{% url 'identifier_list' suffix_pk=object.suffix.pk %}" <input class="btn btn-danger" type="submit" value="Delete" />
>Back to identifiers</a </form>
> <a class="btn btn-link"
</div> href="{% url 'identifier_list' suffix_pk=object.suffix.pk %}">Back to identifiers</a>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,21 +1,30 @@
{% extends "base_generic.html" %} {% block title %} {% extends "base_generic.html" %}
{% if form.instance.pk %}Edit{% else %}Create{% endif %} Identifier {% load crispy_forms_tags %}
{% endblock %} {% load crispy_forms_tags %} {% block content %} {% block title %}
<div class="container mt-5"> {% if form.instance.pk %}
<h1>{% if form.instance.pk %}Edit{% else %}Create{% endif %} Identifier</h1> Edit
<form method="post"> {% else %}
{% if form.errors %} Create
<div class="alert alert-danger" role="alert"> {% endif %}
{{ form.errors }} Identifier
</div> {% endblock title %}
{% endif %} {% block content %}
{% csrf_token %} {{ form | crispy }} <div class="container mt-5">
<button type="submit" class="btn btn-primary">Save</button> <h1>
</form> {% if form.instance.pk %}
<a Edit
class="btn btn-link mt-3" {% else %}
href="{% url 'identifier_list' suffix_pk=form.instance.suffix.pk %}" Create
>Back to identifiers</a {% endif %}
> Identifier
</div> </h1>
{% endblock %} <form method="post">
{% if form.errors %}<div class="alert alert-danger" role="alert">{{ form.errors }}</div>{% endif %}
{% csrf_token %}
{{ form | crispy }}
<button type="submit" class="btn btn-primary">Save</button>
</form>
<a class="btn btn-link mt-3"
href="{% url 'identifier_list' suffix_pk=form.instance.suffix.pk %}">Back to identifiers</a>
</div>
{% endblock content %}

View file

@ -1,24 +1,22 @@
{% extends "base_generic.html" %} {% block title %}Identifiers{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Identifiers
{% endblock title %}
{% block content %} {% block content %}
<div class="container mt-5"> <div class="container mt-5">
<h1>Identifiers{% if suffix %} for {{ suffix.name }}{% endif %}</h1> <h1>
<ul class="list-group"> Identifiers
{% for identifier in object_list %} {% if suffix %}for {{ suffix.name }}{% endif %}
<li class="list-group-item"> </h1>
<a <ul class="list-group">
href="{% url 'identifier_detail' suffix_pk=identifier.suffix.pk pk=identifier.pk %}" {% for identifier in object_list %}
>{{ identifier.identifier }}</a <li class="list-group-item">
> <a href="{% url 'identifier_detail' suffix_pk=identifier.suffix.pk pk=identifier.pk %}">{{ identifier.suffix.prefix.prefix }}.{{ identifier.suffix.suffix }}/{{ identifier.identifier }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<a <a class="btn btn-primary mt-3"
class="btn btn-primary mt-3" href="{% if suffix.pk %}{% url 'identifier_create' suffix_pk=suffix.pk %}{% else %}{% url 'identifier_create' %}{% endif %}">Create new identifier</a>
href="{% if suffix.pk %}{% url 'identifier_create' suffix_pk=suffix.pk %}{% else %}{% url 'identifier_create' %}{% endif %}" <a class="btn btn-link mt-3" href="{% url 'suffix_list' %}">Back to suffixes</a>
>Create new identifier</a </div>
> {% endblock content %}
<a class="btn btn-link mt-3" href="{% url 'suffix_list' %}"
>Back to suffixes</a
>
</div>
{% endblock %}

View file

@ -3,6 +3,9 @@
<div class="container mt-5"> <div class="container mt-5">
<h1>Pending Suffixes</h1> <h1>Pending Suffixes</h1>
<ul class="list-group"> <ul class="list-group">
{% if pending_suffixes|length == 0 %}
<li class="list-group-item">No pending suffixes</li>
{% endif %}
{% for suffix in pending_suffixes %} {% for suffix in pending_suffixes %}
<li class="list-group-item"> <li class="list-group-item">
<a href="{% url 'suffix_approval' suffix.pk %}">{{ suffix.prefix.prefix }}.{{ suffix.suffix }} &dash; {{ suffix.name }}</a> <a href="{% url 'suffix_approval' suffix.pk %}">{{ suffix.prefix.prefix }}.{{ suffix.suffix }} &dash; {{ suffix.name }}</a>

View file

@ -1,10 +1,11 @@
{% extends "base_generic.html" %} {% block title %}Delete Prefix{% endblock %} {% extends "base_generic.html" %}
{% block title %}Delete Prefix{% endblock title %}
{% block content %} {% block content %}
<h1>Delete Prefix</h1> <h1>Delete Prefix</h1>
<p>Are you sure you want to delete "{{ object.name }}"?</p> <p>Are you sure you want to delete "{{ object.name }}"?</p>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<input class="btn btn-danger" type="submit" value="Delete" /> <input class="btn btn-danger" type="submit" value="Delete" />
</form> </form>
<a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a> <a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a>
{% endblock %} {% endblock content %}

View file

@ -1,17 +1,26 @@
{% extends "base_generic.html" %} {% block title %}Prefix Detail{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Prefix Detail
{% endblock title %}
{% block content %} {% block content %}
<h1>{{ object.name }}</h1> <h1>{{ object.name }}</h1>
<p><strong>Prefix:</strong> {{ object.prefix }}</p> <p>
<p><strong>Type:</strong> {{ object.get_type_display }}</p> <strong>Prefix:</strong> {{ object.prefix }} ({{ object.prefix.name }})
<p><strong>Remote Resolver:</strong> {{ object.remote_resolver }}</p> </p>
<a class="btn btn-secondary" href="{% url 'prefix_update' object.pk %}">Edit</a> <p>
<form <strong>Type:</strong> {{ object.get_type_display }}
method="post" </p>
action="{% url 'prefix_delete' object.pk %}" {% if object.type == "remote" %}
style="display: inline" <p>
> <strong>Remote Resolver:</strong> {{ object.remote_resolver }}
{% csrf_token %} </p>
<input class="btn btn-danger" type="submit" value="Delete" /> {% endif %}
</form> <a class="btn btn-secondary" href="{% url 'prefix_update' object.pk %}">Edit</a>
<a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a> <form method="post"
{% endblock %} action="{% url 'prefix_delete' object.pk %}"
class="d-inline">
{% csrf_token %}
<input class="btn btn-danger" type="submit" value="Delete" />
</form>
<a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a>
{% endblock content %}

View file

@ -1,15 +1,26 @@
{% extends "base_generic.html" %} {% block title %} {% extends "base_generic.html" %}
{% if form.instance.pk %}Edit{% else %}Create{% endif %} Prefix{% endblock %} {% block title %}
{% load crispy_forms_tags %} {% block content %} {% if form.instance.pk %}
<h1>{% if form.instance.pk %}Edit{% else %}Create{% endif %} Prefix</h1> Edit
<form method="post"> {% else %}
{% if form.errors %} Create
<div class="alert alert-danger" role="alert">
{{ form.errors }}
</div>
{% endif %} {% endif %}
{% csrf_token %} {{ form | crispy }} Prefix
<input class="btn btn-primary" type="submit" value="Save" /> {% endblock title %}
</form> {% load crispy_forms_tags %}
<a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a> {% block content %}
{% endblock %} <h1>
{% if form.instance.pk %}
Edit
{% else %}
Create
{% endif %}
Prefix
</h1>
<form method="post">
{% if form.errors %}<div class="alert alert-danger" role="alert">{{ form.errors }}</div>{% endif %}
{% csrf_token %} {{ form | crispy }}
<input class="btn btn-primary" type="submit" value="Save" />
</form>
<a class="btn btn-link" href="{% url 'prefix_list' %}">Back to list</a>
{% endblock content %}

View file

@ -1,16 +1,25 @@
{% extends "base_generic.html" %} {% block title %}Prefixes{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Prefixes
{% endblock title %}
{% block content %} {% block content %}
<h1>Prefixes</h1> <h1>Prefixes</h1>
<ul class="list-group"> <ul class="list-group">
{% if object_list|length == 0 %}
<li class="list-group-item">
No prefixes.
{% if not user.is_superuser}You can request prefixes by contacting the administrator.
{% endif %}
{% endif %}
</li>
{% endif %}
{% for prefix in object_list %} {% for prefix in object_list %}
<li class="list-group-item"> <li class="list-group-item">
<a href="{% url 'prefix_detail' prefix.pk %}">{{ prefix.prefix }} &dash; {{ prefix.name }}</a> <a href="{% url 'prefix_detail' prefix.pk %}">{{ prefix.prefix }} &dash; {{ prefix.name }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% if user.is_superuser %} {% if user.is_superuser %}
<a class="btn btn-primary mt-3" href="{% url 'prefix_create' %}" <a class="btn btn-primary mt-3" href="{% url 'prefix_create' %}">Create new prefix</a>
>Create new prefix</a
>
{% endif %} {% endif %}
{% endblock %} {% endblock content %}

View file

@ -1,13 +1,15 @@
{% extends "base_generic.html" %} {% block title %}Approve Suffix{% endblock %} {% extends "base_generic.html" %}
{% load crispy_forms_tags %}{% block content %} {% block title %}
<div class="container mt-5"> Approve Suffix
<h1>Approve Suffix</h1> {% endblock title %}
<form method="post"> {% load crispy_forms_tags %}
{% csrf_token %} {{ form | crispy }} {% block content %}
<button type="submit" class="btn btn-primary">Approve</button> <div class="container mt-5">
<a class="btn btn-link" href="{% url 'pending_suffixes' %}" <h1>Approve Suffix</h1>
>Back to pending suffixes</a <form method="post">
> {% csrf_token %} {{ form | crispy }}
</form> <button type="submit" class="btn btn-primary">Approve</button>
</div> <a class="btn btn-link" href="{% url 'pending_suffixes' %}">Back to pending suffixes</a>
{% endblock %} </form>
</div>
{% endblock content %}

View file

@ -1,12 +1,15 @@
{% extends "base_generic.html" %} {% block title %}Delete Suffix{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Delete Suffix
{% endblock title %}
{% block content %} {% block content %}
<div class="container mt-5"> <div class="container mt-5">
<h1>Delete Suffix</h1> <h1>Delete Suffix</h1>
<p>Are you sure you want to delete "{{ object.name }}"?</p> <p>Are you sure you want to delete "{{ object.name }}"?</p>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<button type="submit" class="btn btn-danger">Delete</button> <button type="submit" class="btn btn-danger">Delete</button>
</form> </form>
<a class="btn btn-link mt-3" href="{% url 'suffix_list' %}">Back to list</a> <a class="btn btn-link mt-3" href="{% url 'suffix_list' %}">Back to list</a>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,30 +1,41 @@
{% extends "base_generic.html" %} {% block title %}Suffix Detail{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Suffix Detail
{% endblock title %}
{% block content %} {% block content %}
<div class="container mt-5"> <div class="container mt-5">
<h1>{{ object.name }}</h1> <h1>{{ object.name }}</h1>
<p><strong>Suffix:</strong> {{ object.suffix }}</p> <p>
<p><strong>Prefix:</strong> {{ object.prefix }}</p> <strong>Suffix:</strong> {{ object.suffix }}
<p><strong>Type:</strong> {{ object.get_type_display }}</p> </p>
{% if object.type == "remote" %} <p>
<p><strong>Remote Resolver:</strong> {{ object.remote_resolver }}</p> <strong>Prefix:</strong> {{ object.prefix }}
{% endif %} </p>
<p><strong>Approval:</strong> {% if object.approved %}Approved{% else %}Pending{% endif %}</p> <p>
<a class="btn btn-secondary" href="{% url 'suffix_update' object.pk %}" <strong>Type:</strong> {{ object.get_type_display }}
>Edit</a </p>
> {% if object.type == "remote" %}
<form <p>
method="post" <strong>Remote Resolver:</strong> {{ object.remote_resolver }}
action="{% url 'suffix_delete' object.pk %}" </p>
style="display: inline" {% endif %}
> <p>
{% csrf_token %} <strong>Approval:</strong>
<input class="btn btn-danger" type="submit" value="Delete" /> {% if object.approved %}
</form> Approved
<a {% else %}
class="btn btn-primary" Pending
href="{% url 'identifier_list' suffix_pk=object.pk %}" {% endif %}
>View Identifiers</a </p>
> <a class="btn btn-secondary" href="{% url 'suffix_update' object.pk %}">Edit</a>
<a class="btn btn-link" href="{% url 'suffix_list' %}">Back to list</a> <form method="post"
</div> action="{% url 'suffix_delete' object.pk %}"
{% endblock %} style="display: inline">
{% csrf_token %}
<input class="btn btn-danger" type="submit" value="Delete" />
</form>
<a class="btn btn-primary"
href="{% url 'identifier_list' suffix_pk=object.pk %}">View Identifiers</a>
<a class="btn btn-link" href="{% url 'suffix_list' %}">Back to list</a>
</div>
{% endblock content %}

View file

@ -1,21 +1,39 @@
{% extends "base_generic.html" %} {% block title %} {% extends "base_generic.html" %}
{% if form.instance.pk %}Edit{% else %}Request{% endif %} Suffix{% endblock %} {% block title %}
{% load crispy_forms_tags %}{% block content %} {% if form.instance.pk %}
<div class="container mt-5"> Edit
<h1>{% if form.instance.pk %}Edit{% else %}Create{% endif %} Suffix</h1> {% else %}
<form method="post"> Request
{% if form.errors %} {% endif %}
<div class="alert alert-danger" role="alert"> Suffix
{{ form.errors }} {% endblock title %}
</div> {% load crispy_forms_tags %}
{% endif %} {% block content %}
{% csrf_token %} {{ form | crispy }} <div class="container mt-5">
<p class="text-muted">Please make sure to include a full description of <h1>
your intended use of the suffix in the "Description" field. Your request {% if form.instance.pk %}
may be rejected if this information is not provided, or if the selected Edit
prefix is not appropriate for your intended use.</p> {% else %}
<button type="submit" class="btn btn-primary">Save</button> Create
</form> {% endif %}
<a class="btn btn-link mt-3" href="{% url 'suffix_list' %}">Back to list</a> Suffix
</div> </h1>
{% endblock %} <form method="post">
{% if form.errors %}<div class="alert alert-danger" role="alert">{{ form.errors }}</div>{% endif %}
{% csrf_token %} {{ form | crispy }}
<p class="text-muted">
Please make sure to include a full description of your intended use of the
suffix in the "Description" field. Your request may be rejected if this
information is not provided, or if the selected prefix is not appropriate
for your intended use.
</p>
<p class="text-muted">
Note that the suffix will not be resolvable until it has been approved by
the administrator, and that using the suffix for other than the intended
purpose may result in the suffix being revoked.
</p>
<button type="submit" class="btn btn-primary">Save</button>
</form>
<a class="btn btn-link mt-3" href="{% url 'suffix_list' %}">Back to list</a>
</div>
{% endblock content %}

View file

@ -1,16 +1,23 @@
{% extends "base_generic.html" %} {% block title %}Suffixes{% endblock %} {% extends "base_generic.html" %}
{% block title %}
Suffixes
{% endblock title %}
{% block content %} {% block content %}
<div class="container mt-5"> <div class="container mt-5">
<h1>Suffixes</h1> <h1>Suffixes</h1>
<ul class="list-group"> <ul class="list-group">
{% for suffix in object_list %} {% if object_list|length == 0 %}
<li class="list-group-item"> <li class="list-group-item">
<a href="{% url 'suffix_detail' suffix.pk %}">{{ suffix.suffix.prefix }}.{{ suffix.suffix }} &dash; {{ suffix.name }}</a> No suffixes.
</li> <a href="{% url 'suffix_create' %}">Request a suffix now</a> to start issuing DOIs.
{% endfor %} </li>
</ul> {% endif %}
<a class="btn btn-primary mt-3" href="{% url 'suffix_create' %}" {% for suffix in object_list %}
>Create new suffix</a <li class="list-group-item">
> <a href="{% url 'suffix_detail' suffix.pk %}">{{ suffix.suffix.prefix }}.{{ suffix.suffix }} &dash; {{ suffix.name }}</a>
</div> </li>
{% endblock %} {% endfor %}
</ul>
<a class="btn btn-primary mt-3" href="{% url 'suffix_create' %}">Request new suffix</a>
</div>
{% endblock content %}