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