From 8c60f6cb1df3f2bc200b108c0f3669b344ebbae0 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Tue, 1 Oct 2019 22:46:48 +0100 Subject: [PATCH] created separate base for RIGS and assets. Fixed create asset form --- RIGS/templates/RIGS/activity_feed_data.html | 2 +- RIGS/templates/RIGS/activity_table.html | 2 +- RIGS/templates/RIGS/calendar.html | 2 +- RIGS/templates/RIGS/event_archive.html | 2 +- RIGS/templates/RIGS/event_detail.html | 2 +- RIGS/templates/RIGS/event_form.html | 2 +- RIGS/templates/RIGS/event_invoice.html | 2 +- .../RIGS/eventauthorisation_request.html | 2 +- .../eventauthorisation_request_error.html | 2 +- RIGS/templates/RIGS/index.html | 2 +- .../RIGS/invoice_confirm_delete.html | 2 +- RIGS/templates/RIGS/invoice_detail.html | 2 +- RIGS/templates/RIGS/invoice_list.html | 2 +- RIGS/templates/RIGS/organisation_detail.html | 2 +- RIGS/templates/RIGS/organisation_form.html | 2 +- RIGS/templates/RIGS/organisation_list.html | 2 +- .../RIGS/payment_confirm_delete.html | 2 +- RIGS/templates/RIGS/person_detail.html | 2 +- RIGS/templates/RIGS/person_form.html | 2 +- RIGS/templates/RIGS/person_list.html | 2 +- RIGS/templates/RIGS/profile_detail.html | 2 +- RIGS/templates/RIGS/profile_form.html | 2 +- RIGS/templates/RIGS/rigboard.html | 2 +- RIGS/templates/RIGS/venue_detail.html | 2 +- RIGS/templates/RIGS/venue_form.html | 2 +- RIGS/templates/RIGS/venue_list.html | 2 +- RIGS/templates/RIGS/version_history.html | 2 +- assets/templates/asset_list.html | 2 +- assets/templates/asset_update.html | 8 +-- assets/templates/supplier_detail.html | 2 +- assets/templates/supplier_list.html | 2 +- assets/templates/supplier_update.html | 2 +- templates/400.html | 2 +- templates/401.html | 2 +- templates/403.html | 2 +- templates/404.html | 2 +- templates/500.html | 2 +- templates/base.html | 53 ++---------------- templates/base_assets.html | 30 +++++++++++ templates/base_rigs.html | 54 +++++++++++++++++++ templates/login_redirect.html | 2 +- .../registration/activation_complete.html | 2 +- templates/registration/logged_out.html | 2 +- templates/registration/login.html | 2 +- .../registration/password_change_done.html | 2 +- .../registration/password_change_form.html | 2 +- .../registration/password_reset_complete.html | 2 +- .../registration/password_reset_confirm.html | 2 +- .../registration/password_reset_done.html | 2 +- .../registration/password_reset_form.html | 2 +- .../registration/registration_complete.html | 2 +- templates/registration/registration_form.html | 2 +- 52 files changed, 140 insertions(+), 101 deletions(-) create mode 100644 templates/base_assets.html create mode 100644 templates/base_rigs.html diff --git a/RIGS/templates/RIGS/activity_feed_data.html b/RIGS/templates/RIGS/activity_feed_data.html index 4de8bf7b..cff6c323 100644 --- a/RIGS/templates/RIGS/activity_feed_data.html +++ b/RIGS/templates/RIGS/activity_feed_data.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax_nomodal.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax_nomodal.html,base_rigs.html" %} {% load static %} {% load paginator from filters %} diff --git a/RIGS/templates/RIGS/activity_table.html b/RIGS/templates/RIGS/activity_table.html index e12dfd7a..f9addd87 100644 --- a/RIGS/templates/RIGS/activity_table.html +++ b/RIGS/templates/RIGS/activity_table.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load static %} {% load paginator from filters %} {% load to_class_name from filters %} diff --git a/RIGS/templates/RIGS/calendar.html b/RIGS/templates/RIGS/calendar.html index f6891d84..51e5e0b7 100644 --- a/RIGS/templates/RIGS/calendar.html +++ b/RIGS/templates/RIGS/calendar.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load static %} diff --git a/RIGS/templates/RIGS/event_archive.html b/RIGS/templates/RIGS/event_archive.html index 00baaad6..4fc5642e 100644 --- a/RIGS/templates/RIGS/event_archive.html +++ b/RIGS/templates/RIGS/event_archive.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load paginator from filters %} {% block title %}Event Archive{% endblock %} diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index 5f2885b5..b587bd33 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% block title %}{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %} | {{object.name}}{% endblock %} {% block content %} diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index d7ba9591..954ebdbd 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load widget_tweaks %} {% load static %} {% load multiply from filters %} diff --git a/RIGS/templates/RIGS/event_invoice.html b/RIGS/templates/RIGS/event_invoice.html index ec9755c0..415293e9 100644 --- a/RIGS/templates/RIGS/event_invoice.html +++ b/RIGS/templates/RIGS/event_invoice.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load paginator from filters %} {% load static %} diff --git a/RIGS/templates/RIGS/eventauthorisation_request.html b/RIGS/templates/RIGS/eventauthorisation_request.html index 6067b3fe..dbb617c3 100644 --- a/RIGS/templates/RIGS/eventauthorisation_request.html +++ b/RIGS/templates/RIGS/eventauthorisation_request.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %} +{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %} {% load widget_tweaks %} {% block title %}Request Authorisation{% endblock %} diff --git a/RIGS/templates/RIGS/eventauthorisation_request_error.html b/RIGS/templates/RIGS/eventauthorisation_request_error.html index b366622d..aaebe4c0 100644 --- a/RIGS/templates/RIGS/eventauthorisation_request_error.html +++ b/RIGS/templates/RIGS/eventauthorisation_request_error.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %} +{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %} {% load widget_tweaks %} {% block title %}NottinghamTEC Email Address Required{% endblock %} diff --git a/RIGS/templates/RIGS/index.html b/RIGS/templates/RIGS/index.html index b5c4c511..157fc9d0 100644 --- a/RIGS/templates/RIGS/index.html +++ b/RIGS/templates/RIGS/index.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% block title %}RIGS{% endblock %} {% block content %} diff --git a/RIGS/templates/RIGS/invoice_confirm_delete.html b/RIGS/templates/RIGS/invoice_confirm_delete.html index fe295ed6..4b575cb5 100644 --- a/RIGS/templates/RIGS/invoice_confirm_delete.html +++ b/RIGS/templates/RIGS/invoice_confirm_delete.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% block title %}Delete payment on invoice {{ object.invoice.pk }}{% endblock %} diff --git a/RIGS/templates/RIGS/invoice_detail.html b/RIGS/templates/RIGS/invoice_detail.html index e1b77b6c..2e0211da 100644 --- a/RIGS/templates/RIGS/invoice_detail.html +++ b/RIGS/templates/RIGS/invoice_detail.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% block title %}Invoice {{ object.pk }}{% endblock %} diff --git a/RIGS/templates/RIGS/invoice_list.html b/RIGS/templates/RIGS/invoice_list.html index 63e61e11..fca84c27 100644 --- a/RIGS/templates/RIGS/invoice_list.html +++ b/RIGS/templates/RIGS/invoice_list.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load paginator from filters %} {% block title %}Invoices{% endblock %} diff --git a/RIGS/templates/RIGS/organisation_detail.html b/RIGS/templates/RIGS/organisation_detail.html index 7743086c..b12b6391 100644 --- a/RIGS/templates/RIGS/organisation_detail.html +++ b/RIGS/templates/RIGS/organisation_detail.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% block title %}Organisation | {{ object.name }}{% endblock %} diff --git a/RIGS/templates/RIGS/organisation_form.html b/RIGS/templates/RIGS/organisation_form.html index 7ef77e0d..f95e31d7 100644 --- a/RIGS/templates/RIGS/organisation_form.html +++ b/RIGS/templates/RIGS/organisation_form.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %} +{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %} {% load widget_tweaks %} {% block title %}{% if object.pk %}Edit {{ object.name }}{% else %}Add Organisation{% endif %}{% endblock %} diff --git a/RIGS/templates/RIGS/organisation_list.html b/RIGS/templates/RIGS/organisation_list.html index c8856886..080ca938 100644 --- a/RIGS/templates/RIGS/organisation_list.html +++ b/RIGS/templates/RIGS/organisation_list.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% load paginator from filters %} {% load url_replace from filters %} diff --git a/RIGS/templates/RIGS/payment_confirm_delete.html b/RIGS/templates/RIGS/payment_confirm_delete.html index daa5d004..ab58e243 100644 --- a/RIGS/templates/RIGS/payment_confirm_delete.html +++ b/RIGS/templates/RIGS/payment_confirm_delete.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% block title %}Delete payment on invoice {{ object.invoice.pk }}{% endblock %} diff --git a/RIGS/templates/RIGS/person_detail.html b/RIGS/templates/RIGS/person_detail.html index 10c995ae..e8a4f3ad 100644 --- a/RIGS/templates/RIGS/person_detail.html +++ b/RIGS/templates/RIGS/person_detail.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% block title %}Person | {{ object.name }}{% endblock %} diff --git a/RIGS/templates/RIGS/person_form.html b/RIGS/templates/RIGS/person_form.html index a5720b9f..3ebf6409 100644 --- a/RIGS/templates/RIGS/person_form.html +++ b/RIGS/templates/RIGS/person_form.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %} +{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %} {% load widget_tweaks %} {% block title %}{% if object.pk %}Edit {{ object.name }}{% else %}Add Person{% endif %}{% endblock %} diff --git a/RIGS/templates/RIGS/person_list.html b/RIGS/templates/RIGS/person_list.html index 2cbdff8e..02b9eb2c 100644 --- a/RIGS/templates/RIGS/person_list.html +++ b/RIGS/templates/RIGS/person_list.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% load paginator from filters %} {% load url_replace from filters %} diff --git a/RIGS/templates/RIGS/profile_detail.html b/RIGS/templates/RIGS/profile_detail.html index 11904b18..d0a86444 100644 --- a/RIGS/templates/RIGS/profile_detail.html +++ b/RIGS/templates/RIGS/profile_detail.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% block title %}RIGS Profile {{object.pk}}{% endblock %} diff --git a/RIGS/templates/RIGS/profile_form.html b/RIGS/templates/RIGS/profile_form.html index baa33424..b8426875 100644 --- a/RIGS/templates/RIGS/profile_form.html +++ b/RIGS/templates/RIGS/profile_form.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load widget_tweaks %} {% block title %}Update Profile {{object.name}}{% endblock %} diff --git a/RIGS/templates/RIGS/rigboard.html b/RIGS/templates/RIGS/rigboard.html index 9292e304..786f9385 100644 --- a/RIGS/templates/RIGS/rigboard.html +++ b/RIGS/templates/RIGS/rigboard.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% block title %}Rigboard{% endblock %} diff --git a/RIGS/templates/RIGS/venue_detail.html b/RIGS/templates/RIGS/venue_detail.html index ede9d4ec..25d3daef 100644 --- a/RIGS/templates/RIGS/venue_detail.html +++ b/RIGS/templates/RIGS/venue_detail.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% block title %}Venue | {{ object.name }}{% endblock %} diff --git a/RIGS/templates/RIGS/venue_form.html b/RIGS/templates/RIGS/venue_form.html index 4d99af7e..b410a062 100644 --- a/RIGS/templates/RIGS/venue_form.html +++ b/RIGS/templates/RIGS/venue_form.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:'base_ajax.html,base.html' %} +{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %} {% load widget_tweaks %} {% block title %}{{ object.pk|yesno:"Edit,Add" }} Venue{% endblock %} diff --git a/RIGS/templates/RIGS/venue_list.html b/RIGS/templates/RIGS/venue_list.html index 88ae61ac..80c9d8ac 100644 --- a/RIGS/templates/RIGS/venue_list.html +++ b/RIGS/templates/RIGS/venue_list.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load widget_tweaks %} {% load paginator from filters %} {% load url_replace from filters %} diff --git a/RIGS/templates/RIGS/version_history.html b/RIGS/templates/RIGS/version_history.html index 18ff22d4..676d231e 100644 --- a/RIGS/templates/RIGS/version_history.html +++ b/RIGS/templates/RIGS/version_history.html @@ -1,4 +1,4 @@ -{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %} +{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% load to_class_name from filters %} {% load paginator from filters %} {% load static %} diff --git a/assets/templates/asset_list.html b/assets/templates/asset_list.html index ea008196..d872a8d6 100644 --- a/assets/templates/asset_list.html +++ b/assets/templates/asset_list.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_assets.html' %} {% block title %}List{% endblock %} {% load paginator from filters %} diff --git a/assets/templates/asset_update.html b/assets/templates/asset_update.html index 9cbc1860..33721dcf 100644 --- a/assets/templates/asset_update.html +++ b/assets/templates/asset_update.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_assets.html' %} {% load widget_tweaks %} {% load asset_templatetags %} {% block title %}Asset {{ object.asset_id }}{% endblock %} @@ -304,6 +304,9 @@ form: $('#asset_update_form').serialize() }, traditional: true, + headers: { + 'X-CSRFToken': document.getElementById("asset_update_form").csrfmiddlewaretoken.value + }, success: function (data) { // console.log(data); @@ -328,7 +331,6 @@ function clearParent() { $('#hidden_parent_id').val(''); $('#parent_id').val(''); - M.updateTextFields() } @@ -337,9 +339,7 @@ {% if edit or duplicate %} var comments_id = '#{{ form.comments.id_for_label }}'; $(comments_id).val('{{ object.comments|linebreaksn }}'); - M.textareaAutoResize($(comments_id)); {% endif %} - M.updateTextFields(); }) {% endblock %} \ No newline at end of file diff --git a/assets/templates/supplier_detail.html b/assets/templates/supplier_detail.html index 12684669..7639cf6b 100644 --- a/assets/templates/supplier_detail.html +++ b/assets/templates/supplier_detail.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_assets.html' %} {% block title %}Detail{% endblock %} {% block content %} diff --git a/assets/templates/supplier_list.html b/assets/templates/supplier_list.html index 83d725c5..5b37dadf 100644 --- a/assets/templates/supplier_list.html +++ b/assets/templates/supplier_list.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_assets.html' %} {% block title %}List{% endblock %} {% block content %} diff --git a/assets/templates/supplier_update.html b/assets/templates/supplier_update.html index b21afc7a..2f120369 100644 --- a/assets/templates/supplier_update.html +++ b/assets/templates/supplier_update.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_assets.html' %} {% block title %}Edit{% endblock %} {% block content %} diff --git a/templates/400.html b/templates/400.html index 5dd0c30b..dda8d561 100644 --- a/templates/400.html +++ b/templates/400.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load staticfiles %} {% block title %}Bad Request{% endblock %} diff --git a/templates/401.html b/templates/401.html index 9b9b019f..7fc7dfe0 100644 --- a/templates/401.html +++ b/templates/401.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load staticfiles %} {% block title %}Unauthorized{% endblock %} diff --git a/templates/403.html b/templates/403.html index 5f59c351..7fdb8f24 100644 --- a/templates/403.html +++ b/templates/403.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load staticfiles %} {% block title %}Forbidden{% endblock %} diff --git a/templates/404.html b/templates/404.html index 5b347c1b..5a4ef0bf 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load staticfiles %} {% block title %}Page Not Found{% endblock %} diff --git a/templates/500.html b/templates/500.html index 2fc2db83..26fd115d 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'base_rigs.html' %} {% load staticfiles %} {% block title %}Server error{% endblock %} diff --git a/templates/base.html b/templates/base.html index 24cc30bc..53238def 100644 --- a/templates/base.html +++ b/templates/base.html @@ -43,58 +43,13 @@ - RIGS + {% block titleheader %} + {% endblock %}