Compare commits

..

3 Commits

6 changed files with 109 additions and 101 deletions

View File

@@ -30,7 +30,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install pipenv pip install pipenv
pipenv install -d pipenv install -d
if: steps.pcache.outputs.cache-hit != 'true' # if: steps.pcache.outputs.cache-hit != 'true'
- name: Cache Static Files - name: Cache Static Files
id: static-cache id: static-cache
uses: actions/cache@v2 uses: actions/cache@v2

View File

@@ -20,15 +20,7 @@
{% if event.is_rig %} {% if event.is_rig %}
<dt class="col-sm-6">Event MIC</dt> <dt class="col-sm-6">Event MIC</dt>
<dd class="col-sm-6"> <dd class="col-sm-6">{% include 'partials/linked_name.html' with profile=event.mic %}</dd>
{% if event.mic and perms.RIGS.view_profile %}
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
{{ event.mic.name }}
</a>
{% else %}
{{ event.mic.name }}
{% endif %}
</dd>
{% endif %} {% endif %}
<dt class="col-sm-6">Status</dt> <dt class="col-sm-6">Status</dt>
@@ -71,7 +63,7 @@
{% if event.dry_hire %} {% if event.dry_hire %}
<dt class="col-sm-6">Checked In By</dt> <dt class="col-sm-6">Checked In By</dt>
<dd class="col-sm-6">{{ object.checked_in_by.name }}</dd> <dd class="col-sm-6">{% include 'partials/linked_name.html' with profile=event.checked_in_by %}</dd>
{% endif %} {% endif %}
{% if event.is_rig %} {% if event.is_rig %}

View File

@@ -1,36 +1,51 @@
{% load namewithnotes from filters %} {% load namewithnotes from filters %}
<div class="table-responsive"> <style>
<table class="table mb-0" id="event_table"> .eventgrid {
<thead> display: grid;
<tr> grid-template-columns: 0.5fr 2fr 4fr 1fr;
<th scope="col">#</th> border: solid 3px black;
<th scope="col">Dates & Times</th> padding: 1em;
<th scope="col">Event Details</th> }
<th scope="col">MIC</th> @media (max-width: 600px) {
</tr> .eventgrid {
</thead> grid-template-columns: 1fr;
<tbody> }
.grid-header {
display: none;
}
#event_dates {
order: 2;
}
}
</style>
<div id="event_table">
<div class="eventgrid grid-header font-weight-bold">
<div>#</div>
<div>Dates & Times</div>
<div>Event Details</div>
<div>MIC</div>
</div>
{% for event in events %} {% for event in events %}
<tr class="{% if event.cancelled %} <div class="eventgrid {% if event.cancelled %}
table-secondary bg-secondary
{% elif not event.is_rig %} {% elif not event.is_rig %}
table-info bg-info
{% elif not event.mic %} {% elif not event.mic %}
table-danger bg-danger
{% elif event.confirmed and event.authorised %} {% elif event.confirmed and event.authorised %}
{% if event.dry_hire or event.riskassessment %} {% if event.dry_hire or event.riskassessment %}
table-success bg-success
{% else %} {% else %}
table-warning bg-warning
{% endif %} {% endif %}
{% else %} {% else %}
table-warning bg-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-sm-block" id="event_number">{{ event.display_id }}</div>
<!--Dates & Times--> <!--Dates & Times-->
<td id="event_dates"> <div id="event_dates">
<span class="text-nowrap">Start: <strong>{{ event.start_date|date:"D d/m/Y" }}</strong> <span class="text-nowrap attribute">Start: <strong>{{ event.start_date|date:"D d/m/Y" }}</strong>
{% if event.has_start_time %} {% if event.has_start_time %}
{{ event.start_time|date:"H:i" }} {{ event.start_time|date:"H:i" }}
{% endif %} {% endif %}
@@ -51,9 +66,9 @@
<br><span>Access at: <strong>{{ event.access_at|date:"H:i" }}</strong> {{ event.access_at|date:"(d/m/Y)" }}</span> <br><span>Access at: <strong>{{ event.access_at|date:"H:i" }}</strong> {{ event.access_at|date:"(d/m/Y)" }}</span>
{% endif %} {% endif %}
{% endif %} {% endif %}
</td> </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 }} {{ event.name }}
@@ -77,9 +92,9 @@
<p>{{ event.description|linebreaksbr }}</p> <p>{{ event.description|linebreaksbr }}</p>
{% endif %} {% endif %}
{% include 'partials/event_status.html' %} {% include 'partials/event_status.html' %}
</td> </div>
<!---MIC--> <!---MIC-->
<td id="event_mic" class="text-nowrap"> <div id="event_mic" class="text-nowrap">
{% 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">
@@ -92,13 +107,7 @@
{% elif event.is_rig %} {% elif event.is_rig %}
<span class="fas fa-exclamation"></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>

View File

@@ -0,0 +1,7 @@
{% if profile and perms.RIGS.view_profile %}
<a href="{% url 'profile_detail' profile.pk %}" class="modal-href">
{{ profile.name }}
</a>
{% else %}
{{ profile.name }}
{% endif %}

View File

@@ -80,7 +80,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: 'localhost:8000' proxy: 'localhost:8000'

View File

@@ -16,7 +16,7 @@
<th scope="row">{{ version.revision.date_created }}</th> <th scope="row">{{ version.revision.date_created }}</th>
<td><a href="{{ version.changes.new.get_absolute_url }}">{{ version.changes.new.display_id|default:version.changes.new.pk }} | {{version.changes.new|to_class_name}}</a></td> <td><a href="{{ version.changes.new.get_absolute_url }}">{{ version.changes.new.display_id|default:version.changes.new.pk }} | {{version.changes.new|to_class_name}}</a></td>
<td>{{ version.pk }}|{{ version.revision.pk }}</td> <td>{{ version.pk }}|{{ version.revision.pk }}</td>
<td>{{ version.revision.user.name|default:"System" }}</td> <td>{% include 'partials/linked_name.html' with profile=version.revision.user %}</td>
<td> <td>
{% if version.changes.old == None %} {% if version.changes.old == None %}
Created {{version.changes.new|to_class_name}} Created {{version.changes.new|to_class_name}}