created separate base for RIGS and assets.

Fixed create asset form
This commit is contained in:
Matthew Smith
2019-10-01 22:46:48 +01:00
parent a9a05b06fa
commit 8c60f6cb1d
52 changed files with 140 additions and 101 deletions

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load static %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load paginator from filters %}
{% block title %}Event Archive{% endblock %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load widget_tweaks %}
{% load static %}
{% load multiply from filters %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load paginator from filters %}
{% load static %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}RIGS{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Delete payment on invoice {{ object.invoice.pk }}{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Invoice {{ object.pk }}{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load paginator from filters %}
{% block title %}Invoices{% endblock %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Delete payment on invoice {{ object.invoice.pk }}{% endblock %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load widget_tweaks %}
{% block title %}Update Profile {{object.name}}{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Rigboard{% endblock %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_assets.html' %}
{% block title %}List{% endblock %}
{% load paginator from filters %}

View File

@@ -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()
}
</script>
@@ -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();
})
</script>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_assets.html' %}
{% block title %}Detail{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_assets.html' %}
{% block title %}List{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_assets.html' %}
{% block title %}Edit{% endblock %}
{% block content %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Bad Request{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Unauthorized{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Forbidden{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Page Not Found{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Server error{% endblock %}

View File

@@ -43,58 +43,13 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">RIGS</a>
{% block titleheader %}
{% endblock %}
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
{% if user.is_authenticated %}
<li><a href="/">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Rigboard<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-list"></span>
Rigboard</a></li>
<li><a href="{% url 'event_archive' %}"><span class="glyphicon glyphicon-book"></span>
Archive</a></li>
<li><a href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-calendar"></span>
Calendar</a></li>
{% if perms.RIGS.view_event %}
<li><a href="{% url 'activity_table' %}"><span
class="glyphicon glyphicon-random"></span> Recent Changes</a></li>
{% endif %}
{% if perms.RIGS.add_event %}
<li><a href="{% url 'event_create' %}"><span class="glyphicon glyphicon-plus"></span>
New Event</a></li>
{% endif %}
</ul>
</li>
{% endif %}
{% if perms.RIGS.view_invoice %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Invoices<b class="caret"></b></a>
<ul class="dropdown-menu">
{% if perms.RIGS.add_invoice %}
<li><a href="{% url 'invoice_waiting' %}"><span
class="glyphicon glyphicon-briefcase text-danger"></span> Waiting</a></li>
{% endif %}
<li><a href="{% url 'invoice_list' %}"><span class="glyphicon glyphicon-gbp text-warning"></span> Outstanding</a>
</li>
<li><a href="{% url 'invoice_archive' %}"><span class="glyphicon glyphicon-book"></span>
Archive</a></li>
</ul>
</li>
{% endif %}
{% if perms.RIGS.view_person %}
<li><a href="{% url 'person_list' %}">People</a></li>
{% endif %}
{% if perms.RIGS.view_organisation %}
<li><a href="{% url 'organisation_list' %}">Organisations</a></li>
{% endif %}
{% if perms.RIGS.view_venue %}
<li><a href="{% url 'venue_list' %}">Venues</a></li>
{% endif %}
{% block titleelements %}
{% endblock %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">

View File

@@ -0,0 +1,30 @@
{% extends 'base.html' %}
{% block titleheader %}
<a class="navbar-brand" href="{% url 'index' %}">Assets</a>
{% endblock %}
{% block titleelements %}
{% if perms.assets.view_asset%}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Assets<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'asset_list' %}"><span class="glyphicon glyphicon-list"></span> List Assets</a></li>
{% if perms.assets.add_asset %}
<li><a href="{% url 'asset_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Asset</a></li>
{% endif %}
</ul>
</li>
{% endif %}
{% if perms.assets.view_supplier%}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> Suppliers<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'supplier_list' %}"><span class="glyphicon glyphicon-list"></span>
List Suppliers</a></li>
{% if perms.assets.add_asset %}
<li><a href="{% url 'supplier_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Supplier</a></li>
{% endif %}
</ul>
</li>
{% endif %}
{% endblock %}

54
templates/base_rigs.html Normal file
View File

@@ -0,0 +1,54 @@
{% extends 'base.html' %}
{% block titleheader %}
<a class="navbar-brand" href="/">RIGS</a>
{% endblock %}
{% block titleelements %}
{% if user.is_authenticated %}
<li><a href="/">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Rigboard<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-list"></span>
Rigboard</a></li>
<li><a href="{% url 'event_archive' %}"><span class="glyphicon glyphicon-book"></span>
Archive</a></li>
<li><a href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-calendar"></span>
Calendar</a></li>
{% if perms.RIGS.view_event %}
<li><a href="{% url 'activity_table' %}"><span
class="glyphicon glyphicon-random"></span> Recent Changes</a></li>
{% endif %}
{% if perms.RIGS.add_event %}
<li><a href="{% url 'event_create' %}"><span class="glyphicon glyphicon-plus"></span>
New Event</a></li>
{% endif %}
</ul>
</li>
{% endif %}
{% if perms.RIGS.view_invoice %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Invoices<b class="caret"></b></a>
<ul class="dropdown-menu">
{% if perms.RIGS.add_invoice %}
<li><a href="{% url 'invoice_waiting' %}"><span
class="glyphicon glyphicon-briefcase text-danger"></span> Waiting</a></li>
{% endif %}
<li><a href="{% url 'invoice_list' %}"><span class="glyphicon glyphicon-gbp text-warning"></span> Outstanding</a>
</li>
<li><a href="{% url 'invoice_archive' %}"><span class="glyphicon glyphicon-book"></span>
Archive</a></li>
</ul>
</li>
{% endif %}
{% if perms.RIGS.view_person %}
<li><a href="{% url 'person_list' %}">People</a></li>
{% endif %}
{% if perms.RIGS.view_organisation %}
<li><a href="{% url 'organisation_list' %}">Organisations</a></li>
{% endif %}
{% if perms.RIGS.view_venue %}
<li><a href="{% url 'venue_list' %}">Venues</a></li>
{% endif %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load staticfiles %}
{% block title %}Login Required{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Activation Complete{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Logout Successful{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Login{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "base_rigs.html" %}
{% load i18n %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "base_rigs.html" %}
{% load widget_tweaks %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "base_rigs.html" %}
{% load i18n %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "base_rigs.html" %}
{% load i18n %}
{% load widget_tweaks %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "base_rigs.html" %}
{% load i18n %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load i18n %}
{% load widget_tweaks %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% block title %}Registration complete{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'base_rigs.html' %}
{% load widget_tweaks %}
{% block title %}Registration{% endblock %}