Compare commits
3 Commits
95525d28a2
...
04e7bd3005
Author | SHA1 | Date |
---|---|---|
Stranck | 04e7bd3005 | |
Stranck | 5c44c620e4 | |
Stranck | 5d815defc8 |
19
propic.py
19
propic.py
|
@ -17,9 +17,16 @@ async def resetDefaultPropic(request, order: Order, isFursuiter, sendAnswer=True
|
||||||
with open("res/propic/default.png", "rb") as f:
|
with open("res/propic/default.png", "rb") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
os.remove(f"res/propic/{order.ans(f'propic{s}')}") # converted file
|
|
||||||
filenameNoExt = order.ans(f'propic{s}').split(".jpg")[0]
|
convertedFilename = order.ans(f'propic{s}')
|
||||||
os.remove(f"res/propic/{filenameNoExt}_original.jpg") # original file
|
if convertedFilename is not None:
|
||||||
|
convertedFilename = f"res/propic/{convertedFilename}"
|
||||||
|
if os.path.exists(convertedFilename):
|
||||||
|
os.remove(convertedFilename) # converted file
|
||||||
|
originalFilename = f"res/propic/propic{s}_{order.code}_original"
|
||||||
|
if os.path.exists(originalFilename):
|
||||||
|
os.remove(originalFilename) # original file
|
||||||
|
|
||||||
await order.edit_answer_fileUpload(f'propic{s}_file', f'propic{s}_file_{order.code}_default.png', 'image/png', data)
|
await order.edit_answer_fileUpload(f'propic{s}_file', f'propic{s}_file_{order.code}_default.png', 'image/png', data)
|
||||||
if(sendAnswer):
|
if(sendAnswer):
|
||||||
await order.send_answers()
|
await order.send_answers()
|
||||||
|
@ -35,11 +42,11 @@ async def upload_propic(request, order: Order):
|
||||||
raise exceptions.BadRequest("The deadline has passed. You cannot modify the badges at this moment.")
|
raise exceptions.BadRequest("The deadline has passed. You cannot modify the badges at this moment.")
|
||||||
|
|
||||||
if request.form.get('submit') == 'Delete main image':
|
if request.form.get('submit') == 'Delete main image':
|
||||||
await order.edit_answer('propic', None)
|
|
||||||
await resetDefaultPropic(request, order, False, sendAnswer=False)
|
await resetDefaultPropic(request, order, False, sendAnswer=False)
|
||||||
|
await order.edit_answer('propic', None) #This MUST come after the reset default propic!
|
||||||
elif request.form.get('submit') == 'Delete fursuit image':
|
elif request.form.get('submit') == 'Delete fursuit image':
|
||||||
await order.edit_answer('propic_fursuiter', None)
|
|
||||||
await resetDefaultPropic(request, order, True, sendAnswer=False)
|
await resetDefaultPropic(request, order, True, sendAnswer=False)
|
||||||
|
await order.edit_answer('propic_fursuiter', None) #This MUST come after the reset default propic!
|
||||||
else:
|
else:
|
||||||
for fn, body in request.files.items():
|
for fn, body in request.files.items():
|
||||||
if fn not in ['propic', 'propic_fursuiter']:
|
if fn not in ['propic', 'propic_fursuiter']:
|
||||||
|
@ -66,7 +73,7 @@ async def upload_propic(request, order: Order):
|
||||||
raise exceptions.BadRequest(errorDetails)
|
raise exceptions.BadRequest(errorDetails)
|
||||||
|
|
||||||
|
|
||||||
with open(f"res/propic/{fn}_{order.code}_original.jpg", "wb") as f:
|
with open(f"res/propic/{fn}_{order.code}_original", "wb") as f:
|
||||||
f.write(body[0].body)
|
f.write(body[0].body)
|
||||||
|
|
||||||
aspect_ratio = width/height
|
aspect_ratio = width/height
|
||||||
|
|
|
@ -58,12 +58,12 @@ svg.propic-border-filter {
|
||||||
|
|
||||||
.propic-border.propic-animated-super .propic-border-animation {
|
.propic-border.propic-animated-super .propic-border-animation {
|
||||||
background: linear-gradient(90deg, #FA5E00 20%, #FAAA00 40%, #FB8C00 60%, #FA3200 80%, #FAC800 100%);
|
background: linear-gradient(90deg, #FA5E00 20%, #FAAA00 40%, #FB8C00 60%, #FA3200 80%, #FAC800 100%);
|
||||||
animation: border-animation 1s linear 0ms infinite;
|
animation: border-animation 2.5s linear 0ms infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.propic-border.propic-animated-normal .propic-border-animation {
|
.propic-border.propic-animated-normal .propic-border-animation {
|
||||||
background: linear-gradient(90deg, #6124AB 20%, #AB248F 40%, #8E24AA 60%, #3524AB 80%, #AB243E 100%);
|
background: linear-gradient(90deg, #6124AB 20%, #AB248F 40%, #8E24AA 60%, #3524AB 80%, #AB243E 100%);
|
||||||
animation: border-animation 1s linear 0ms infinite;
|
animation: border-animation 2.5s linear 0ms infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes border-animation {
|
@keyframes border-animation {
|
||||||
|
|
|
@ -12,3 +12,9 @@ span.nsc-room-counter {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#room a[role=button] {
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<img alt="Your own profile picture" src="{{imgSrc}}" class="absolute propic {{(('propic-' + order.sponsorship) if not effects else '') if order.sponsorship else 'propic-base'}}"/>
|
<img alt="Your own profile picture" src="{{imgSrc}}" class="absolute propic {{(('propic-' + order.sponsorship) if not effects else '') if order.sponsorship else 'propic-base'}}"/>
|
||||||
<img alt="" src="/res/propic/default.png" class="propic-filler {{(('propic-' + order.sponsorship) if not effects else '') if order.sponsorship else 'propic-base'}}"/>
|
<svg alt="" class="propic-filler {{(('propic-' + order.sponsorship) if not effects else '') if order.sponsorship else 'propic-base'}}" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"></svg>
|
||||||
{% if flag %}
|
{% if flag %}
|
||||||
<img alt="flag" class="absolute propic-flag" src="/res/flags/{{order.country.lower()}}.svg"/>
|
<img alt="flag" class="absolute propic-flag" src="/res/flags/{{order.country.lower()}}.svg"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -85,9 +85,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# <a role="button" {% 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> #}
|
{# <a role="button" {% 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> #}
|
||||||
<a role="button" {% 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>
|
<a role="button" {% if not room.forbidden and len(room_members) == order.room_person_no %}href="javascript:document.getElementById('modal-roomconfirm').setAttribute('open', 'true');"{% endif %}>Confirm {{[None,'single','double','triple','quadruple','quintuple'][order.room_person_no]}} room</a>
|
||||||
|
|
||||||
<a role="button" href="javascript:document.getElementById('modal-roomrename').setAttribute('open', 'true');">Rename room {{[None,'single','double','triple','quadruple','quintuple'][order.room_person_no]}} room</a>
|
<a role="button" href="javascript:document.getElementById('modal-roomrename').setAttribute('open', 'true');">Rename room</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if order.room_id and not order.room_confirmed %}
|
{% if order.room_id and not order.room_confirmed %}
|
||||||
|
|
Loading…
Reference in New Issue