Files
PyRIGS/RIGS/templates/RIGS/event_table.html
Arona Jones 4a4d4a5cf3 Add authorisation process for sign ups and allow access to EventDetail for basic users (#399)
* CHANGE: First pass at opening up RIGS #233

Whilst it makes it something of a misnomer, the intent is to make the 'view_event' perm a permission to view event details like client/price. I don't see the point in giving everyone 'view_event' and adding a new 'view_event_detail'...Open to arguments the other way.

* CHANGE: New user signups now require admin approval

Given that I intend to reveal much more data to new users this seems necessary...

* CHORE: Fix CI

* FIX: Legacy Profiles are now auto-approved correctly

* Add testing of approval mechanism

This fixes the other functional tests failing because the user cannot login without being approved.

* Superusers bypass approval check

This should fix the remainder of the tests

* Prevent unapproved users logging in through embeds

Test suite doing its job...!

* FIX: Require login on events and event embeds again

Little too far to the open side there Arona... Whooooooops!

* FIX: Use has_oembed decorator for events

* FIX: Re-prevent basic seeing reversion

This is to prevent financials/client data leaking when changed. Hopefully can show them a filtered version in future.

* FIX: Remove mitigation for #264

Someone quietly fixed it, it appears

* FEAT: Add admin email notif when an account is activated and awaiting approval

No async or time-since shenanigans yet!

* FIX: Whoops, undo accidental whitespace change

* FEAT: Add a fifteen min cooldown between emails to admins

Probably not the right way to go about it...but it does work!

TODO: How to handle cooldown-emailing shared mailbox addresses?

* FIX: Remove event modal history deadlink for basic users

Also removes some links on the RIGS homepage that will deadlink for them

* FIX: Wrong perms syntax for history pages

* CHORE: Squash migrations

* FIX: Use a setting for cooldown

* FIX: Minor code improvements
2020-02-29 11:34:50 +00:00

108 lines
4.6 KiB
HTML

<div class="table-responsive">
<table class="table">
<thead>
<td>#</td>
<td>Event Date</td>
<td>Event Details</td>
<td>Event Timings</td>
<td>MIC</td>
</thead>
<tbody>
{% for event in events %}
<tr class="
{% if event.cancelled %}
active text-muted
{% elif not event.is_rig %}
info
{% elif event.confirmed and event.mic %}
{# interpreated as (booked and mic) #}
success
{% elif event.mic %}
warning
{% else %}
danger
{% endif %}
">
<td>{{ event.pk }}</td>
<td>
<div><strong>{{ event.start_date|date:"D d/m/Y" }}</strong></div>
{% if event.end_date and event.end_date != event.start_date %}
<div><strong>{{ event.end_date|date:"D d/m/Y" }}</strong></div>
{% endif %}
<span class="text-muted">{{ event.get_status_display }}</span>
</td>
<td>
<h4>
<a href="{% url 'event_detail' event.pk %}">
{{ event.name }}
</a>
{% if event.venue %}
<small>at {{ event.venue }}</small>
{% endif %}
{% if event.dry_hire %}
<span class="label label-default">Dry Hire</span>
{% endif %}
{% if event.is_rig and perms.RIGS.view_event and event.authorised %}
<span class="glyphicon glyphicon-check"></span>
{% endif %}
</h4>
{% if event.is_rig and not event.cancelled %}
<h5>
{{ event.person.name }}
{% if event.organisation %}
for {{ event.organisation.name }}
{% endif %}
</h5>
{% endif %}
{% if not event.cancelled and event.description %}
<div>
{{ event.description|linebreaksbr }}
</div>
{% endif %}
</td>
<td>
{% if not event.cancelled %}
<dl class="dl-horizontal">
{% if event.meet_at %}
<dt>Crew meet</dt>
<dd>{{ event.meet_at|date:"H:i" }}<br/>{{ event.meet_at|date:"(Y-m-d)" }}</dd>
{% endif %}
{% if event.has_start_time %}
<dt>Event starts</dt>
<dd>
{{ event.start_time|date:"H:i" }}<br/>
{{ event.start_date|date:"(Y-m-d)" }}<br/>
</dd>
{% endif %}
{% if event.has_end_time%}{% if event.start_date != event.end_date or event.start_time != event.end_time %}
<dt>Event ends</dt>
<dd>
{{ event.end_time|date:"H:i" }}<br/>
{{ event.end_date|date:"(Y-m-d)" }}
</dd>
{% endif %}{% endif %}
</dl>
{% endif %}
</td>
<td class="text-right">
{% if event.mic %}
{{ event.mic.initials }}
<div>
{% if perms.RIGS.view_profile %}
<a href="{% url 'profile_detail' event.mic.pk %}" class="modal-href">
<img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/>
</a>
{% else %}
<img src="{{ event.mic.profile_picture }}" class="event-mic-photo"/>
{% endif %}
</div>
{% elif event.is_rig %}
<span class="glyphicon glyphicon-exclamation-sign"></span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>