mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
3ec904e3d3
|
|||
| f8508ad876 | |||
|
8020dc63bf
|
|||
|
20fefaac36
|
@@ -35,6 +35,8 @@ if DEBUG:
|
|||||||
ALLOWED_HOSTS.append('localhost')
|
ALLOWED_HOSTS.append('localhost')
|
||||||
ALLOWED_HOSTS.append('example.com')
|
ALLOWED_HOSTS.append('example.com')
|
||||||
ALLOWED_HOSTS.append('127.0.0.1')
|
ALLOWED_HOSTS.append('127.0.0.1')
|
||||||
|
ALLOWED_HOSTS.append('.app.github.dev')
|
||||||
|
CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
|
||||||
|
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
if not DEBUG:
|
if not DEBUG:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div>
|
<div id="event_status">
|
||||||
<span class="badge badge-{% if event.confirmed %}success{% elif event.cancelled %}dark{% else %}warning{% endif %}">Status: {{ event.get_status_display }}</span>
|
<span class="badge badge-{% if event.confirmed %}success{% elif event.cancelled %}dark{% else %}warning{% endif %}">Status: {{ event.get_status_display }}</span>
|
||||||
{% if event.is_rig %}
|
{% if event.is_rig %}
|
||||||
{% if event.sum_total > 0 %}
|
{% if event.sum_total > 0 %}
|
||||||
|
|||||||
@@ -1,18 +1,95 @@
|
|||||||
{% load namewithnotes from filters %}
|
{% load namewithnotes from filters %}
|
||||||
{% load markdown_tags %}
|
{% load markdown_tags %}
|
||||||
<div class="table-responsive">
|
<style>
|
||||||
<table class="table mb-0" id="event_table">
|
#event_table {
|
||||||
<thead>
|
display: grid;
|
||||||
<tr>
|
grid-template-columns: max-content auto;
|
||||||
<th scope="col">#</th>
|
column-gap: 1em;
|
||||||
<th scope="col">Dates & Times</th>
|
}
|
||||||
<th scope="col">Event Details</th>
|
.eventgrid {
|
||||||
<th scope="col">MIC</th>
|
display: inherit;
|
||||||
</tr>
|
grid-column: 1/5;
|
||||||
</thead>
|
grid-template-columns: subgrid;
|
||||||
<tbody>
|
padding: 1em;
|
||||||
|
}
|
||||||
|
.grid-header {
|
||||||
|
border-bottom: 1px solid grey;
|
||||||
|
border-top: 1px solid grey;
|
||||||
|
}
|
||||||
|
#event_status {
|
||||||
|
grid-column-start: 3;
|
||||||
|
}
|
||||||
|
#event_mic {
|
||||||
|
grid-row-start: 1;
|
||||||
|
grid-column-start: 4;
|
||||||
|
}
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
#event_table {
|
||||||
|
grid-template-columns: 1fr !important;
|
||||||
|
}
|
||||||
|
.eventgrid {
|
||||||
|
grid-column: 1/1 !important;
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
.grid-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#event_dates {
|
||||||
|
order: 2;
|
||||||
|
}
|
||||||
|
#event_status {
|
||||||
|
order: 3;
|
||||||
|
}
|
||||||
|
#event_mic {
|
||||||
|
grid-row-start: auto;
|
||||||
|
grid-column-start: 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
#event_table {
|
||||||
|
grid-template-columns: max-content;
|
||||||
|
column-gap: 0.5em;
|
||||||
|
}
|
||||||
|
.eventgrid {
|
||||||
|
grid-column: 1/3;
|
||||||
|
border: 1px solid grey;
|
||||||
|
}
|
||||||
|
#event_dates {
|
||||||
|
grid-row: 2;
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
#event_number {
|
||||||
|
grid-row: 1;
|
||||||
|
grid-column: 1;
|
||||||
|
}
|
||||||
|
#event_mic {
|
||||||
|
grid-column: 2;
|
||||||
|
}
|
||||||
|
#event_status {
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
.grid-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dt {
|
||||||
|
float: left;
|
||||||
|
clear: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
dd {
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="event_table">
|
||||||
|
<div class="eventgrid grid-header font-weight-bold">
|
||||||
|
<div id="event_number">#</div>
|
||||||
|
<div id="event_dates">Dates & Times</div>
|
||||||
|
<div>Event Details</div>
|
||||||
|
<div id="event_mic">MIC</div>
|
||||||
|
</div>
|
||||||
{% for event in events %}
|
{% for event in events %}
|
||||||
<tr class="{% if event.cancelled %}
|
<div class="eventgrid {% if event.cancelled %}
|
||||||
table-secondary
|
table-secondary
|
||||||
{% elif not event.is_rig %}
|
{% elif not event.is_rig %}
|
||||||
table-info
|
table-info
|
||||||
@@ -28,43 +105,49 @@
|
|||||||
table-warning
|
table-warning
|
||||||
{% endif %}" {% if event.cancelled %}style="opacity: 50% !important;"{% endif %} id="event_row">
|
{% endif %}" {% if event.cancelled %}style="opacity: 50% !important;"{% endif %} id="event_row">
|
||||||
<!---Number-->
|
<!---Number-->
|
||||||
<th scope="row" id="event_number">{{ event.display_id }}</th>
|
<div class="font-weight-bold d-none d-lg-block" id="event_number">{{ event.display_id }}</div>
|
||||||
<!--Dates & Times-->
|
<!--Dates & Times-->
|
||||||
<td id="event_dates" style="text-align: justify;">
|
<div id="event_dates" style="min-width: 180px;">
|
||||||
|
<dl>
|
||||||
{% if not event.cancelled %}
|
{% if not event.cancelled %}
|
||||||
{% if event.meet_at %}
|
{% if event.meet_at %}
|
||||||
<span class="text-nowrap">Meet: <strong>{{ event.meet_at|date:"D d/m/Y H:i" }}</strong></span>
|
<dt class="font-weight-normal">Meet:</dt>
|
||||||
|
<dd class="text-nowrap font-weight-bold text-lg-right">{{ event.meet_at|date:"D d/m/Y H:i" }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if event.access_at %}
|
{% if event.access_at %}
|
||||||
<br><span class="text-nowrap">Access: <strong>{{ event.access_at|date:"D d/m/Y H:i" }}</strong></span>
|
<dt class="font-weight-normal">Access:</dt>
|
||||||
|
<dd class="text-nowrap font-weight-bold text-lg-right">{{ event.access_at|date:"D d/m/Y H:i" }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="text-nowrap">Start: <strong>{{ event.start_date|date:"D d/m/Y" }}
|
<dt class="font-weight-normal">Start:</dt>
|
||||||
|
<dd class="text-nowrap font-weight-bold text-lg-right">{{ event.start_date|date:"D d/m/Y" }}
|
||||||
{% if event.has_start_time %}
|
{% if event.has_start_time %}
|
||||||
{{ event.start_time|date:"H:i" }}
|
{{ event.start_time|date:"H:i" }}
|
||||||
{% endif %}</strong>
|
{% endif %}
|
||||||
</span>
|
</dd>
|
||||||
{% if event.end_date %}
|
{% if event.end_date %}
|
||||||
<br>
|
<dt class="font-weight-normal">End:</dt>
|
||||||
<span class="text-nowrap">End: {% if event.end_date != event.start_date %}<strong>{{ event.end_date|date:"D d/m/Y" }}{% endif %}
|
<dd class="text-nowrap font-weight-bold text-lg-right">{{ event.end_date|date:"D d/m/Y" }}
|
||||||
{% if event.has_end_time %}
|
{% if event.has_end_time %}
|
||||||
{{ event.end_time|date:"H:i" }}
|
{{ event.end_time|date:"H:i" }}
|
||||||
{% endif %}</strong>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</dd>
|
||||||
|
{% endif %}
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
<!---Details-->
|
<!---Details-->
|
||||||
<td id="event_details" class="w-100">
|
<div id="event_details" class="w-100">
|
||||||
<h4>
|
<h4>
|
||||||
<a href="{% url 'event_detail' event.pk %}">
|
<a href="{% url 'event_detail' event.pk %}">
|
||||||
{{ event.name }}
|
<span class="d-inline d-lg-none">{{ event }}</span><span class="d-none d-lg-inline">{{ event.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% if event.venue %}
|
|
||||||
<small>at {{ event.venue|namewithnotes:'venue_detail' }}</small>
|
|
||||||
{% endif %}
|
|
||||||
{% if event.dry_hire %}
|
{% if event.dry_hire %}
|
||||||
<span class="badge badge-secondary">Dry Hire</span>
|
<span class="badge badge-secondary">Dry Hire</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<br class="d-none d-lg-inline">
|
||||||
|
{% if event.venue %}
|
||||||
|
<small>at {{ event.venue|namewithnotes:'venue_detail' }}</small>
|
||||||
|
{% endif %}
|
||||||
</h4>
|
</h4>
|
||||||
{% if event.is_rig and not event.cancelled %}
|
{% if event.is_rig and not event.cancelled %}
|
||||||
<h5>
|
<h5>
|
||||||
@@ -77,10 +160,11 @@
|
|||||||
{% if not event.cancelled and event.description %}
|
{% if not event.cancelled and event.description %}
|
||||||
<p>{{ event.description|markdown }}</p>
|
<p>{{ event.description|markdown }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% include 'partials/event_status.html' %}
|
{% include 'partials/event_status.html' %}
|
||||||
</td>
|
|
||||||
<!---MIC-->
|
<!---MIC-->
|
||||||
<td id="event_mic" class="text-nowrap">
|
<div id="event_mic" class="text-nowrap">
|
||||||
|
<span class="d-md-none align-middle">MIC:</span>
|
||||||
{% if event.mic %}
|
{% if event.mic %}
|
||||||
{% if perms.RIGS.view_profile %}
|
{% if perms.RIGS.view_profile %}
|
||||||
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
|
||||||
@@ -91,15 +175,9 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif event.is_rig %}
|
{% elif event.is_rig %}
|
||||||
<span class="fas fa-user-slash"></span>
|
<span class="fas fa-exclamation"></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
{% empty %}
|
{% endfor %}
|
||||||
<tr class="bg-warning">
|
|
||||||
<td colspan="4">No events found</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row align-items-center justify-content-between py-2 align-middle">
|
<div class="row align-items-center justify-content-between py-2 align-middle">
|
||||||
<div class="col-sm-12 col-md align-middle">
|
<div class="col-sm-12 col-md align-middle d-flex flex-wrap">
|
||||||
Key: <span class="table-success mr-1 px-2 rounded">Ready</span><span class="table-warning mr-1 px-2 rounded">Action Required</span><span class="table-danger mr-1 px-2 rounded">Needs MIC</span><span class="table-secondary mr-1 px-2 rounded">Cancelled</span><span class="table-info px-2 rounded">Non-Rig</span>
|
Key: <span class="table-success mr-1 px-2 rounded">Ready</span><span class="table-warning mr-1 px-2 rounded text-nowrap">Action Required</span><span class="table-danger mr-1 px-2 rounded text-nowrap">Needs MIC</span><span class="table-secondary mr-1 px-2 rounded">Cancelled</span><span class="table-info px-2 rounded text-nowrap">Non-Rig</span>
|
||||||
</div>
|
</div>
|
||||||
{% if perms.RIGS.add_event %}
|
{% if perms.RIGS.add_event %}
|
||||||
<div class="col text-right">
|
<div class="col text-right">
|
||||||
|
|||||||
4
app.json
4
app.json
@@ -4,7 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"postdeploy": "python manage.py migrate && python manage.py generateSampleData"
|
"postdeploy": "python manage.py migrate && python manage.py generateSampleData"
|
||||||
},
|
},
|
||||||
"stack": "heroku-20",
|
"stack": "heroku-22",
|
||||||
"env": {
|
"env": {
|
||||||
"DEBUG": {
|
"DEBUG": {
|
||||||
"required": true
|
"required": true
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
"url": "heroku/nodejs"
|
"url": "heroku/nodejs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://github.com/nottinghamtec/heroku-buildpack-python"
|
"url": "heroku/python"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ function browserSync(done) {
|
|||||||
spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'});
|
spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'});
|
||||||
// TODO Wait for Django server to come up before browsersync, it seems inconsistent
|
// TODO Wait for Django server to come up before browsersync, it seems inconsistent
|
||||||
browsersync.init({
|
browsersync.init({
|
||||||
notify: false,
|
notify: true,
|
||||||
open: false,
|
open: false,
|
||||||
port: 8001,
|
port: 8001,
|
||||||
proxy: '127.0.0.1:8000'
|
proxy: '127.0.0.1:8000'
|
||||||
|
|||||||
@@ -77,17 +77,8 @@
|
|||||||
border-collapse: separate !important;
|
border-collapse: separate !important;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
}
|
}
|
||||||
#event_table tr th {
|
|
||||||
border-right: 0 !important;
|
|
||||||
}
|
|
||||||
#event_table tr td {
|
|
||||||
border-left: 0 !important;
|
|
||||||
}
|
|
||||||
#event_table tr td:not(:last-child) {
|
|
||||||
border-right: 0 !important;
|
|
||||||
}
|
|
||||||
@each $color, $value in $theme-colors {
|
@each $color, $value in $theme-colors {
|
||||||
.table-#{$color} {
|
table.table-#{$color} {
|
||||||
> td,th {
|
> td,th {
|
||||||
border: 0.3em solid theme-color-level($color, -6) !important;
|
border: 0.3em solid theme-color-level($color, -6) !important;
|
||||||
}
|
}
|
||||||
@@ -96,6 +87,11 @@
|
|||||||
background-color: #222 !important;
|
background-color: #222 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#event_row.table-#{$color} {
|
||||||
|
border: 0.3em solid theme-color-level($color, -6) !important;
|
||||||
|
background-color: #222 !important;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
del {
|
del {
|
||||||
color: black;
|
color: black;
|
||||||
@@ -156,4 +152,7 @@
|
|||||||
.modal {
|
.modal {
|
||||||
overflow-y: auto !important; //Bootstrap Dark Theme overrides this to none for some insane reason so we need to change it back
|
overflow-y: auto !important; //Bootstrap Dark Theme overrides this to none for some insane reason so we need to change it back
|
||||||
}
|
}
|
||||||
|
.text-muted {
|
||||||
|
color: #c9c9c9 !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user