Merge branch 'master' into python_deps_2020

# Conflicts:
#	PyRIGS/settings.py
#	RIGS/templates/RIGS/event_embed.html
#	RIGS/views.py
This commit is contained in:
2020-03-06 19:57:14 +00:00
28 changed files with 627 additions and 109 deletions

View File

@@ -0,0 +1,9 @@
{% extends 'base_client_email.html' %}
{% block content %}
<p>Hi {{ to_name|default_if_none:"Administrator" }},</p>
<p>{{ number_of_users|default_if_none:"Some" }} new users are awaiting administrator approval on RIGS. Click <a href="{{ request.scheme }}://{{ request.get_host }}{{ link_suffix }}">here</a> to approve them.</p>
<p>TEC PA &amp; Lighting</p>
{% endblock %}

View File

@@ -0,0 +1,5 @@
Hi {{ to_name|default_if_none:"Administrator" }},
{{ number_of_users|default_if_none:"Some" }} new users are awaiting administrator approval on RIGS. Use this link to approve them: {{ request.scheme }}://{{ request.get_host }}/{{ link_suffix }}
TEC PA & Lighting

View File

@@ -5,34 +5,49 @@
{% block content %}
<div class="row">
<h2>Event Archive</h2>
<div class="col-sm-12 col-md-6 pagination">
<div class="col-sm-12">
<h2>Event Archive</h2>
</div>
<div class="col-sm-12">
<form class="form-inline">
<div class="form-group">
<label for="start">Start</label>
<input type="date" name="start" id="start" value="{{ request.GET.start }}" placeholder="Start" class="form-control" />
<div class="input-group">
<div class="input-group-addon">Start</div>
<input type="date" name="start" id="start" value="{{ start|default_if_none:"" }}" placeholder="Start" class="form-control" />
</div>
<div class="form-group">
<label for="end">End</label>
<input type="date" name="end" id="end" value="{% if request.GET.end %}{{ request.GET.end }}{% else %}{% now "Y-m-d" %}{% endif %}" placeholder="End" class="form-control" />
<div class="input-group">
<div class="input-group-addon">End</div>
<input type="date" name="end" id="end" value="{{ end|default_if_none:"" }}" placeholder="End" class="form-control" />
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" />
<div class="input-group">
<div class="input-group-addon">Keyword</div>
<input type="search" name="q" placeholder="Keyword" value="{{ request.GET.q }}"
class="form-control"/>
</div>
<div class="input-group">
<input type="submit" class="btn btn-primary" value="Search"/>
</div>
</form>
</div>
{% if is_paginated %}
<div class="col-md-6 text-right">
{% paginator %}
</div>
{% endif %}
<div class="col-sm-12">
{% if is_paginated %}
<div class="pull-right">
{% paginator %}
</div>
{% endif %}
</div>
<div class="row">
{% with latest as events %}
{% include 'RIGS/event_table.html' %}
{% endwith %}
<div class="col-sm-12">
{% with object_list as events %}
{% include 'RIGS/event_table.html' %}
{% endwith %}
</div>
</div>
{% if is_paginated %}

View File

