Splitted events to ps
This commit is contained in:
@@ -109,6 +109,7 @@ div.event-gm,
|
||||
div.event-suggested {
|
||||
border: 1px solid #000000;
|
||||
padding: 20px;
|
||||
padding-bottom: 0px;
|
||||
margin: auto;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 10px;
|
||||
|
||||
@@ -74,7 +74,11 @@
|
||||
|
||||
<div class="event-time">{{event.time}}</div>
|
||||
<div class="event-title">{{event.title}}</div>
|
||||
<p class="event-description">{{event.description}}</p>
|
||||
<p class="event-description">
|
||||
{% for description in event.descriptions %}
|
||||
<p>{{description}}</p>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@@ -53,10 +53,19 @@ def day_page(request, year: int, month: int, day: int):
|
||||
|
||||
if not params:
|
||||
try:
|
||||
events = Event.objects.filter(year=year_id, month=month_id, day=day,
|
||||
is_suggested=select_suggested, is_only_for_gm=select_only_for_gm
|
||||
).order_by('time')
|
||||
except Event.DoesNotExist:
|
||||
events = []
|
||||
es = Event.objects.filter(year=year_id, month=month_id, day=day,
|
||||
is_suggested=select_suggested, is_only_for_gm=select_only_for_gm
|
||||
).order_by('time')
|
||||
for e in es:
|
||||
event = {}
|
||||
for param in ('time', 'title', 'is_suggested', 'is_only_for_gm'):
|
||||
event['time'] = getattr(e, 'time')
|
||||
|
||||
event['descriptions'] = tuple(p for p in getattr(e, 'description').split('\n') if p)
|
||||
|
||||
events.append(event)
|
||||
except (Event.DoesNotExist, AttributeError):
|
||||
params = {'type': 'error', 'error_type': 'events'}
|
||||
|
||||
if not params:
|
||||
|
||||
Reference in New Issue
Block a user