Refactor buildsystem to NPM/Gulp, port to BS4 & rewrite RIGS tests accordingly... (#412)

* Start to seperate versioning into its own app

* Start reworking invoice things

* Reduced overall font size a touch

* Improvements to generic lists

* Tweak some colours to be a bit less OTT

I need to work out if I can seperate background and primary colours like BS3 did

* Improvements to event table mobile

* First pass at mobile-ising the generic list

* Item table fixes

* Fixed fullcalendar print css not included

* Asset list table improvements

* Tweak asset list to be more in line with other lists

* Versioning template improvements

//TODO Rather than have seperate asset templates, convert 'id' into a template variable

* Tweak versioning templates to allow ID overrides

Asset specific templates begone. Still need to bring back the ID formatting for the Rigboard.

* Asset form fixes

* Use the right autocompleter.js...

* Breakout (most) user stuff to separate module

The model remains in RIGS for now, as it's pretty painful to move...

* Python Format/import opt

* Test Refactor Part 1 - Shuffle things around

* Fix migrations

TODO - need to ensure moved models are *moved* rather than deleted and recreated!

* Start on new tests

* Initial work on event create test reimpl

* Init other tests, more rigs test faffery

* Desaturate theme colors even more

Much closer to BS3

* Fix event item adding

Bit too heavy handed with the deduplication there Arona

* Initial refactor of event item testing

* Upgrade bootstrap-select

* Updated bootstrap-select for BS4

* Initial port of duplicate testing

Needs the latter half rewriting once we have an EventDetail POM

* Refactor date validation test

So close to killing test_functional.EventTest!

* Deduplication of testing code

* pep8

* Fix some tests

And some things that were actually borked

* FIX: Prevent setting access time after start time 

Cherry pick of d274ea4606. Will close #405.

* Refactor calendar tests

* FIX: Don't show asset buttons/history for basic users

* Really ought to get a pre-commit hook for pep8...

* Fully replace test_functional

* Dedupe generic search logic

* Fix the remaining tests

* Ensure submit button is scrolled to in tests

* Fix asset creation test + actually verify its results

* Make CI use latest (stable) chromedriver rather than some ancient one

Since Travis uses the latest stable chrome, should always match. Bash oneliner \o/

* Of course | is part of YAML syntax, of course...

Maybe this works.

* Update python version

Trying to get CI to match my local environment as much as possible...

* Minor test futzing

* Well that wasn't clever of me

* That was even less clever of me

* Revert to old submit wait behaviour

* What about if I did this

* Try disabling chrome cache

* Added screenshot recording of test failures

* Fixed RIGS tests not being run

* Fixed Pep8 - I promise I'll make a pre-commit hook sometime!

* Very initial work at togglable darktheme.

Dammit @alexdaniel654 just when I had my scope creep kinda under control. It'll be v. nice to have though...!

* More dark theme wangling

* Fix some asset template things

* FIX: CI Locale Issues

* Fix sample command

* Initial work at integrating the risk assessment

#136. No clever database structure as yet...

* FIX: Don't set every boolean input to radios

* Different approach to RA linking

* Move text definitions to somewhere more authoratitive

* FIX: Undo breakage causing autopep8

o.O

* Expand detail template

* Use correct view for RA history

* Initial work at coercing activity feed into showing RAs

Also shows Asset/Supplier on the homepage feed.

* Refactor activity feed template logic

Yay for removing arbitrary if/else chains!

* Initial work on caching activity feed

Server side that is. Ref #162.

* Start RA list template

* Refactor RA creation stuff, again

* Add H&S Details to Event Detail View

* Display venue notes in event detail

Notes are no use if nobody reads them. Not sure on this one.

* Add ability to filter event archive by status

Closes #168.

* Fix lingering naive time

* Use locmem cache in sqlite environments

Otherwise the tests just lock up totally. Should close #162

* Update dependencies

Mirrors/supersedes 0e67da82e2

* Add global ctrl/meta-enter shortcut for form submission

Wants rewriting for better efficiency, but hey, it works!

* Update dependencies

* Fix for a situation that should be impossible

* Fix navbar alignment

* FEAT: Improve 'omni'search

- Partialised template
- Added to assets header
- Added ability to search assets/suppliers
- Improved selection logic
- Have it display current query

* Move closemodal into PyRIGS

* Fix tests for search improvements

* Dark mode colour improvements

* Fix table colors for dry hires

* further darktheme fixes

* Remove the dark header from light theme

* Fix reload loops when CSS/JS is changed

* Move dark theme SCSS to separate file, fix inactive pagination styling

* Genercise detail pages

* Testing something re notes

I wonder if I can make that global, rather than per-template...

* Dark theme palette shenanigans

I just can't decide

* Match darktheme palette to forum darktheme palette

Why reinvent the wheel.

* Make supplier detail use the generic template

* Disable mobile event table PoC for now

* Remove the defaults from the RA fields + make them required

* More RA fixes

* Fixes to revisions for RAs

* Add bootstrap 4 test page

* Bunch of dark mode fixes from test page

* Do not use Django 'required' for radio selects

As this requires them to be True, whereas we just need to require that an option be entered.

* Properly fixed popover darktheme

* Fixed search for events

* Style fixes to asset list

* Start RA 'mark review' feature

* Add reviewing to revision history, fix RA editing not working

Also actually commit all the files, that helps

* Fix Power MIC being lost on RA edit

Why it is subtly different to the Event Update behaviour? Who knows

* Invalidate RA review if it is edited after review

* Start work on event checklist

* Add a button for creating and instantly voiding invoices

Handy dandy for when you have loads of cancelled events, like say, a pandemic

* Mooooore status chips, mooore

* Initial shenanigans on storing my overly fancy EC form

* Proof of concept for JSON parsing/storage

\o/

* Add new line functionality for vehicles/drivers

Might it have been easier to create 'dummy' models like with EventItems? Probably...

* Alter rig_count to not include un-checked-in dry hires

* Insert a divider between still-out dry hires and actually upcoming events on rigboard

* Initial work on new checklist handling. No more JSON!

* Versioning module now does magic

Automatic creation of views/urls for anything registered with reversion, with a small amount of hackage to preserve legacy stuff. (and the DAMNED asset IDs!) I would never get distracted...

* Cleanup

* Event checklist crew works

Mostly - its not happy with timezones

* Medium event power stuff done, barring worst case stuff

* Misc fixes

* Validation of power reqs

* Worst case points on checklist

* Templating improvements to RA/EC stuff

* Do event table color logic at python level

* Audit template fixes

* Restrict versioning to one level of depth for speed

Also fixed the template for nested changes

* Event properties internal/authorised always return a explicit boolean rather than sometimes None

* Use template filter for notes

* Fix list templates

TODO: Sensible place to define the 'expected answer' stuff.

* Fix cable table template

* Rethink rigboard color logic again

Also revert some broken stuff

* Test fixes

* Modify auth test so it doesn't try and test for external authorisations

Cause that's not a thing

* Why does this work

Bloody overzealous autoformatter...

* Formatting...

* Initial work on RA tests

* Pages/start of tests for EventChecklists

* Much better coverage of H&S things

* Cleanup & Squash migrations

* Fix wrong variable name in settings.py

* Fix broken invoice list template

* Add revision history to invoices/payments.

Also patches previously introduced reversion permissions hole.

Supersedes and closes #337.

* Various misc fixes

* Fix for my fix

* Curse youuuuu pep8

* Invoice template improvements

* Minor fixes

* More tweaks

* More fixes

* Major improvements/fixes to authorisation templates

* Add ability to mark event checklists as Large Event

This just disables the checks to allow the rest of it to be filled out for large events, though I expect paper forms may still be used...

* Remove database ID from generic list

* Put power threshold values in a collapse

* Use template filter for consistent removal of 'None links'

Plus cleaner template markup! More HTML-in-Python tho, which always feels a bit CSS-in-JS

* Tweak asset list markup

* Begin to change add buttons success -> primary

Also change search primary -> info to avoid clash

* Begin to improve event checklist on mobile

* Asset detail template improvements

* Fix #326 (again)

* Fix errors being squashed

* Fix rigboard validation tests

* Initial work on BS4 button templatetag

Newfeatureitis strikes again

* Allow multiple event checklists per event

TODO: Status chip now needs rethinking

* Minor event detail fixes

* Fix tests

* Rework button tag

* Mobile fixes for search

* Fix event checklist on mobile

* Redo light theme palette

* Switch rigboard new button to primary

* Kill off excess whitespace on rigboard

* Rigboard Timing display tweaks

* Fix tests

* Properly handle eventauthorisations in new versioning

It's not great, not terrible...

* Prevent creating duplicate revisions on event

Potential fix for #322 - I couldn't reproduce even before this change...

* Template improvements

* Minor test fixes

* Revert "Prevent creating duplicate revisions on event"

Apparently it was too strong at preventing dupes...

This reverts commit cce0ad0f9f.

# Conflicts:
#	RIGS/models.py

* Better approach to generic list templates + other deduplication

* Also apply better approach to generic detail pages

* One of these days I'll remember to test BEFORE pushing...

* And now the same for generic forms

* Display tick/cross rather than true/false in boolean version diffs

* Upgrade dependencies

* Fixes fixes fixes

* Fix dependency hell

Probably

* Correct handling of spaces in paperwork filenames

Also normalises display of Invoice IDs. Partial fix for #391.

* Buggerit millennium hand and shrimp

Knew I was gonna forget to fix the tests

* FIX: Set duplicated event status to provisional

Closes #398.

Flip flop. Flip flop.

* Update polyfill for datetime-local

Bloody Firefox. We love to hate you. Proper CSS of the fill to come, SoonTM.

Closes #391

* Curses!

* Minor typo fixes

* Initial pass at soop-consult confirmation screen for RAs

* Fix migration

* Make venue/date editable on EC

For multi venue, multi day events

Defaults to date and venue set on the event. Also made power MIC default to that set in RA

* Clearer logic for RA inverted fields

* (probably) fix tests

* Give keyholders supplier edit perm

* Generic list only displays edit button if user has perm

* Same perm check for generic details

* H&S Details takes up free space on non-internal events

* Remove flash of content when loading new rig page

* First pass at clearer display of asset list filters

* Fix tests / default to headless tests

(fingers crossed)

* Fix autocompleter.js to properly disable edit links again

* Move status color logic back to template

Cause that somehow makes it work better??

* Display note icon on event detail page

* Fix caching

* Put rounded corners back where they belong

* Remove lingering use of 'page-header'

BS removed that style

* More search and replace for BS changes

Thought I'd got them all. Clearly not!

* Remove enforced linebreak on status chips

* Fix horizontal-ness on some forms

* Remove animation on prefers-reduced-motion/low referesh rate devices

Also normalises handling of asset list cable table & improves its use of space on large devices

* Make version changes badges more readable

* First pass at making the calendar less crap

* Fix event table success logic

Yay for copy paste fails >.>

* Use borders rather than block colors for coloured tables under darktheme

* First pass at porting calendar from FC V3 to V5

Two major versions and all they did was rename a bunch of names...TWICE.

* Rework version name method to avoid blank names on eventchecklist vehicles/crew

* Fix cable test

* Made radio button focus much more obvious on dark theme

* Implement Jerb's wording changes

* Fix one test, break another...

* Fix recent change stream list mutation issue

* FIX: Do not naively cache event table

Not that easy, it turns out. Duh.

* FEAT: Implement #413 show associated assets on cable type detail pg

Closes #413

* Allow H&S for non-events

* Update emergency contact number

* Improvements to profile detail page

* Implement some of Jonny's suggested changes

TODO:
- Define event size at RA time, pass through to EC
- Have later power questions be context dependent

* Test fixes

* Add space for power/rigging plans to be linked to RAs

* Start move of event size logic to RA from Ec

* Javascript required shenanigans for RA power

* More moving of event size logic

* Fixing tests for new logic etc

* Why does this work

Indeed, it may not

* FIX: Stupid typo in versioning.py

* Further minor fixes to versioning

* Add icons to H&S menu items

* Should fix calendar breaking in production

* Small alignment fix in asset list

* Squash migrations

Co-authored-by: Matthew Smith <psyms13@nottingham.ac.uk>
This commit is contained in:
2021-01-23 22:22:37 +00:00
committed by GitHub
parent 099a184f2e
commit 3414204209
336 changed files with 59425 additions and 33101 deletions

View File

@@ -0,0 +1,40 @@
{% extends "admin/base_site.html" %}
{% load i18n l10n %}
{% block content %}
<form action="" method="post">{% csrf_token %}
<p>The following objects will be merged. Please select the 'master' record which you would like to keep. Other records will have associated events moved to the 'master' copy, and then will be deleted.</p>
<table>
{% for form in forms %}
{% if forloop.first %}
<tr>
<th></th>
<th> ID </th>
{% for field in form %}
<th>{{ field.label }}</th>
{% endfor %}
</tr>
{% endif %}
<tr>
<td><input type="radio" name="master" value="{{form.instance.pk|unlocalize}}"></td>
<td>{{form.instance.pk}}</td>
{% for field in form %}
<td> {{ field.value }} </td>
{% endfor %}
</tr>
{% endfor %}
</table>
<div>
{% for obj in queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}" />
{% endfor %}
<input type="hidden" name="action" value="merge" />
<input type="hidden" name="post" value="yes" />
<input type="submit" value="Merge them" />
</div>
</form>
{% endblock %}

View File

@@ -7,23 +7,22 @@
xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
lang="{% firstof LANGUAGE_CODE 'en' %}">
<head>
<title>{% block title %}{% endblock %} | Rig Information Gathering System</title>
<title>{% block title %}{{page_title|striptags}}{% endblock %} | Rig Information Gathering System</title>
<meta name="viewport" content="initial-scale=1">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<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="icon" type="image/png" href="{% static 'imgs/pyrigs-avatar.png' %}">
<link rel="apple-touch-icon" href="{% static 'imgs/pyrigs-avatar.png' %}">
<link href='{% static 'fonts/OPENSANS-REGULAR.TTF' %}'>
<link rel="stylesheet" type="text/css" href="{% static "css/screen.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 src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/popper.js' %}"></script>
<script src="{% static 'js/raven.js' %}"></script>
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
{% block preload_js %}
{% endblock %}
@@ -32,89 +31,49 @@
</head>
<body>
<a class="skip-link" href='#main'>Skip to content</a>
{% include "analytics.html" %}
<div class="navbar navbar-fixed-top navbar-inverse hidden-print" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
{% block titleheader %}
{% block navbar %}
<nav class="navbar 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">
{% block titleelements %}
{% endblock %}
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
{% block titleelements %}
{% endblock %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown" id="user">
{% if user.is_authenticated %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-user"></span>
Hi {{ user.first_name }}
<b class="caret"></b>
</a>
<ul class="dropdown-menu nav media-list pull-right" id="userdropdown">
<li class="media">
<a href="{% url 'profile_detail' %}">
<div class="media-left">
<img src="{{ request.user.profile_picture }}" class="media-object"/>
</div>
<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>
<div class="col-sm-12 text-right">
<a href="{% url 'logout' %}" class="btn btn-primary">Logout</a>
</div>
</li>
</ul>
{% else %}
<a href="{% url "login" %}">
<span class="icon-user"></span>
Login
</a>
{% endif %}
</li>
</ul>
</div>
</div>
</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">&times;</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endblock %}
{% block content %}{% endblock %}
</div>
<div id="sidebar" class="column">
{% block sidebar %}
{% endblock %}
</div>
</ul>
<ul class="navbar-nav ml-auto">
{% block titleelements_right %}
{% endblock %}
</ul>
</div>
</div>
</nav>
{% endblock %}
<div class="container py-4" id="main">
{% 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">&times;</span></button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endblock %}
{% if page_title and not request.is_ajax %}
<h2>{{page_title|safe}}</h2>
{% endif %}
{% block content %}{% endblock %}
</div>
<div class="modal fade" id="modal" role="dialog" tabindex=-1></div>
@@ -127,15 +86,16 @@
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 src="{% static 'js/util.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 src="{% static "js/konami.js" %}"></script>
<script src="{% static 'js/dropdown.js' %}"></script>
<script src="{% static 'js/modal.js' %}"></script>
<script src="{% static 'js/konami.js' %}"></script>
<script src="{% static 'js/all.js' %}"></script> <!---FontAwesome--->
<script>
jQuery(document).ready(function () {
jQuery(document).on('click', '.modal-href', function (e) {
@@ -163,6 +123,17 @@
easter_egg.load();
});
</script>
<script src="{% static 'js/dark-mode-switch.min.js' %}"></script>
<script>
document.body.addEventListener('keydown', function(e) {
if(e.keyCode == 13 && (e.metaKey || e.ctrlKey)) {
var target = e.target;
if(target.form) {
target.form.submit();
}
}
});
</script>
{% block js %}
{% endblock %}
</body>

View File

@@ -1,8 +1,10 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">{% block title %}{% endblock %}</h4>
<h4 class="modal-title">{{page_title}}{% block title %}{% endblock %}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{% block content %}{% endblock %}

View File

@@ -1,42 +0,0 @@
{% extends 'base.html' %}
{% block extrahead %}
<meta name="google" content="notranslate">
{% endblock %}
{% block titleheader %}
<a class="nav navbar-brand navbar-left" href="/"><i class="glyphicon glyphicon-circle-arrow-left" style="vertical-align: middle !important;"></i> RIGS</a>
<a class="nav navbar-brand" href="{% url 'asset_index' %}">Assets</a>
{% endblock %}
{% block titleelements %}
<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 %}
<li role="separator" class="divider"></li>
<li><a href="{% url 'cable_type_list' %}"><span class="glyphicon glyphicon-list"></span>
List Cable Types</a></li>
{% if perms.assets.add_cable_type %}
<li><a href="{% url 'cable_type_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Cable Type</a></li>
{% endif %}
</ul>
</li>
<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_supplier %}
<li><a href="{% url 'supplier_create' %}"><span class="glyphicon glyphicon-plus"></span> Create Supplier</a></li>
{% endif %}
</ul>
</li>
{% if perms.assets.view_asset %}
<li><a href="{% url 'asset_activity_table' %}">Recent Changes</a></li>
<li><a href="{% url 'asset_audit_list' %}">Audit</a></li>
{% endif %}
{% endblock %}

View File

@@ -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">&times;</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">
@@ -78,48 +13,10 @@
<h2>Please wait</h2>
</div>
<div class="modal-body">
<div class="loading-animation">
<div class="circle"></div>
<div class="circle1"></div>
<div class="spinner-border text-primary" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</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>

View File

@@ -11,21 +11,18 @@
<base target="_blank" />
<!-- Open all links in a new tab, not in the iframe -->
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700,300,400' rel='stylesheet'
type='text/css'>
<link href='{% static 'fonts/OPENSANS-REGULAR.TTF' %}'>
<link rel="stylesheet" type="text/css" href="{% static "css/screen.css" %}">
<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/jquery.js' %}"></script>
<script src="{% static 'js/raven.js' %}"></script>
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
</head>
<body>
{% include "analytics.html" %}
<div class="embed_container">
<div class="container-fluid">
{% if messages %}
@@ -42,7 +39,6 @@
{% endblock %}
</div>
</div>
{% block js %}
{% endblock %}
</body>

View File

@@ -1,54 +0,0 @@
{% 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 %}

2739
templates/bootstrap.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,15 +2,15 @@
{% if form.errors %}
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<dl class="dl-horizontal">
<dl>
{% with form|nice_errors as qq %}
{% for error_name,desc in qq.items %}
<span>
<dt>{{error_name}}</dt>
<dd>{{desc}}</dd>
</span>
<span class="row">
<dt class="col-4">{{error_name}}</dt>
<dd class="col-8">{{desc}}</dd>
</span>
{% endfor %}
{% endwith %}
</dl>
</div>
{% endif %}
{% endif %}

View File

@@ -0,0 +1,76 @@
{% extends override|default:"base_rigs.html" %}
{% load widget_tweaks %}
{% load button from filters %}
{% block content %}
<div class="row">
<div class="col">
<div class="card border-info">
<div class="card-header">{{ type }} Details</div>
<div class="card-body">
<dl class="dl-horizontal">
<dt>Name</dt>
<dd>{{ object.name }}</dd>
<dt>Phone</dt>
<dd><a href="tel:{{ object.phone }}">{{ object.phone }}</a></dd>
<dt>Email</dt>
<dd><a href="mailto:{{ object.email }}"><span class="overflow-ellipsis">{{ object.email }}</span></a></dd>
<dt>Address</dt>
<dd>{{ object.address|linebreaksbr }}</dd>
<dt>Notes</dt>
<dd>{{ object.notes|linebreaksbr }}</dd>
{% if object.three_phase_available is not None %}
<dt>Three Phase Available</dt>
<dd>{{ object.three_phase_available|yesno|capfirst }}</dd>
{% endif%}
{% if object.union_account is not None %}
<dt>Union Account</dt>
<dd>{{ object.union_account|yesno|capfirst }}</dd>
{% endif%}
</dl>
</div>
</div>
</div>
{% if associated %}
{% include associated|safe %}
{% endif %}
</div>
{% if associated2 %}
{% include associated2|safe %}
{% endif %}
{% if not request.is_ajax %}
<div class="row py-2">
<div class="col-sm-12 text-right">
{% if can_edit %}
<div class="btn-group">
{% button 'edit' update_link object.pk %}
</div>
{% endif %}
{% include 'partials/last_edited.html' with target=history_link %}
</div>
</div>
{% endif %}
{% endblock %}
{% if request.is_ajax %}
{% block footer %}
<div class="row py-2">
<div class="col-sm-12 text-right">
<div class="btn-group btn-page">
<a href="{% url detail_link object.pk %}" class="btn btn-primary"><span
class="fas fa-eye"></span> Open Page</a>
{% if can_edit %}
{% button 'edit' update_link object.pk %}
{% endif %}
</div>
{% include 'partials/last_edited.html' with target=history_link %}
</div>
</div>
{% endblock %}
{% endif %}

View File

@@ -0,0 +1,78 @@
{% extends override|default:"base_rigs.html" %}
{% load button from filters %}
{% load widget_tweaks %}
{% block content %}
<div class="col">
<form action="{{ form.action|default:request.path }}" method="post">{% csrf_token %}
<div class="row">
<div class="col-md-6">
{% include 'form_errors.html' %}
<div class="form-group form-row">
<label for="{{ form.name.id_for_label }}"
class="col-sm-2 control-label">{{ form.name.label }}</label>
<div class="col-sm-10">
{% render_field form.name class+="form-control" placeholder=form.name.label %}
</div>
</div>
<div class="form-group form-row">
<label for="{{ form.phone.id_for_label }}"
class="col-sm-2 control-label">{{ form.phone.label }}</label>
<div class="col-sm-10">
{% render_field form.phone class+="form-control" type="tel" placeholder=form.phone.label %}
</div>
</div>
<div class="form-group form-row">
<label for="{{ form.email.id_for_label }}"
class="col-sm-2 control-label">{{ form.email.label }}</label>
<div class="col-sm-10">
{% render_field form.email class+="form-control" type="email" placeholder=form.email.label %}
</div>
</div>
<div class="form-group form-row">
<label for="{{ form.address.id_for_label }}"
class="col-sm-2 control-label">{{ form.address.label }}</label>
<div class="col-sm-10">
{% render_field form.address class+="form-control" placeholder=form.address.label %}
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group form-row">
<label for="{{ form.notes.id_for_label }}"
class="col-sm-2 control-label">{{ form.notes.label }}</label>
<div class="col-sm-10">
{% render_field form.notes class+="form-control" placeholder=form.notes.label %}
</div>
</div>
{% if form.three_phase_available is not None %}
<div class="form-group form-row">
<div class="col-sm-10 col-sm-offset-2">
<div class="checkbox">
<label>
{% render_field form.three_phase_available %} {{ form.three_phase_available.label }}
</label>
</div>
</div>
</div>
{% endif %}
{% if form.union_account is not None %}
<div class="form-group form-row">
<div class="col-sm-10 col-sm-offset-2">
<div class="checkbox">
<label>
{% render_field form.union_account %} {{ form.union_account.label }}
</label>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="form-group text-right">
{% button 'submit' %}
</div>
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,61 @@
{% extends override|default:"base_rigs.html" %}
{% load url_replace from filters %}
{% load orderby from filters %}
{% load paginator from filters %}
{% load linkornone from filters %}
{% load button from filters %}
{% block content %}
{% include 'partials/list_search.html' %}
<div class="row py-3">
<div class="col text-right">
{% button 'new' url=create %}
</div>
</div>
<div class="row">
<div class="col">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Name<a href="?{% orderby request 'orderBy' 'name' %}"><span class="caret"></span></a></td>
<th scope="col">Email</th>
<th scope="col">Phone</th>
<th scope="col">Notes</th>
{% if union_account %} {#TODO#}
<th scope="col">Union Account</th>
{% endif %}
<th scope="col">Quick Links</th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
<tr id="row_item">
<th scope="row" class="align-middle" id="cell_name">{{ object.name }}</th>
<td class="align-middle">{{ object.email|linkornone:'mailto' }}</td>
<td class="align-middle">{{ object.phone|linkornone:'tel' }}</td>
<td class="align-middle">{{ object.notes|yesno|capfirst }}</td>
{% if union_account %}
<td>{{ object.union_account|yesno|capfirst }}</td>
{% endif %}
<td>
<div class="btn-group d-flex" role="group">
{% button 'view' url=detail pk=object.pk clazz="btn-sm modal-href" %}
{% if can_edit %}
{% button 'edit' url=edit pk=object.pk clazz="btn-sm modal-href" %}
{% endif %}
</div>
</td>
</tr>
{% empty %}
<tr class="table-warning">
<td colspan="6" class="text-center">Nothing found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% paginator %}
{% endblock%}

47
templates/index.html Normal file
View File

@@ -0,0 +1,47 @@
{% extends 'base_rigs.html' %}
{% load humanize %}
{% block title %}RIGS{% endblock %}
{% block content %}
<div class="row">
<h1 class="col-sm-12 pb-3">R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small class="text-muted"> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
<h4 class="col-sm-12 pb-3">Welcome back {{ user.get_full_name }}, there {%if rig_count == 1 %}is one rig coming up{%else%}are {{ rig_count|apnumber }} rigs coming up.{%endif%}</h4>
<div class="col-sm mb-3">
<div class="card">
<h4 class="card-header">Rigboard</h4>
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="{% url 'rigboard' %}"><i class="fas fa-list"></i> Rigboard</a>
<a class="list-group-item list-group-item-action" href="{% url 'web_calendar' %}"><i class="fas fa-calendar"></i> Calendar</a>
{% if perms.RIGS.add_event %}
<a class="list-group-item list-group-item-action" href="{% url 'event_create' %}"><i class="fas fa-plus"></i> New Event</a>
{% endif %}
</div>
<h4 class="card-header">Asset Database</h4>
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="{% url 'asset_index' %}"><i class="fas fa-tag"></i> Asset List </a>
{% if perms.assets.add_asset %}
<a class="list-group-item list-group-item-action" href="{% url 'asset_create' %}"><i class="fas fa-plus"></i> New Asset</a>
{% endif %}
<a class="list-group-item list-group-item-action" href="{% url 'supplier_list' %}"><i class="fas fa-parachute-box"></i> Supplier List </a>
{% if perms.assets.add_asset %}
<a class="list-group-item list-group-item-action" href="{% url 'supplier_create' %}"><i class="fas fa-plus"></i> New Supplier</a>
{% endif %}
</div>
<h4 class="card-header">Quick Links</h4>
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="https://forum.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><i class="fas fa-comment-alt"></i> TEC Forum</a>
<a class="list-group-item list-group-item-action" href="//wiki.nottinghamtec.co.uk" target="_blank" rel="noopener noreferrer"><i class="fas fa-pen-square"></i> TEC Wiki</a>
{% if perms.RIGS.view_event %}
<a class="list-group-item list-group-item-action" href="//members.nottinghamtec.co.uk/price" target="_blank"><i class="fas fa-pound-sign"></i> Price List</a>
{% endif %}
</div>
</div>
</div>
{% if perms.RIGS.view_event %}
<div class="col-sm">
{% include 'activity_feed.html' %}
</div>
{% endif %}
</div><!---end row--->
{% endblock %}

View File

@@ -1,36 +1,42 @@
{% load url_replace from filters %}
{% if is_paginated %}
{% load url_replace from filters %}
<div>
<ul class="pagination">
{% if has_previous %}
<li><a href="?{% url_replace request 'page' previous %}" class="prev">&lsaquo;&lsaquo;</a></li>
{% else %}
<li class="disabled prev"><a href="#">&lsaquo;&lsaquo;</a></li>
{% endif %}
<div class="row justify-content-center pt-3">
<nav>
<ul class="pagination">
{% if has_previous %}
<li class="page-item"><a class="page-link" href="?{% url_replace request 'page' previous %}">&lsaquo;&lsaquo;</a></li>
{% else %}
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&lsaquo;&lsaquo;</span>
</li>
{% endif %}
{% if show_first %}
<li><a href="?{% url_replace request 'page' first %}" class="prev">{{ first }}</a></li>
<li><span>&hellip;</span></li>
<li class="page-item"><a class="page-link" href="?{% url_replace request 'page' first %}" class="prev">{{ first }}</a></li>
<li class="page-item disabled"><span class="page-link">&hellip;</span></li>
{% endif %}
{% for page in page_numbers %}
{% ifequal page page_obj.number %}
<li class="current page active"><a href="#">{{ page }}</a></li>
<li class="page-item active"><a class="page-link" href="#">{{ page }}</a></li>
{% else %}
<li><a href="?{% url_replace request 'page' page %}" class="page">{{ page }}</a></li>
<li class="page-item"><a class="page-link" href="?{% url_replace request 'page' page %}" class="page">{{ page }}</a></li>
{% endifequal %}
{% endfor %}
{% if show_last %}
<li><span>&hellip;</span></li>
<li><a href="?{% url_replace request 'page' last %}" class="prev">{{ last }}</a></li>
<li class="page-item disabled"><span class="page-link">&hellip;</span></li>
<li class="page-item"><a class="page-link" href="?{% url_replace request 'page' last %}" class="prev">{{ last }}</a></li>
{% endif %}
{% if has_next %}
<li><a href="?{% url_replace request 'page' next %}" class="next">&rsaquo;&rsaquo;</a></li>
<li class="page-item"><a class="page-link" href="?{% url_replace request 'page' next %}" class="next">&rsaquo;&rsaquo;</a></li>
{% else %}
<li class="disabled next"><a href="#">&rsaquo;&rsaquo;</a></li>
<li class="page-item disabled">
<span class="page-link" aria-hidden="true">&rsaquo;&rsaquo;</span>
</li>
{% endif %}
</ul>
</div>
{% endif %}
</ul>
</nav>
</div>
{% endif %}

View File

@@ -0,0 +1,10 @@
<div class="col-sm">
<div class="card">
<div class="card-header">Associated Organisations</div>
<ul class="list-group list-group-flush">
{% for organisation,count in object.organisations %}
<a class="list-group-item list-group-item-action" href="{% url 'organisation_detail' organisation.pk %}">{{ organisation.pk|stringformat:"05d" }} | {{ organisation.name }} <span class="badge badge-secondary" title="{{count}} events with {{object.name}} for {{organisation.name}}">{{count}}</span></a>
{% endfor %}
</ul>
</div>
</div>

View File

@@ -0,0 +1,7 @@
{% if submit %}
<button type="submit" class="btn {{ class }}" title="{{ text }}" {% if id %}id="{{id}}"{%endif%} {% if style %}style="{{style}}"{%endif%}><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></button>
{% elif pk %}
<a href="{% url target pk %}" class="btn {{ class }}" {% if id %}id="{{id}}"{%endif%} {% if style %}style="{{style}}"{%endif%} {% if text == 'Print' %}target="_blank"{%endif%}><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></a>
{% else %}
<a href="{% url target %}" class="btn {{ class }}" {% if id %}id="{{id}}"{%endif%} {% if style %}style="{{style}}"{%endif%}><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></a>
{% endif %}

View File

@@ -0,0 +1,34 @@
{% load static %}
<script>
function initDatetime() {
$('input[type=datetime-local]').not(':disabled').flatpickr({
dateFormat: 'Y-m-dTH:m',
enableTime: true,
allowInput: true,
altInput: true,
altFormat: "d/m/y H:m",
});
}
$(document).ready(function () {
function supportsDateTime() {
var input = document.createElement('input');
input.setAttribute('type','datetime-local');
return input.type !== "text";
}
//Firefox reports support for datetime-local without properly supporting it. Bah.
if(!supportsDateTime() || navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
$('<link>')
.appendTo('head')
.attr({type : 'text/css', rel : 'stylesheet'})
.attr('href', '{% static "css/flatpickr.css" %}');
$.when(
$.getScript( '{% static "js/flatpickr.min.js" %}' ),
$.Deferred(function(deferred){
$(deferred.resolve);
})
).done(function(){
initDatetime();
});
}
});
</script>

View File

@@ -0,0 +1,13 @@
{% load button from filters %}
<div class="row">
<div class="col">
<form class="form-inline justify-content-end">
{% csrf_token %}
<div class="input-group">
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
class="form-control" id="id_search_text"/>
<span class="input-group-append">{% button 'search' id="id_search" %}</span>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,38 @@
{% if user.is_authenticated %}
<form id="searchForm" class="form-inline flex-nowrap mx-md-3 px-2 border border-light rounded" role="form" method="GET" action="{% url 'event_archive' %}">
<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..." value="{{ request.GET.q }}" />
</div>
<select id="search-options" class="custom-select form-control" style="border-top-right-radius: 0px; border-bottom-right-radius: 0px; width: 20ch;">
<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 %}
<option data-action="{% url 'asset_list' %}" href="#">Assets</option>
<option data-action="{% url 'supplier_list' %}" href="#">Suppliers</option>
</select>
</div>
<button class="btn btn-info form-control form-control-sm btn-sm w-25" style="border-top-left-radius: 0px;border-bottom-left-radius: 0px;"><span class="fas fa-search"></span><span class="sr-only"> Search</span></button>
<a href="{% url 'search_help' %}" class="nav-link modal-href ml-2"><span class="fas fa-question-circle"></span></a>
</form>
{% endif %}
{% block js %}
<script>
$('#search-options').change(function(){
$('#searchForm').attr('action', $(this).children('option:selected').data('action'));
});
$(document).ready(function(){
$('#id_search_input').keypress(function (e) {
if (e.which == 13) {
$('#searchForm').attr('action', $('#search-options option').first().data('action')).submit();
return false;
}
});
});
</script>
{% endblock %}

View File

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

View File

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

View File

@@ -18,10 +18,10 @@
<p>Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly.</p>
<div class="col-sm-8 col-sm-offset-2">
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
<form action="" method="post" class="" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-4">{{ field.label }}</label>
<label for="{{ field.id_for_label }}" class="col-form-label col-sm-4">{{ field.label }}</label>
<div class="controls col-sm-8">
{% render_field field class+="form-control" placeholder=field.label %}
</div>

View File

@@ -22,18 +22,18 @@
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="post" role="form" class="form-horizontal">{% csrf_token %}
<form action="" method="post" role="form" class="">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.new_password1.id_for_label}}" class="col-sm-4 control-label">{{form.new_password1.label}}</label>
<label for="{{form.new_password1.id_for_label}}" class="col-sm-4 col-form-label">{{form.new_password1.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password1 class+="form-control" %}
</div>
</div>
<div class="form-group">
<label for="{{form.new_password2.id_for_label}}" class="col-sm-4 control-label">{{form.new_password2.label}}</label>
<label for="{{form.new_password2.id_for_label}}" class="col-sm-4 col-form-label">{{form.new_password2.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password2 class+="form-control" %}
</div>

View File

@@ -11,12 +11,12 @@
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="POST" role="form" class="form-horizontal">{% csrf_token %}
<form action="" method="POST" role="form" class="">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.email.id_for_label}}" class="col-sm-2 control-label">{{form.email.label}}</label>
<label for="{{form.email.id_for_label}}" class="col-sm-2 col-form-label">{{form.email.label}}</label>
<div class="col-sm-10">
{% render_field form.email type="email" class+="form-control" %}
</div>

View File

@@ -13,10 +13,10 @@
{% endif %}
<div class="col-sm-8 col-sm-offset-2">
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
<form action="" method="post" class="" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-4">{{ field.label }}</label>
<label for="{{ field.id_for_label }}" class="col-form-label col-sm-4">{{ field.label }}</label>
<div class="controls col-sm-8">
{% render_field field class+="form-control" placeholder=field.label %}
</div>

View File

@@ -0,0 +1,75 @@
{% 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="card card-default">
<div class="card-header">
<h3 class="card-title">Searching Events</h3>
</div>
<div class="card-body">
<p>
Searches for entire query in:
<span class="badge badge-dark">name</span>
<span class="badge badge-dark">description</span> and
<span class="badge badge-dark">notes</span>
</p>
<p>You can search for an event by <span class="badge badge-dark">event_id</span> 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 <span class="badge badge-dark">start_date</span> of the event</p>
<p>Events are sorted in reverse <span class="badge badge-dark">start_date</span> order (most recent events at the top)</p>
</div>
<div class="card-header">
<h3 class="card-title">Searching People/Organisations/Venues/Suppliers</h3>
</div>
<div class="card-body">
<p>
Searches for entire search phrase in:
<span class="badge badge-dark">name</span>
<span class="badge badge-dark">email</span>
<span class="badge badge-dark">address</span>
<span class="badge badge-dark">notes</span> and
<span class="badge badge-dark">phone</span>
</p>
<p>You can search for an entry by <span class="badge badge-dark">id</span> by entering an integer</p>
<p>Entries are sorted in alphabetical order by <span class="badge badge-dark">name</span></p>
</div>
{% if perms.RIGS.view_invoice %}
<div class="card-header">
<h3 class="card-title">Searching Invoices</h3>
</div>
<div class="card-body">
<p>
Searches for entire search phrase in:
<span class="badge badge-dark">event__name</span>
</p>
<p>You can search for an event's invoice by entering the <span class="badge badge-dark">event_id</span> using the format <code>N01234</code></p>
<p>You can search for an invoice by <span class="badge badge-dark">invoice_id</span> using the format <code>#01234</code></p>
<p>Entering a raw integer will search by both <span class="badge badge-dark">invoice_id</span> and <span class="badge badge-dark">event_id</span></p>
<p>Entries are sorted in reverse <span class="badge badge-dark">invoice_date</span> order</p>
</div>
{% endif %}
<div class="card-header">
<h3 class="card-title">Searching Assets</h3>
</div>
<div class="card-body">
<p>
Searches for entire search phrase in:
<span class="badge badge-dark">description</span> and
<span class="badge badge-dark">serial number</span>
</p>
<p>
Will also attempt to exact match <span class="badge badge-dark">asset ID</span>
</p>
<p>Entries are sorted in alphanumerical order by <span class="badge badge-dark">asset ID</span></p>
</div>
</div>
</div>
</div>
{% endblock %}