Files
dnd-db-site/faerun_calendar/templates/faerun_calendar/index.html
T
2022-11-01 18:10:53 +03:00

56 lines
2.0 KiB
HTML

{% extends 'main/pagetemplate.html' %}
{% load static %}
{% block additional_css %}
<link rel="stylesheet" href="{% static 'faerun_calendar/css/main.css' %}">
{% endblock %}
{% block pagetitle %}
Календарь
{% endblock %}
{% block content %}
<div class="calendarpage">
{% if type == 'year' %}
<h1 class="title">Календарь</h1>
<h2 class="year">{{year_data.number}}</h2>
{% elif type == 'day' %}
<h1 class="title">Календарь — События</h1>
<h2 class="year">Год {{year_data.number}}, {{month_data.name}}, день {{day}}-й</h2>
{% elif type == 'error' %}
<h1 class="title">Календарь — Ошибка</h1>
{% endif %}
<div class="calendar">
{% if type == 'year' %}
{% for month in month_data %}
{% if not month.is_leap_month or year_data.is_leap %}
{% include 'faerun_calendar/month.html' with month=month calendar_data=calendar_data month_days=month_days events=events %}
{% endif %}
{% endfor %}
{% elif type == 'day' %}
{% if events.count == 0 %}
<p class="calendar-info">Событий нет</p>
{% else %}
{% for event in events %}
<div class="event">
<div class="event-time">{{event.time}}</div>
<div class="event-title">{{event.title}}</div>
<p class="event-description">{{event.description}}</p>
</div>
{% endfor %}
{% endif %}
{% elif type == 'error' %}
{% if error_type == 'year' %}
<p class="calendar-error">Неверный год</p>
{% elif error_type == 'month' %}
<p class="calendar-error">Неверный месяц</p>
{% elif error_type == 'day' %}
<p class="calendar-error">Неверный день</p>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}