mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
First pass at reworked rigboard layout on mobile
This commit is contained in:
@@ -74,29 +74,9 @@
|
||||
</h5>
|
||||
{% endif %}
|
||||
{% if not event.cancelled and event.description %}
|
||||
<div>
|
||||
{{ event.description|linebreaksbr }}
|
||||
</div>
|
||||
<p>{{ event.description|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
<!---Overall status at a glance--->
|
||||
<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.purchase_order %}
|
||||
<span class="badge badge-success">PO: {{ event.purchase_order }}</i></span>
|
||||
{% elif event.authorised %}
|
||||
<span class="badge badge-success">Payment: Authorised <i class="fas fa-check"></i></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">Payment: <i class="fas fa-times"></i></span>
|
||||
{% endif %}
|
||||
<!-- TODO show invoice stuff here -->
|
||||
|
||||
{% if event.risk_assessment_edit_url %}
|
||||
<span class="badge badge-success">RA: <i class="fas fa-check"></i></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">RA: <i class="fas fa-times"></i></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'partials/event_status.html' %}
|
||||
</td>
|
||||
<!---MIC-->
|
||||
<td>
|
||||
|
||||
38
RIGS/templates/event_table_mobile.html
Normal file
38
RIGS/templates/event_table_mobile.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% for event in events %}
|
||||
<div class="card my-1
|
||||
{% if event.cancelled %}
|
||||
text-muted border-secondary
|
||||
{% elif event.authorised and event.risk_assessment_edit_url and event.mic %}
|
||||
border-success
|
||||
{% elif not event.is_rig %}
|
||||
border-info
|
||||
{% else %}
|
||||
border-warning
|
||||
{% endif %}
|
||||
">
|
||||
<div class="card-header">
|
||||
<a href="{% url 'event_detail' event.pk %}">{{ event.pk }} | {{ event.name }}</a>
|
||||
{% if event.dry_hire %}
|
||||
<span class="badge badge-pill badge-secondary">Dry Hire</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% include 'partials/event_status.html' %}
|
||||
<h6 class="pt-2"><strong>{{ event.start_date|date:"D d/m/Y" }}</strong>
|
||||
{% if event.end_date and event.end_date != event.start_date %}
|
||||
<strong>– {{ event.end_date|date:"D d/m/Y" }}</strong></h4>
|
||||
{% else %}
|
||||
</h6>
|
||||
{% endif %}
|
||||
<ul class="list-group list-group-flush pb-3">
|
||||
<li class="list-group-item">Venue: {{ event.venue }}</li>
|
||||
<li class="list-group-item">Client: {{ event.person }}</li>
|
||||
<li class="list-group-item">Organisation: {{ event.organisation }}</li>
|
||||
</ul>
|
||||
{% if not event.cancelled and event.description %}
|
||||
<p>{{ event.description|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer">MIC: {% if event.mic %}<p>{{ event.mic.initials }}</p>{% elif event.is_rig %}<i class="fas fa-exclamation"></i>{% endif %}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
17
RIGS/templates/partials/event_status.html
Normal file
17
RIGS/templates/partials/event_status.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<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.purchase_order %}
|
||||
<span class="badge badge-success">PO: {{ event.purchase_order }}</i></span>
|
||||
{% elif event.authorised %}
|
||||
<span class="badge badge-success">Payment: Authorised <i class="fas fa-check"></i></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">Payment: <i class="fas fa-times"></i></span>
|
||||
{% endif %}
|
||||
<!-- TODO show invoice stuff here -->
|
||||
|
||||
{% if event.risk_assessment_edit_url %}
|
||||
<span class="badge badge-success">RA: <i class="fas fa-check"></i></span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">RA: <i class="fas fa-times"></i></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -3,11 +3,16 @@
|
||||
{% block title %}Rigboard{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<h1 class="bd-title">Rigboard</h1>
|
||||
<div class="row">
|
||||
<h1 class="bd-title col-xs-12">Rigboard</h1>
|
||||
{% if perms.RIGS.add_event %}
|
||||
<a href="{% url 'event_create' %}" class="btn btn-success float-right my-3">New <i class="fas fa-plus"></i></a>
|
||||
<a href="{% url 'event_create' %}" class="btn btn-success float-right my-3 col-xs-12">New <i class="fas fa-plus"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include 'event_table.html' %}
|
||||
<div class="d-none d-md-block">
|
||||
{% include 'event_table.html' %}
|
||||
</div>
|
||||
<div class="d-xs-block d-sm-block d-md-none">
|
||||
{% include 'event_table_mobile.html' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -231,10 +231,12 @@ class VenueList(generic.ListView):
|
||||
|
||||
|
||||
class VenueDetail(generic.DetailView):
|
||||
template_name = 'venue_detail.html'
|
||||
model = models.Venue
|
||||
|
||||
|
||||
class VenueCreate(generic.CreateView):
|
||||
template_name = 'venue_form.html'
|
||||
model = models.Venue
|
||||
fields = ['name', 'phone', 'email', 'address', 'notes', 'three_phase_available']
|
||||
|
||||
|
||||
@@ -50,14 +50,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="5">Nothing found</td>
|
||||
<tr class="table-warning">
|
||||
<td colspan="6" class="text-center">Nothing found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% if is_paginated %}
|
||||
<div class="col-sm-12">{% paginator %}</div>
|
||||
<div class="row justify-content-center">
|
||||
{% paginator %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user