@@ -10,12 +10,14 @@
| {{ object.name }} {% if event.dry_hire %}<span class="badge">Dry Hire</span>{% endif %}
</h1>
</div>
{% if perms.RIGS.view_event %}
<div class="col-sm-12 text-right">
{% include 'RIGS/event_detail_buttons.html' %}
</div>
{% endif %}
{% endif %}
{% if object.is_rig %}
{% if object.is_rig and perms.RIGS.view_event %}
{# only need contact details for a rig #}
<div class="col-sm-12 col-md-6 col-lg-5">
<div class="panel panel-default">
@@ -72,7 +74,7 @@
{% endif %}
</div>
{% endif %}
<div class="col-sm-12 {% if event.is_rig %}col-md-6 col-lg-7{% endif %}">
<div class="col-sm-12 {% if event.is_rig and perms.RIGS.view_event %}col-md-6 col-lg-7{% endif %}">
<div class="panel panel-info">
<div class="panel-heading">Event Info</div>
<div class="panel-body">
@@ -147,7 +149,7 @@
<dd>{{ object.collector }}</dd>
{% endif %}
{% if event.is_rig and not event.internal %}
{% if event.is_rig and not event.internal and perms.RIGS.view_event %}
<dd>&nbsp;</dd>
<dt>PO</dt>
<dd>{{ object.purchase_order }}</dd>
@@ -156,7 +158,7 @@
</div>
</div>
</div>
{% if event.is_rig and event.internal %}
{% if event.is_rig and event.internal and perms.RIGS.view_event %}
<div class="col-sm-12">
<div class="panel panel-default
{% if object.authorised %}
@@ -212,7 +214,7 @@
</div>
<div>
{% endif %}
{% if not request.is_ajax %}
{% if not request.is_ajax and perms.RIGS.view_event %}
<div class="col-sm-12 text-right">
{% include 'RIGS/event_detail_buttons.html' %}
</div>
@@ -222,21 +224,23 @@
<div class="panel panel-default">
<div class="panel-heading">Event Details</div>
<div class="panel-body">
{% if perms.RIGS.view_event %}
<div class="well well-sm">
<h4>Notes</h4>
<div class="dont-break-out">{{ event.notes|linebreaksbr }}</div>
</div>
{% endif %}
{% include 'RIGS/item_table.html' %}
</div>
</div>
</div>
{% if not request.is_ajax %}
{% if not request.is_ajax and perms.RIGS.view_event %}
<div class="col-sm-12 text-right">
{% include 'RIGS/event_detail_buttons.html' %}
</div>
{% endif %}
{% endif %}
{% if not request.is_ajax %}
{% if not request.is_ajax and perms.RIGS.view_event %}
<div class="col-sm-12 text-right">
<div>
<a href="{% url 'event_history' object.pk %}" title="View Revision History">
@@ -251,12 +255,16 @@
{% if request.is_ajax %}
{% block footer %}
<div class="row">
{% if perms.RIGS.view_event %}
<div class="col-sm-10 align-left">
<a href="{% url 'event_history' object.pk %}" title="View Revision History">
Last edited at {{ object.last_edited_at|default:'never' }} by {{ object.last_edited_by.name|default:'nobody' }}
</a>
</div>
<div class="col-sm-2">
{% else %}
<div class="col-sm-12">
{% endif %}
<div class="pull-right">
<a href="{% url 'event_detail' object.pk %}" class="btn btn-primary">Open Event Page <span
class="glyphicon glyphicon-eye"></span></a>

View File

@@ -21,7 +21,7 @@
</span>
<h3>
<a {% if perms.RIGS.view_event %}href="{% url 'event_detail' object.pk %}"{% endif %}>
<a href="{% url 'event_detail' object.pk %}">
{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %}
| {{ object.name }} </a>
{% if object.venue %}

View File

@@ -33,7 +33,7 @@
</td>
<td>
<h4>
<a {% if perms.RIGS.view_event %}href="{% url 'event_detail' event.pk %}" {% endif %}>
<a href="{% url 'event_detail' event.pk %}">
{{ event.name }}
</a>
{% if event.venue %}

View File

@@ -1,6 +1,14 @@
{% extends 'base_rigs.html' %}
{% block title %}RIGS{% endblock %}
{% block js %}
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip();
})
</script>
{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
@@ -11,7 +19,7 @@
</div>
<div class="row">
<div class="col-sm-{% if perms.RIGS.view_event %}6{% else %}12{% endif %}">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="list-group-item-heading">Quick Links</h4>
@@ -26,44 +34,51 @@
<a class="list-group-item" href="https://forum.nottinghamtec.co.uk" target="_blank"><span class="glyphicon glyphicon-link"></span> TEC Forum</a>
<a class="list-group-item" href="//members.nottinghamtec.co.uk/wiki" target="_blank"><span class="glyphicon glyphicon-link"></span> TEC Wiki</a>
{% if perms.RIGS.view_event %}
<a class="list-group-item" href="http://members.nottinghamtec.co.uk/wiki/images/2/22/Event_Risk_Assesment.pdf" target="_blank"><span class="glyphicon glyphicon-link"></span> Pre-Event Risk Assessment</a>
<a class="list-group-item" href="//members.nottinghamtec.co.uk/price" target="_blank"><span class="glyphicon glyphicon-link"></span> Price List</a>
<a class="list-group-item" href="https://goo.gl/forms/jdPWov8PCNPoXtbn2" target="_blank"><span class="glyphicon glyphicon-link"></span> Subhire Insurance Form</a>
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Search Rigboard</h4>
<h4 class="panel-title">Search Rigboard
<a href="{% url 'search_help' %}" class="pull-right modal-href"><span class="glyphicon glyphicon-question-sign"</span></a></h4>
</div>
<script>
$(document).ready(function(){
$('#search-options li a').click(function(){
$('#searchForm').attr('action', $(this).data('action')).submit();
});
$('#id_search_input').keypress(function (e) {
if (e.which == 13) {
$('#searchForm').attr('action', $('#search-options li a').first().data('action')).submit();
return false;
}
});
});
</script>
<div class="list-group">
<div class="list-group-item">
<form class="form" role="form" action="{% url 'person_list' %}" method="GET">
<div class="input-group">
<input type="search" name="q" class="form-control" placeholder="Search People" />
<form id="searchForm" class="form" role="form" method="GET">
<div class="input-group" data-toggle="tooltip" title="Use the dropdown button to select what to search. The default is Event Archive.">
<input id="id_search_input" type="search" name="q" class="form-control" placeholder="Search..." />
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</form>
</div>
<div class="list-group-item">
<form class="form" role="form" action="{% url 'organisation_list' %}" method="GET">
<div class="input-group">
<input type="search" name="q" class="form-control" placeholder="Search Organisations" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</span>
</div>
</form>
</div>
<div class="list-group-item">
<form class="form" role="form" action="{% url 'venue_list' %}" method="GET">
<div class="input-group">
<input type="search" name="q" class="form-control" placeholder="Search Venues" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
<div class="btn-group" role="group">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-search"></span> Search <span class="caret"></span></button>
<ul id="search-options" class="dropdown-menu">
<li><a data-action="{% url 'event_archive' %}" href="#">Events</a></li>
<li><a data-action="{% url 'person_list' %}" href="#">People</a></li>
<li><a data-action="{% url 'organisation_list' %}" href="#">Organisations</a></li>
<li><a data-action="{% url 'venue_list' %}" href="#">Venues</a></li>
{% if perms.RIGS.view_invoice %}
<li><a data-action="{% url 'invoice_archive' %}" href="#">Invoices</a></li>
{% endif %}
</ul>
</div>
</span>
</div>
</form>
@@ -73,7 +88,7 @@
</div>
{% if perms.RIGS.view_event %}
<div class="col-sm-6">
{% include 'RIGS/activity_feed.html' %}
{% include 'RIGS/activity_feed.html' %}
</div>
{% endif %}
</div>

View File

@@ -111,7 +111,7 @@
{% endif %}
</dd>
<dt>Authorsation request sent by</dt>
<dt>Authorisation request sent by</dt>
<dd>{{ object.authorisation.sent_by }}</dd>
</dl>
</div>

View File

@@ -12,6 +12,7 @@
{% paginator %}
</div>
{% endif %}
{% block search %}{% endblock %}
<div class="table-responsive col-sm-12">
<table class="table table-hover">
<thead>

View File

@@ -10,4 +10,15 @@ All Invoices
{% block description %}
<p>This page displays all invoices: outstanding, paid, and void</p>
{% endblock %}
{% block search %}
<div class="col-sm-3 col-sm-offset-9">
<form class="form form-horizontal col-sm-12">
<div class="form-group">
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
class="form-control"/>
</div>
</form>
</div>
{% endblock %}

View File

@@ -6,17 +6,21 @@
<em class="description">{{item.description|linebreaksbr}}</em>
</div>
</td>
{% if perms.RIGS.view_event %}
<td>£&nbsp;<span class="cost">{{item.cost|floatformat:2}}</span></td>
{% endif %}
<td class="quantity">{{item.quantity}}</td>
{% if perms.RIGS.view_event %}
<td>£&nbsp;<span class="sub-total" data-subtotal="{{item.total_cost}}">{{item.total_cost|floatformat:2}}</span></td>
{% endif %}
{% if edit %}
<td class="vert-align text-right">
<button type="button" class="item-edit btn btn-xs btn-default"
<button type="button" class="item-edit btn btn-xs btn-default"
data-pk="{{item.pk}}"
data-toggle="modal" data-target="#itemModal">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="item-delete btn btn-xs btn-danger"
<button type="button" class="item-delete btn btn-xs btn-danger"
data-pk="{{item.pk}}">
<span class="glyphicon glyphicon-remove"></span>
</button>

View File

@@ -3,9 +3,13 @@
<thead>
<tr>
<td>Item</td>
{% if perms.RIGS.view_event %}
<td>Price</td>
{% endif %}
<td>Quantity</td>
{% if perms.RIGS.view_event %}
<td>Sub-total</td>
{% endif %}
{% if edit %}
<td class="text-right">
<button type="button" class="btn btn-default btn-xs item-add"
@@ -22,6 +26,7 @@
{% include 'RIGS/item_row.html' %}
{% endfor %}
</tbody>
{% if perms.RIGS.view_event %}
<tfoot>
<tr>
<td rowspan="3" colspan="2"></td>
@@ -43,6 +48,7 @@
<td colspan="2">£ <span id="total">{{object.total|default:0|floatformat:2}}</span></td>
</tr>
</tfoot>
{% endif %}
</table>
</div>
<table class="hidden invisible">

View File

@@ -0,0 +1,70 @@
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
{% block title %}Search Help{% endblock %}
{% block content %}
<div class="row">
{% if not request.is_ajax %}
<div class="col-sm-12">
<h1>Search Help</h1>
</div>
{% endif %}
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Searching Events</h3>
</div>
<div class="panel-body">
<p>
Searches for entire query in:
<button type="button" class="btn btn-default btn-xs">name</button>
<button type="button" class="btn btn-default btn-xs">description</button> and
<button type="button" class="btn btn-default btn-xs">notes</button>
</p>
<p>You can search for an event by <button type="button" class="btn btn-default btn-xs">event_id</button> by entering an integer, or using the format <code>N01234</code></p>
<p>On the search results page you can also specify the date range for the <button type="button" class="btn btn-default btn-xs">start_date</button> of the event</p>
<p>Events are sorted in reverse <button type="button" class="btn btn-default btn-xs">start_date</button> order (most recent events at the top)</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Searching People/Organisations/Venues</h3>
</div>
<div class="panel-body">
<p>
Searches for entire search phrase in:
<button type="button" class="btn btn-default btn-xs">name</button>
<button type="button" class="btn btn-default btn-xs">email</button>
<button type="button" class="btn btn-default btn-xs">address</button>
<button type="button" class="btn btn-default btn-xs">notes</button> and
<button type="button" class="btn btn-default btn-xs">phone</button>
</p>
<p>You can search for an entry by <button type="button" class="btn btn-default btn-xs">id</button> by entering an integer</p>
<p>Entries are sorted in alphabetical order by <button type="button" class="btn btn-default btn-xs">name</button></p>
</div>
</div>
{% if perms.RIGS.view_invoice %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Searching Invoices</h3>
</div>
<div class="panel-body">
<p>
Searches for entire search phrase in:
<button type="button" class="btn btn-default btn-xs">event__name</button>
</p>
<p>You can search for an event's invoice by entering the <button type="button" class="btn btn-default btn-xs">event_id</button> using the format <code>N01234</code></p>
<p>You can search for an invoice by <button type="button" class="btn btn-default btn-xs">invoice_id</button> using the format <code>#01234</code></p>
<p>Entering a raw integer will search by both <button type="button" class="btn btn-default btn-xs">invoice_id</button> and <button type="button" class="btn btn-default btn-xs">event_id</button></p>
<p>Entries are sorted in reverse <button type="button" class="btn btn-default btn-xs">invoice_date</button> order</p>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}