furizon_webint/tpl/blocks/room.html

145 lines
8.5 KiB
HTML
Raw Permalink Normal View History

2023-01-08 20:24:34 +00:00
<details id="room">
<summary role="button"><img src="/res/icons/bedroom.svg" class="icon"/> Accomodation & Roommates {% if not order.room_confirmed %}<span class="status">⚠️</span>{% endif %}</summary>
2023-12-30 10:27:42 +00:00
<h2 style="margin-bottom:0;">Your room {% if room_members %}- {{room_members[0].ans('room_name')}}{% endif %}</h2>
<p><b>Room's type:</b> {{ROOM_TYPE_NAMES[order.bed_in_room]}}.</p>
2024-01-06 11:58:23 +00:00
<p class="notice" style="background:#0881c0"><b>Note! </b> Only people with the same room type can be roommates. If you need help, contact the <a href="https://furizon.net/contact/">Furizon's Staff</a>.</p>
2023-01-08 20:24:34 +00:00
2024-02-19 06:55:23 +00:00
{% if not order.room_confirmed %}
2024-02-29 13:57:46 +00:00
<p class="notice" style="background:#0881c0"><b><a href="/manage/nosecount?filter=capacity">Check here</a> for any fur who share your room type.</p>
2024-02-19 06:55:23 +00:00
{% endif %}
{% if time() > ROOM_DEADLINE %}
<p class="notice">⚠️ The deadline to edit your room has passed. If your room is not full it will be subject to changes by the staff as we optimize for hotel capacity.</p>
{% else %}
2023-01-08 20:24:34 +00:00
{# Show alert if room owner has wrong people inside #}
{# {% if room_members and quota.get_left(len(room_members)) == 0 and (not order.room_confirmed) %} #}
{# <p class="notice">⚠️ Your room contains {{len(room_members)}} people inside, but sadly there are no more {{[None,'single','double','triple','quadruple','quintuple'][len(room_members)]}} rooms. You need to add or remove people until you reach the size of an available room if you want to confirm it.</p> #}
{# {% endif %} #}
{# Show alert if room was not confirmed #}
{% if order.room_id and not order.room_confirmed %}
<p class="notice">⚠️ Your room hasn't been confirmed yet. Unconfirmed rooms are subject to changes by the staff as we optimize for hotel capacity.</p>
{% endif %}
2023-01-08 20:24:34 +00:00
{% endif %}
2023-01-08 20:24:34 +00:00
{# Show notice if the room is confirmed #}
{% if order.room_confirmed %}
2023-12-30 10:27:42 +00:00
{# <p class="notice" style="background:#060">✅ Your <strong>{{[None,'single','double','triple','quadruple','quintuple'][len(room_members)]}}</strong> room has been confirmed</p> #}
<p class="notice" style="background:#060">✅ Your <strong>{{[None,'single','double','triple','quadruple','quintuple'][order.room_person_no]}}</strong> room has been confirmed</p>
2023-01-08 20:24:34 +00:00
{% endif %}
{# Show roommates if room is set #}
{% set room = namespace(forbidden=false) %}
{% if order.room_id %}
<div class="grid people" style="padding-bottom:1em;">
{% for person in room_members %}
<div style="margin-bottom: 1em;">
{% with current=order, order=person, imgSrc='/res/propic/' + (person.ans('propic') or 'default.png'), effects = true, flag = true %}
{% include 'blocks/propic.html' %}
{% endwith %}
2023-01-08 20:24:34 +00:00
<h3>{{person.ans('fursona_name')}}</h3>
{% if person.code == order.room_id %}<p><strong style="color:#c6f">ROOM OWNER</strong></p>{% endif %}
2023-12-30 10:27:42 +00:00
<p>{{person.ans('staff_title') if person.ans('staff_title') else ''}} {{'Fursuiter' if person.is_fursuiter}}</p>
2023-01-08 20:24:34 +00:00
{% if person.status == 'pending' %}
<p><strong style="color:red;">UNPAID</strong></p>
{% endif %}
2024-05-20 10:29:45 +00:00
{% if order.room_owner and person.code != order.code and (not order.room_confirmed) and (time() <= ROOM_DEADLINE or isSessionAdmin) %}<a href="/manage/room/kick/{{person.code}}">KICK</a>{% endif %}
2023-01-08 20:24:34 +00:00
</div>
{% if person.status != 'paid' %}
{% set room.forbidden = True %}
{% endif %}
{% endfor %}
2023-12-30 10:27:42 +00:00
{# {% if order.room_id == order.code and not order.room_confirmed and len(room_members) < 5%} #}
{% if order.room_id == order.code and not order.room_confirmed and len(room_members) < order.room_person_no %}
2023-01-08 20:24:34 +00:00
<div>
2024-05-20 10:29:45 +00:00
<a {% if time() <= ROOM_DEADLINE or isSessionAdmin %} href="javascript:document.getElementById('modal-roominvite').setAttribute('open', 'true');" {% else %} disabled {% endif %}>
<div class="propic-container">
<img class="propic" src="/res/new.png" />
<h3>Invite</h3>
<p>Get room code</p>
</div>
2023-01-08 20:24:34 +00:00
</a>
</div>
{% endif %}
</div>
{% elif order.pending_room %}
<p>You have have asked to join the room of another member. Wait for them to confirm or reject your request.</p>
2024-05-20 10:29:45 +00:00
<a role="button" href="/manage/room/cancel_request" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Cancel pending join request</a>
2023-01-08 20:24:34 +00:00
{% else %}
<p class="notice">🎲 If you don't join a room or create your one within the room deadline, we will randomly put you into a room with free spots.</p>
<p>To join a room, ask somebody to send you their room code.</p>
<p class="grid">
2024-05-20 10:29:45 +00:00
<a role="button" href="/manage/room/create" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Create a room</a>
<a role="button" href="javascript:document.getElementById('modal-joinroom').setAttribute('open', 'true');" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Join a room</a>
2023-01-08 20:24:34 +00:00
</p>
{% endif %}
{% if order.room_owner and not order.room_confirmed %}
{% if room.forbidden %}
<p class="notice">⚠️ There are roommates for which a payment was not received yet, you will be able to confirm this room only once all payments are completed.</p>
{% endif %}
{% endif %}
2024-01-10 13:04:04 +00:00
<p class="grid grid_2x2">
2023-01-08 20:24:34 +00:00
{% if order.room_owner %}
{% if not order.room_confirmed %}
2024-05-20 10:29:45 +00:00
{# <a role="button" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}} {% if not room.forbidden and quota.get_left(len(room_members)) > 0 %}href="javascript:document.getElementById('modal-roomconfirm').setAttribute('open', 'true');"{% endif %}>Confirm <strong>{{[None,'single','double','triple','quadruple','quintuple'][len(room_members)]}}</strong> room</a> #}
2024-01-10 13:04:04 +00:00
2024-05-20 10:29:45 +00:00
<a style="grid-area: 1 / 1 / 2 / 2;" role="button" href="javascript:document.getElementById('modal-roomrename').setAttribute('open', 'true');" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Rename room</a>
<a style="grid-area: 1 / 2 / 2 / 3;" href="/manage/room/delete" role="button" {{'disabled' if (len(room_members) > 1) or (time() > ROOM_DEADLINE and not isSessionAdmin) else ''}} >Delete room</a>
<a style="grid-area: 2 / 1 / 3 / 3; display:block;" role="button" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}} {% if not room.forbidden and len(room_members) == order.room_person_no %}href="javascript:document.getElementById('modal-roomconfirm').setAttribute('open', 'true');"{% endif %}>Confirm <strong>{{[None,'single','double','triple','quadruple','quintuple'][order.room_person_no]}}</strong> room</a>
{% else %}
2024-05-20 10:29:45 +00:00
{# <a style="grid-area: 1 / 1 / 2 / 2;" role="button" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}} href="javascript:navigator.share({title: 'Furizon room', text:'Viewing room {{order.room_name}}', url: `${window.location.protocol}//${window.location.host}/manage/room/view/{{order.code}}}`});">Share</a> #}
2023-01-08 20:24:34 +00:00
{% endif %}
{% else %}
{% if order.room_id and not order.room_confirmed %}
2024-05-20 10:29:45 +00:00
<a href="/manage/room/leave" role="button" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Leave room</a>
2023-01-08 20:24:34 +00:00
{% endif %}
{% endif %}
</p>
{# Pending roommates #}
{% if pending_roommates %}
<h4>Pending roommates</h4>
<p>These people have asked to join your room.</p>
<table>
{% for person in pending_roommates %}
<tr>
<td style="width:4em;"><img style="width:2em;height:2em;" class="propic" src="/res/propic/{{person.ans('propic') or 'default.png'}}" /></td>
2023-01-08 20:24:34 +00:00
<td>{{person.name}}</td>
{% if person.status == 'pending' %}
<td><strong style="color:red;">UNPAID</strong></td>
{% endif %}
{% if order.room_owner %}
2024-05-20 10:29:45 +00:00
<td style="width:1%;white-space: nowrap;"><a role="button" href="/manage/room/approve/{{person.code}}" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Approve</a></td>
<td style="width:1%;white-space: nowrap;"><a role="button" href="/manage/room/reject/{{person.code}}" {{'disabled' if time() > ROOM_DEADLINE and not isSessionAdmin else ''}}>Reject</a></td>
{% endif %}
2023-01-08 20:24:34 +00:00
</tr>
</div>
{% if person.status != 'paid' %}
{% set room.forbidden = True %}
{% endif %}
{% endfor %}
</table>
{% endif %}
{# Room availability is always shown #}
2023-12-30 10:27:42 +00:00
{# <h4>Room availability</h4> #}
{# <table> #}
{# {% for q in quota.data['results'] if 'Room' in q['name'] %} #}
{# <tr {% if q['available_number'] == 0 %}style="text-decoration:line-through;"{% endif %}> #}
{# <td>{{q['name']}}</td> #}
{# <td>{{q['available_number']}} left</td> #}
{# </tr> #}
{# {% endfor %} #}
{# </table> #}
2023-01-08 20:24:34 +00:00
</details>