From c8d0c0d5d0842325ac4ddc99505bc5cd3b97b207 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Mon, 6 Apr 2020 15:17:14 +0100 Subject: [PATCH] Asset form fixes --- assets/templates/asset_detail.html | 13 ++--- assets/templates/asset_form.html | 28 +++++------ assets/templates/partials/asset_buttons.html | 50 ++++++++++--------- .../templates/partials/asset_list_table.html | 6 +-- .../partials/purchasedetails_form.html | 4 +- 5 files changed, 51 insertions(+), 50 deletions(-) diff --git a/assets/templates/asset_detail.html b/assets/templates/asset_detail.html index 0ab8a8fe..73e9b340 100644 --- a/assets/templates/asset_detail.html +++ b/assets/templates/asset_detail.html @@ -15,20 +15,21 @@
{% if perms.assets.asset_finance %} -
+
{% include 'partials/purchasedetails_form.html' %}
{% endif %} -
+
{% include 'partials/cable_form.html' %}
-
+
{% include 'partials/parent_form.html' %}
-
-
- {% include 'partials/asset_buttons.html' %} +
+{% include 'partials/asset_buttons.html' %}
+
{% include 'partials/last_edited.html' with target="asset_history" id=object.asset_id %} +
{% endblock %} diff --git a/assets/templates/asset_form.html b/assets/templates/asset_form.html index 4797d327..afb7b5e1 100644 --- a/assets/templates/asset_form.html +++ b/assets/templates/asset_form.html @@ -26,31 +26,29 @@ {% endblock %} {% block content %} - +

+ {% if edit and object %} + Edit Asset: {{ object.asset_id }} + {% elif duplicate %} + Duplication of Asset: {{ previous_asset_id }} + {% else %} + Create Asset + {% endif %} +

{% if duplicate %} -
+ {% else %} - + {% endif %} {% include 'form_errors.html' %} {% csrf_token %} -
+
{% include 'partials/asset_detail_form.html' %}
-
+
{% include 'partials/purchasedetails_form.html' %}
diff --git a/assets/templates/partials/asset_buttons.html b/assets/templates/partials/asset_buttons.html index 3c99225f..e42eeda1 100644 --- a/assets/templates/partials/asset_buttons.html +++ b/assets/templates/partials/asset_buttons.html @@ -1,25 +1,27 @@ -{% if edit and object %} - - - Duplicate -{% elif duplicate %} - - -{% elif create %} - - -{% else %} - -
- Edit - Duplicate +
+ {% if edit and object %} + + + {% elif duplicate %} + + + {% elif create %} + + + {% else %} + + + {% endif %} + {% if create or edit or duplicate %} +
+ + {% endif %}
-{% endif %} -{% if create or edit or duplicate %} -
- -{% endif %} diff --git a/assets/templates/partials/asset_list_table.html b/assets/templates/partials/asset_list_table.html index 27f31df4..81eb6a8a 100644 --- a/assets/templates/partials/asset_list_table.html +++ b/assets/templates/partials/asset_list_table.html @@ -18,10 +18,10 @@ {{ item.status }}
- View + View {% if perms.assets.change_asset %} - Edit - Duplicate + Edit + Duplicate {% endif %}
diff --git a/assets/templates/partials/purchasedetails_form.html b/assets/templates/partials/purchasedetails_form.html index 9cbe9a60..b2cca199 100644 --- a/assets/templates/partials/purchasedetails_form.html +++ b/assets/templates/partials/purchasedetails_form.html @@ -17,7 +17,7 @@
- £ +
£
{% render_field form.purchase_price|add_class:'form-control' value=object.purchase_price %}
@@ -25,7 +25,7 @@
- £ +
£
{% render_field form.salvage_value|add_class:'form-control' value=object.salvage_value %}