Revert "Very initial pass at reimplementing event table fully responsive"

This reverts commit f5d875d153.
This commit is contained in:
2021-03-02 11:11:18 +00:00
parent 5382d8ae00
commit ac0425740e
2 changed files with 89 additions and 98 deletions

View File

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

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: true, notify: false,
open: false, open: false,
port: 8001, port: 8001,
proxy: 'localhost:8000' proxy: 'localhost:8000'