Skip to content

Commit

Permalink
Create standard buttons #3168
Browse files Browse the repository at this point in the history
  • Loading branch information
joemull committed Dec 6, 2024
1 parent 1e7287d commit 239783f
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/templates/admin/elements/a_cancel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% comment %}
A generic dark blue cancel button with a cross icon
{% endcomment %}

{% load i18n %}

<a
href="{{ href }}"
class="button secondary {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-close"></span>
{% trans "Cancel" %}
</a>
16 changes: 16 additions & 0 deletions src/templates/admin/elements/a_create.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% comment %}
A generic green create button with a plus icon
{% endcomment %}

{% load i18n %}

<a
href="{{ href }}"
class="button success {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-plus"></span>
{% if label %}
{{ label }}
{% else %}
{% trans "Create" %}
{% endif %}
</a>
12 changes: 12 additions & 0 deletions src/templates/admin/elements/a_delete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% comment %}
A generic red delete button with rubbish icon
{% endcomment %}

{% load i18n %}

<a
href="{{ href }}"
class="button alert {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-trash"></span>
{% trans "Delete" %}
</a>
12 changes: 12 additions & 0 deletions src/templates/admin/elements/a_edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% comment %}
A generic light blue edit button with a pencil icon
{% endcomment %}

{% load i18n %}

<a
href="{{ href }}"
class="button {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-edit"></span>
{% trans "Edit" %}
</a>
12 changes: 12 additions & 0 deletions src/templates/admin/elements/a_no_go_back.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% comment %}
A generic dark blue cancel / go-back button with a cross icon
{% endcomment %}

{% load i18n %}

<a
href="{{ href }}"
class="button secondary {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-close"></span>
{% trans "No, go back" %}
</a>
13 changes: 13 additions & 0 deletions src/templates/admin/elements/button_save.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% comment %}
A generic green save button with floppy disk icon
{% endcomment %}

{% load i18n %}

<button
name="{{ name|default:'save' }}"
class="button success {{ size|default:'normal' }} no-bottom-margin"
type="submit">
<span class="fa fa-save"></span>
{% trans "Save" %}
</button>
16 changes: 16 additions & 0 deletions src/templates/admin/elements/button_submit_warning.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% comment %}
A generic yellow submit button with a forward arrow icon
{% endcomment %}

{% load i18n %}

<button
name="{{ name|default:'submit' }}"
class="button warning {{ size|default:'normal' }} no-bottom-margin">
<span class="fa fa-arrow-right"></span>
{% if label %}
{{ label }}
{% else %}
{% trans "Submit" %}
{% endif %}
</button>
13 changes: 13 additions & 0 deletions src/templates/admin/elements/button_yes_delete.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% comment %}
A generic red confirm delete button with a rubbish icon
{% endcomment %}

{% load i18n %}

<button
name="{{ name|default:'yes_delete' }}"
class="button alert {{ size|default:'normal' }} no-bottom-margin"
type="submit">
<span class="fa fa-trash"></span>
{% trans "Yes, delete" %}
</button>
2 changes: 1 addition & 1 deletion src/templates/admin/identifiers/manage_identifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>{% if identifier %}Edit Identifier - {{ identifier.pk }}{% else %}Add New Id
{% csrf_token %}
{% include "elements/forms/errors.html" %}
{{ form|foundation }}
<button class="success button"><i class="fa fa-save"></i> Save</button>
{% include "elements/button_save.html" %}
</form>
</div>
{% endblock body %}

0 comments on commit 239783f

Please sign in to comment.