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