Fixes to carpooling function
This commit is contained in:
parent
2265778eb9
commit
0c3e80320e
|
@ -36,13 +36,13 @@ async def carpooling_update(request, order: Order):
|
|||
error = "Offer or need form is not valid!"
|
||||
elif len(val) > 1000 and field == 'message':
|
||||
error = "The message cannot be longer than 1000 characters!"
|
||||
elif val.count("\n") > 4:
|
||||
error = "Please do not use more than 4 line breaks!"
|
||||
elif val.count("\n") > 6:
|
||||
error = "Please do not use more than 6 line breaks in the message!"
|
||||
else:
|
||||
payload[field] = val
|
||||
|
||||
order.carpooling_message = payload
|
||||
if not error:
|
||||
order.carpooling_message = payload
|
||||
await order.edit_answer('carpooling_message', json.dumps(payload))
|
||||
|
||||
else:
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<label for="offer_or_need">Are you offering or need a ride?</label>
|
||||
<select name="offer_or_need" id="offer_or_need">
|
||||
<option value="need" {{'selected' if order.carpooling_message.offer_or_need == 'need'}}>I'm looking for a ride</option>
|
||||
<option value="offer" {{'selected' if order.carpooling_message.offer_or_need == 'need'}}>I'm offering a ride</option>
|
||||
<option value="offer" {{'selected' if order.carpooling_message.offer_or_need == 'offer'}}>I'm offering a ride</option>
|
||||
</select>
|
||||
|
||||
<label for="day_departure">
|
||||
|
@ -63,7 +63,7 @@
|
|||
<blockquote>
|
||||
<p style="margin-bottom:1em;"><strong>{{o.name}}</strong> {{'is offering' if o.carpooling_message.offer_or_need == 'offer' else 'needs'}} a trip from <strong>{{o.carpooling_message.from_location}}</strong> on the <strong>{{o.carpooling_message.day_departure[1:]}} of {{'May' if o.carpooling_message.day_departure[0] == 'm' else 'June'}}</strong>.</p>
|
||||
<img class="propic propic-{{o.sponsorship}}" style="margin-top:0.5em;margin-right:1em;float:left;max-width:4em;" src="/res/propic/{{o.ans('propic') or 'default.png'}}" />
|
||||
<span style="font-size:.8em;">{{o.carpooling_message.message}}</span>
|
||||
<span style="font-size:.8em;">{{o.carpooling_message.message|escape|replace("\n", "<br />"|safe)}}</span>
|
||||
<br clear="both" />
|
||||
</blockquote>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue