mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-25 23:58:23 +00:00
Compare commits
5 Commits
revert-594
...
be7b595edb
| Author | SHA1 | Date | |
|---|---|---|---|
| be7b595edb | |||
| 6d53df0c8b | |||
| 732a6e5c1e | |||
|
|
c6823bb9ac | ||
|
|
ec000beee8 |
5
.github/workflows/django.yml
vendored
5
.github/workflows/django.yml
vendored
@@ -15,10 +15,13 @@ jobs:
|
|||||||
PYTHONDONTWRITEBYTECODE: 1
|
PYTHONDONTWRITEBYTECODE: 1
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install libcairo2-dev
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: "3.10"
|
||||||
cache: 'pipenv'
|
cache: 'pipenv'
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
Pipfile
2
Pipfile
@@ -47,7 +47,7 @@ python-dateutil = "~=2.8.1"
|
|||||||
pytoml = "~=0.1.21"
|
pytoml = "~=0.1.21"
|
||||||
pytz = "~=2020.5"
|
pytz = "~=2020.5"
|
||||||
reportlab = "*"
|
reportlab = "*"
|
||||||
requests = "~=2.32.0"
|
requests = "~=2.32.3"
|
||||||
retrying = "~=1.3.3"
|
retrying = "~=1.3.3"
|
||||||
simplejson = "~=3.17.2"
|
simplejson = "~=3.17.2"
|
||||||
six = "~=1.15.0"
|
six = "~=1.15.0"
|
||||||
|
|||||||
1465
Pipfile.lock
generated
1465
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,11 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
import simplejson
|
import simplejson
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core import serializers
|
from django.core import serializers
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.utils.html import format_html
|
||||||
from reversion import revisions as reversion
|
from reversion import revisions as reversion
|
||||||
|
|
||||||
from RIGS import models
|
from RIGS import models
|
||||||
@@ -97,6 +98,9 @@ class EventForm(forms.ModelForm):
|
|||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
'You haven\'t provided any client contact details. Please add a person or organisation.',
|
'You haven\'t provided any client contact details. Please add a person or organisation.',
|
||||||
code='contact')
|
code='contact')
|
||||||
|
access = self.cleaned_data.get("access_at")
|
||||||
|
if 'warn-access' not in self.data and access is not None and access.date() < (self.cleaned_data.get("start_date") - timedelta(days=7)):
|
||||||
|
raise forms.ValidationError(format_html("Are you sure about that? Your access time seems a bit optimistic. If you're sure, save again. <input type='hidden' id='warn-access' name='warn-access' value='0'/>"), code='access_sanity')
|
||||||
return super().clean()
|
return super().clean()
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
{% for event in object_list %}
|
{% for event in object_list %}
|
||||||
<tr class="{{event.status_color}}">
|
<tr class="{{event.status_color}}">
|
||||||
<th scope="row"><a href="{% url 'event_detail' event.pk %}">{{ event.display_id }}</a><br>
|
<th scope="row"><a href="{% url 'event_detail' event.pk %}">{{ event.display_id }}</a><br>
|
||||||
<span class="text-muted">{{ event.get_status_display }}</span></th>
|
<span class="{% if event.get_status_display == 'Cancelled' %}text-danger{% endif %}">{{ event.get_status_display }}</span></th>
|
||||||
<td>{{ event.start_date }}</td>
|
<td>{{ event.start_date }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ event.name }}
|
{{ event.name }}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class TestEventCreate(BaseRigboardTest):
|
|||||||
|
|
||||||
# Fix it
|
# Fix it
|
||||||
self.page.end_date = datetime.date(2020, 1, 11)
|
self.page.end_date = datetime.date(2020, 1, 11)
|
||||||
self.page.access_at = datetime.datetime(2020, 1, 1, 9)
|
self.page.access_at = datetime.datetime(2020, 1, 8, 9)
|
||||||
self.page.dry_hire = True
|
self.page.dry_hire = True
|
||||||
self.page.status = "Booked"
|
self.page.status = "Booked"
|
||||||
self.page.collected_by = "Fred"
|
self.page.collected_by = "Fred"
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ $theme-colors: (
|
|||||||
"primary": #3A52A2
|
"primary": #3A52A2
|
||||||
) !default;
|
) !default;
|
||||||
$enable-shadows: true;
|
$enable-shadows: true;
|
||||||
|
$alert-color-level: 10;
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation">
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" style="position: absolute; left:0.5em; top: 2px;" href="{% if request.user.is_authenticated %}https://rigs.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
|
<a class="navbar-brand" href="{% if request.user.is_authenticated %}https://rigs.nottinghamtec.co.uk{%else%}https://nottinghamtec.co.uk{%endif%}">
|
||||||
<img src="{% static 'imgs/logo.webp' %}" width="40" height="40" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
|
<img src="{% static 'imgs/logo.webp' %}" class="mr-auto" style="max-height: 40px; position: absolute; left: 0.5em; top: 0;" alt="TEC's Logo: Serif 'TEC' vertically next to a blue box with the words 'PA and Lighting', surrounded by graduated rings" id="logo">
|
||||||
</a>
|
</a>
|
||||||
{% block titleheader %}
|
{% block titleheader %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -9,9 +9,11 @@
|
|||||||
<h1 class="col-sm-12 pb-3">R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
|
<h1 class="col-sm-12 pb-3">R<small class="text-muted">ig</small> I<small class="text-muted">nformation</small> G<small class="text-muted">athering</small> S<small class="text-muted">ystem</small></h1>
|
||||||
<h2 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%}</h2>
|
<h2 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%}</h2>
|
||||||
{% if now %}
|
{% if now %}
|
||||||
<div class="col-sm-12 alert alert-primary rounded-0 mx-auto">
|
<div class="col-sm-12">
|
||||||
{% for event in now %}
|
{% for event in now %}
|
||||||
|
<div class="alert alert-primary rounded-0">
|
||||||
Event {{ event }} is happening today! <a href="{% url 'event_checkin' event.pk %}" class="btn btn-success btn-sm modal-href align-baseline {% if request.user.current_event %}disabled{%endif%}"><span class="fas fa-user-clock"></span> <span class="d-none d-sm-inline">Check In</span></a><br/>
|
Event {{ event }} is happening today! <a href="{% url 'event_checkin' event.pk %}" class="btn btn-success btn-sm modal-href align-baseline {% if request.user.current_event %}disabled{%endif%}"><span class="fas fa-user-clock"></span> <span class="d-none d-sm-inline">Check In</span></a><br/>
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user