-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade and create new admin elements #4380
- Loading branch information
1 parent
3e28b4d
commit eff5f49
Showing
7 changed files
with
106 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "admin/core/base.html" %} | ||
|
||
{% block title %} | ||
{% block contextual_title %}{% endblock contextual_title %} | ||
- {% include "admin/elements/contextual_site_name.html" %} | ||
{% endblock title %} | ||
|
||
{% block title-section %} | ||
{{ block.super }} | ||
{% endblock title-section %} | ||
|
||
{% block breadcrumbs %} | ||
{{ block.super }} | ||
{% endblock breadcrumbs %} | ||
|
||
{% block body %} | ||
<div class="grid place-content-center"> | ||
<div class="max-w-56"> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
{% include "admin/elements/forms/accessible_messages.html" %} | ||
<div class="card padding-block-2 padding-inline-2"> | ||
{% block form_content %} | ||
{% endblock form_content %} | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends "admin/core/base.html" %} | ||
|
||
{% block title %} | ||
{% block contextual_title %}{% endblock contextual_title %} | ||
- {% include "admin/elements/contextual_site_name.html" %} | ||
{% endblock title %} | ||
|
||
{% block title-section %} | ||
{{ block.super }} | ||
{% endblock title-section %} | ||
|
||
{% block breadcrumbs %} | ||
{{ block.super }} | ||
{% endblock breadcrumbs %} | ||
|
||
{% block body %} | ||
<div class="grid place-content-center"> | ||
<div class="max-w-24"> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
<div class="card padding-block-2 padding-inline-2"> | ||
{% block form_content %} | ||
{% endblock form_content %} | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% if request.journal %} | ||
{{ journal.name }} | ||
{% elif request.repository %} | ||
{{ request.repository.name }} | ||
{% else %} | ||
{{ request.press.name }} | ||
{% endif %} |
19 changes: 19 additions & 0 deletions
19
src/templates/admin/elements/forms/accessible_messages.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% comment %} | ||
Note that messages only display through this element if they are not acti | ||
{% endcomment %} | ||
{% for message in messages %} | ||
<div class="card"> | ||
<div class="bs-callout bs-callout-{{ message.tags }}"> | ||
{{ message }} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% if form.non_field_errors %} | ||
<p> | ||
<span class="fa fa-warning"></span> | ||
{% trans 'Problems processing the form' %} | ||
</p> | ||
<ul> | ||
{{ form.non_field_errors }} | ||
</ul> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<small aria-hidden="true">* denotes required field</small> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
{% get_available_languages as LANGUAGES %} | ||
{% get_language_info_list for LANGUAGES as languages %} | ||
|
||
<label for="{{ field.id_for_label }}"> | ||
<strong>{{ field.label }}</strong> | ||
<div> | ||
<label for="{{ field.id_for_label }}"> | ||
<strong> | ||
{{ field.label }} | ||
{% if field.field.required %} | ||
<span aria-hidden="true">*</span> | ||
{% endif %} | ||
</strong> | ||
{% if languages|length > 1 and field.name in edit_form.translatable_field_names %} | ||
<small class="green">[{% trans 'translatable' %}]</small> | ||
<small class="green">[{% trans 'translatable' %}]</small> | ||
{% endif %} | ||
</label> | ||
{{ field }} | ||
<p class="help-text">{{ field.help_text|safe }}</p> | ||
{% for error in field.errors %} | ||
<small{% if field.errors %} class="error"{% endif %}>{{ error|escape }}</small> | ||
{% endfor %} | ||
</label> | ||
{% for error in field.errors %} | ||
<div {% if field.errors %}class="error"{% endif %}> | ||
<span class="fa fa-warning"></span> | ||
{{ error|escape }} | ||
</div> | ||
{% endfor %} | ||
{{ field }} | ||
{% if field.help_text %} | ||
<p class="help-text">{{ field.help_text|safe }}</p> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters