Compare commits

..

No commits in common. "44b534b283a64447c888a2b378d89850cf6508d2" and "8d314d2a63ec91a864c1a2962ba197497d8b7825" have entirely different histories.

8 changed files with 6 additions and 48 deletions

2
app.py
View File

@ -218,7 +218,7 @@ if __name__ == "__main__":
print("Healtchecking...", file=sys.stderr) print("Healtchecking...", file=sys.stderr)
incPretixRead() incPretixRead()
res = requests.get(join(domain, "healthcheck"), headers=headers) res = requests.get(join(domain, "healthcheck"), headers=headers)
if(res.status_code == 200 or SKIP_HEALTHCHECK): if(res.status_code == 200):
break break
except: except:
pass pass

View File

@ -5,7 +5,6 @@ API_TOKEN = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
ORGANIZER = 'furizon' ORGANIZER = 'furizon'
EVENT_NAME = 'overlord' EVENT_NAME = 'overlord'
HOSTNAME = 'reg.furizon.net' HOSTNAME = 'reg.furizon.net'
SKIP_HEALTHCHECK = False
headers = {'Host': HOSTNAME, 'Authorization': f'Token {API_TOKEN}'} headers = {'Host': HOSTNAME, 'Authorization': f'Token {API_TOKEN}'}
domain = "http://urlllllllllllllllllllll/" domain = "http://urlllllllllllllllllllll/"

2
ext.py
View File

@ -137,7 +137,7 @@ class Order:
return self.data[var] return self.data[var]
def set_room_errors (self, to_set): def set_room_errors (self, to_set):
self.room_errors = to_set for s in to_set: self.room_errors.append (s)
def ans(self, name): def ans(self, name):
for p in self.data['positions']: for p in self.data['positions']:

View File

@ -12,12 +12,6 @@ ROOM_UNCONFIRM_TEXT = {
'plain': "Hello {0}\nWe had to unconfirm your room '{1}' due to the following issues:\n{2}\nPlease contact your room's owner or contact our support for further informations at https://furizon.net/contact/.\nThank you\n\nTo manage your booking: https://reg.furizon.net/manage/welcome" 'plain': "Hello {0}\nWe had to unconfirm your room '{1}' due to the following issues:\n{2}\nPlease contact your room's owner or contact our support for further informations at https://furizon.net/contact/.\nThank you\n\nTo manage your booking: https://reg.furizon.net/manage/welcome"
} }
NOSECOUNT = {
'filters': {
'capacity': "Here are some furs that share your room type and don't have a confirmed room."
}
}
LOCALES = { LOCALES = {
'shuttle_link': { 'shuttle_link': {
'en': 'Book now', 'en': 'Book now',

View File

@ -1,6 +1,5 @@
from sanic.response import html from sanic.response import html
from sanic import Blueprint, Request from sanic import Blueprint
from messages import NOSECOUNT
from ext import * from ext import *
bp = Blueprint("stats", url_prefix="/manage") bp = Blueprint("stats", url_prefix="/manage")
@ -13,24 +12,13 @@ async def sponsor_count(request, order: Order):
tpl = request.app.ctx.tpl.get_template('sponsorcount.html') tpl = request.app.ctx.tpl.get_template('sponsorcount.html')
return html(tpl.render(orders=orders, order=order)) return html(tpl.render(orders=orders, order=order))
def calc_filter(orders: dict, filter_cmd: str, order: Order) -> tuple[dict, str]:
if not filter_cmd or len(filter_cmd) == 0 or not orders or len(orders.keys()) == 0: return
if filter_cmd.lower() == "capacity":
return {key:value for key,value in orders.items() if (not value.room_confirmed and value.bed_in_room == order.bed_in_room)}, NOSECOUNT['filters'][filter_cmd.lower()]
else:
return None, None
@bp.route("/nosecount") @bp.route("/nosecount")
async def nose_count(request: Request, order: Order): async def nose_count(request, order: Order):
await request.app.ctx.om.update_cache() await request.app.ctx.om.update_cache()
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']} orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']}
filtered: dict = None
filter_message: str = None
for query in request.query_args:
if query[0] == "filter" and order:
filtered, filter_message = calc_filter(orders, query[1], order) if filter else None
tpl = request.app.ctx.tpl.get_template('nosecount.html') tpl = request.app.ctx.tpl.get_template('nosecount.html')
return html(tpl.render(orders=orders, order=order, filtered=filtered, filter_header=filter_message)) return html(tpl.render(orders=orders, order=order))
@bp.route("/fursuitcount") @bp.route("/fursuitcount")
async def fursuit_count(request, order: Order): async def fursuit_count(request, order: Order):

View File

@ -48,7 +48,6 @@
grid-template-rows: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);
} }
</style> </style>
<script src="/res/scripts/base.js" defer></script>
</head> </head>
<body onscroll="onScrollNav()"> <body onscroll="onScrollNav()">
{% include 'blocks/navbar.html' %} {% include 'blocks/navbar.html' %}

View File

@ -4,10 +4,6 @@
<p><b>Room's type:</b> {{ROOM_TYPE_NAMES[order.bed_in_room]}}.</p> <p><b>Room's type:</b> {{ROOM_TYPE_NAMES[order.bed_in_room]}}.</p>
<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> <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>
{% if not order.room_confirmed %}
<p class="notice" style="background:#0881c0"><b><a href="https://furizon.net/manage/nosecount?filter=capacity">Check here</a> for any fur who share your room type.</p>
{% endif %}
{# Show alert if room owner has wrong people inside #} {# 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) %} #} {# {% if room_members and quota.get_left(len(room_members)) == 0 and (not order.room_confirmed) %} #}

View File

@ -20,24 +20,6 @@
</picture> </picture>
</header> </header>
<p>Welcome to the nosecount page! Here you can see all of the available rooms at the convention, as well as the occupants currently staying in each room. Use this page to find your friends and plan your meet-ups.</p> <p>Welcome to the nosecount page! Here you can see all of the available rooms at the convention, as well as the occupants currently staying in each room. Use this page to find your friends and plan your meet-ups.</p>
{% if filtered and order %}
{% for person in filtered.values() %}
{% if loop.first %}
<hr />
<p>{{filter_header}}</p>
<div class="grid people" style="padding-bottom:1em;">
{% endif %}
<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 %}
<h5>{{person.ans('fursona_name')}}</h5>
</div>
{% if loop.last %}</div>{% endif %}
{% endfor %}
{% endif %}
{% for o in orders.values() if (o.code == o.room_id and o.room_confirmed) %} {% for o in orders.values() if (o.code == o.room_id and o.room_confirmed) %}
{% if loop.first %} {% if loop.first %}
<hr /> <hr />