mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-19 06:22:16 +00:00
Authorisation template work
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
<script src="{% static 'js/jquery.js' %}"></script>
|
||||
<script src="{% static 'js/popper.js' %}"></script>
|
||||
<script src="{% static 'js/ravenjs.js' %}"></script>
|
||||
<script src="{% static 'js/raven.js' %}"></script>
|
||||
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
|
||||
{% block preload_js %}
|
||||
{% endblock %}
|
||||
@@ -33,39 +33,23 @@
|
||||
|
||||
<body>
|
||||
{% include "analytics.html" %}
|
||||
<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark justify-content-between" role="navigation">
|
||||
<div class="container">
|
||||
{% block titleheader %}
|
||||
{% endblock %}
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
{% block titleelements %}
|
||||
{% endblock %}
|
||||
<li class="nav-item dropdown align-self-end" id="user">
|
||||
{% if user.is_authenticated %}
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="fas fa-user"></span>
|
||||
Hi {{ user.first_name }}
|
||||
</a>
|
||||
<div class="dropdown-menu" id="userdropdown">
|
||||
<div class="col-sm-12 text-right">
|
||||
<a href="{% url 'logout' %}" class="dropdown-item btn btn-primary" >Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<a class="nav-link" href="{% url 'login' %}">
|
||||
<span class="icon-user"></span>
|
||||
Login
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{% block navbar %}
|
||||
<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark" role="navigation">
|
||||
<div class="container">
|
||||
{% block titleheader %}
|
||||
{% endblock %}
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
{% block titleelements %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
<div class="container py-4">
|
||||
{% block content-header %}
|
||||
|
||||
@@ -1,75 +1,10 @@
|
||||
{% load static %}
|
||||
{% load raven %}
|
||||
{% extends 'base.html' %}
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}"
|
||||
xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
|
||||
lang="{% firstof LANGUAGE_CODE 'en' %}">
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %} | Rig Information Gathering System</title>
|
||||
|
||||
<meta name="viewport" content="initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/png" href="{% static "imgs/pyrigs-avatar.png" %}">
|
||||
<link rel="apple-touch-icon" href="{% static "imgs/pyrigs-avatar.png" %}">
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700,300,400' rel='stylesheet'
|
||||
type='text/css'>
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/screen.css" %}">
|
||||
{% block css %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.8.3.min.js"
|
||||
integrity="sha256-YcbK69I5IXQftf/mYD8WY0/KmEDCv1asggHpJk1trM8=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.ravenjs.com/1.3.0/jquery,native/raven.min.js"></script>
|
||||
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
|
||||
{% block preload_js %}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra-head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% include "analytics.html" %}
|
||||
<div class="navbar navbar-fixed-top navbar-inverse hidden-print" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<span class="navbar-brand">RIGS</span>
|
||||
</div>
|
||||
</div>
|
||||
{% block titleheader %}
|
||||
<div class="navbar-header">
|
||||
<span class="navbar-brand">RIGS</span>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div id="content" class="row">
|
||||
{% block content-header %}
|
||||
{% if error %}
|
||||
<div class="error">{{ error }}</div>{% endif %}
|
||||
{% if info %}
|
||||
<div class="info">{{ info }}</div>{% endif %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ message.level_tag }} alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
|
||||
aria-hidden="true">×</span></button>
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div id="sidebar" class="column">
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal" role="dialog" tabindex=-1></div>
|
||||
{% endblock %}
|
||||
|
||||
<div class="modal fade" id="loading-modal" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
@@ -86,40 +21,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
Date.prototype.getISOString = function () {
|
||||
var yyyy = this.getFullYear().toString();
|
||||
var mm = (this.getMonth() + 1).toString(); // getMonth() is zero-based
|
||||
var dd = this.getDate().toString();
|
||||
return yyyy + '-' + (mm[1] ? mm : "0" + mm[0]) + '-' + (dd[1] ? dd : "0" + dd[0]); // padding
|
||||
};
|
||||
</script>
|
||||
<script src="{% static "js/jquery.cookie.js" %}"></script>
|
||||
<script src="{% static "js/alert.js" %}"></script>
|
||||
<script src="{% static "js/collapse.js" %}"></script>
|
||||
<script>
|
||||
$('.navbar-collapse').addClass('collapse')
|
||||
</script>
|
||||
<script src="{% static "js/dropdown.js" %}"></script>
|
||||
<script src="{% static "js/modal.js" %}"></script>
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(document).on('click', '.modal-href', function (e) {
|
||||
$link = jQuery(this);
|
||||
// Anti modal inception
|
||||
if ($link.parents('#modal').length == 0) {
|
||||
e.preventDefault();
|
||||
modaltarget = $link.data('target');
|
||||
modalobject = "";
|
||||
jQuery('#modal').load($link.attr('href'), function (e) {
|
||||
jQuery('#modal').modal();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% block js %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.8.3.min.js"
|
||||
integrity="sha256-YcbK69I5IXQftf/mYD8WY0/KmEDCv1asggHpJk1trM8=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.ravenjs.com/1.3.0/jquery,native/raven.min.js"></script>
|
||||
<script src="{% static 'js/raven.js' %}"></script>
|
||||
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -8,70 +8,95 @@
|
||||
|
||||
{% block titleelements %}
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownRigboard" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Rigboard
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdownRigboard">
|
||||
<a class="dropdown-item" href="{% url 'rigboard' %}"><span class="fas fa-list"></span>
|
||||
Rigboard</a>
|
||||
<a class="dropdown-item" href="{% url 'event_archive' %}"><span class="fas fa-book"></span>
|
||||
Archive</a>
|
||||
<a class="dropdown-item" href="{% url 'web_calendar' %}"><span class="fas fa-calendar"></span>
|
||||
Calendar</a>
|
||||
{% if perms.RIGS.view_event %}
|
||||
<a class="dropdown-item" href="{% url 'activity_table' %}"><span
|
||||
class="fas fa-random"></span> Recent Changes</a>
|
||||
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownRigboard" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Rigboard
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdownRigboard">
|
||||
<a class="dropdown-item" href="{% url 'rigboard' %}"><span class="fas fa-list"></span>
|
||||
Rigboard</a>
|
||||
<a class="dropdown-item" href="{% url 'event_archive' %}"><span class="fas fa-book"></span>
|
||||
Archive</a>
|
||||
<a class="dropdown-item" href="{% url 'web_calendar' %}"><span class="fas fa-calendar"></span>
|
||||
Calendar</a>
|
||||
{% if perms.RIGS.view_event %}
|
||||
<a class="dropdown-item" href="{% url 'activity_table' %}"><span
|
||||
class="fas fa-random"></span> Recent Changes</a>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.add_event %}
|
||||
<a class="dropdown-item" href="{% url 'event_create' %}"><span class="fas fa-plus"></span>
|
||||
New Event</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% if perms.RIGS.view_invoice %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownInvoices" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Invoices
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdownInvoices">
|
||||
{% if perms.RIGS.add_invoice %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_waiting' %}"><span class="fas fa-briefcase text-danger"></span> Waiting</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_list' %}"><span class="fas fa-pound-sign text-warning"></span> Outstanding</a>
|
||||
<a class="dropdown-item" href="{% url 'invoice_archive' %}"><span class="fas fa-book"></span> Archive</a>
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.add_event %}
|
||||
<a class="dropdown-item" href="{% url 'event_create' %}"><span class="fas fa-plus"></span>
|
||||
New Event</a>
|
||||
{% if perms.RIGS.view_person %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'person_list' %}">People</a></li>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% if perms.RIGS.view_invoice %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownInvoices" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Invoices
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdownInvoices">
|
||||
{% if perms.RIGS.add_invoice %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_waiting' %}"><span class="fas fa-briefcase text-danger"></span> Waiting</a>
|
||||
{% if perms.RIGS.view_organisation %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'organisation_list' %}">Organisations</a></li>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'invoice_list' %}"><span class="fas fa-pound-sign text-warning"></span> Outstanding</a>
|
||||
<a class="dropdown-item" href="{% url 'invoice_archive' %}"><span class="fas fa-book"></span> Archive</a>
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.view_person %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'person_list' %}">People</a></li>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.view_organisation %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'organisation_list' %}">Organisations</a></li>
|
||||
{% endif %}
|
||||
{% if perms.RIGS.view_venue %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'venue_list' %}">Venues</a></li>
|
||||
{% endif %}
|
||||
<form id="searchForm" class="form-inline flex-nowrap mx-3" role="form" method="GET">
|
||||
<div class="input-group input-group-sm flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
<input id="id_search_input" type="search" name="q" class="form-control form-control-sm" placeholder="Search..." />
|
||||
{% if perms.RIGS.view_venue %}
|
||||
<li class="nav-item"><a class="nav-link" href="{% url 'venue_list' %}">Venues</a></li>
|
||||
{% endif %}
|
||||
<form id="searchForm" class="form-inline flex-nowrap mx-3" role="form" method="GET">
|
||||
<div class="input-group input-group-sm flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
<input id="id_search_input" type="search" name="q" class="form-control form-control-sm" placeholder="Search..." />
|
||||
</div>
|
||||
<select id="search-options" class="custom-select form-control">
|
||||
<option selected data-action="{% url 'event_archive' %}" href="#">Events</option>
|
||||
<option data-action="{% url 'person_list' %}" href="#">People</option>
|
||||
<option data-action="{% url 'organisation_list' %}" href="#">Organisations</option>
|
||||
<option data-action="{% url 'venue_list' %}" href="#">Venues</option>
|
||||
{% if perms.RIGS.view_invoice %}
|
||||
<option data-action="{% url 'invoice_archive' %}" href="#">Invoices</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<select id="search-options" class="custom-select form-control">
|
||||
<option selected data-action="{% url 'event_archive' %}" href="#">Events</option>
|
||||
<option data-action="{% url 'person_list' %}" href="#">People</option>
|
||||
<option data-action="{% url 'organisation_list' %}" href="#">Organisations</option>
|
||||
<option data-action="{% url 'venue_list' %}" href="#">Venues</option>
|
||||
{% if perms.RIGS.view_invoice %}
|
||||
<option data-action="{% url 'invoice_archive' %}" href="#">Invoices</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-primary form-control form-control-sm btn-sm">Search</button>
|
||||
<a href="{% url 'search_help' %}" class="nav-link modal-href btn-sm"><span class="fas fa-question-circle"></span></a>
|
||||
</form>
|
||||
<button class="btn btn-primary form-control form-control-sm btn-sm">Search</button>
|
||||
<a href="{% url 'search_help' %}" class="nav-link modal-href btn-sm"><span class="fas fa-question-circle"></span></a>
|
||||
</form>
|
||||
{% endif %}
|
||||
<li class="nav-item dropdown" id="user">
|
||||
{% if user.is_authenticated %}
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Hi {{ user.first_name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu p-3" id="userdropdown">
|
||||
<li class="media">
|
||||
<a href="{% url 'profile_detail' %}">
|
||||
<img src="{{ request.user.profile_picture }}" class="media-object"/>
|
||||
<div class="media-body">
|
||||
<b>{{ request.user.first_name }} {{ request.user.last_name }}</b>
|
||||
<p class="muted">{{ request.user.email }}</p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'logout' %}" class="btn btn-primary align"><i class="fas fa-sign-out-alt"></i> Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<a class="nav-link" href="{% url 'login' %}">
|
||||
Login
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script src="{% static 'js/tooltip.js' %}"></script>
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
|
||||
</div>
|
||||
{% include 'registration/loginform.html' %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% load widget_tweaks %}
|
||||
{% include 'form_errors.html' %}
|
||||
<div class="col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
|
||||
<div class="col-sm-6 offset-sm-3 col-lg-4 offset-lg-4">
|
||||
<form action="{% url 'login' %}" method="post" role="form" target="_self">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label for="id_username">{{ form.username.label }}</label>
|
||||
|
||||
Reference in New Issue
Block a user