From 6afe30ed42a532c5efcf4ea7355e7d6362340a3a Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Thu, 14 Jul 2022 16:49:49 +0300 Subject: [PATCH] Added tmp links to month tables --- faerun_calendar/static/faerun_calendar/css/main.css | 10 +++++++++- faerun_calendar/templates/faerun_calendar/index.html | 2 +- faerun_calendar/templates/faerun_calendar/month.html | 2 +- faerun_calendar/urls.py | 1 + faerun_calendar/views.py | 8 +++++++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/faerun_calendar/static/faerun_calendar/css/main.css b/faerun_calendar/static/faerun_calendar/css/main.css index 842785b..1aee7b9 100644 --- a/faerun_calendar/static/faerun_calendar/css/main.css +++ b/faerun_calendar/static/faerun_calendar/css/main.css @@ -26,7 +26,6 @@ table.month td { table.month td.current { background: dimgrey; - color: white; } table.month th.subtitle { @@ -34,6 +33,15 @@ table.month th.subtitle { font-weight: normal; } +table.month td a { + text-decoration: none; + color: black; +} + +table.month td.current a { + color: white; +} + div.calendar { display: flex; flex-flow: row wrap; diff --git a/faerun_calendar/templates/faerun_calendar/index.html b/faerun_calendar/templates/faerun_calendar/index.html index 8c14116..10cf9fa 100644 --- a/faerun_calendar/templates/faerun_calendar/index.html +++ b/faerun_calendar/templates/faerun_calendar/index.html @@ -18,7 +18,7 @@
{% 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 %} + {% include 'faerun_calendar/month.html' with month=month calendar_data=calendar_data month_days=month_days events=events %} {% endif %} {% endfor %}
diff --git a/faerun_calendar/templates/faerun_calendar/month.html b/faerun_calendar/templates/faerun_calendar/month.html index ba02579..b36c8c1 100644 --- a/faerun_calendar/templates/faerun_calendar/month.html +++ b/faerun_calendar/templates/faerun_calendar/month.html @@ -19,7 +19,7 @@ {% endif %} -
{{day}}
+ {{day}} diff --git a/faerun_calendar/urls.py b/faerun_calendar/urls.py index 153019d..facba81 100644 --- a/faerun_calendar/urls.py +++ b/faerun_calendar/urls.py @@ -5,5 +5,6 @@ from . import views urlpatterns = [ path('', views.index, name='index'), path('', views.year_page, name='index'), + path('//', views.day_page, name='index'), ] diff --git a/faerun_calendar/views.py b/faerun_calendar/views.py index 487b9f2..6682466 100644 --- a/faerun_calendar/views.py +++ b/faerun_calendar/views.py @@ -8,20 +8,26 @@ from .models import CalendarData from .models import Event +def day_page(request, year: int, month: int, day: int): + return HttpResponse(f'{year}.{month}.{day}') + + def year_page(request, year: int): try: year_data = YearData.objects.get(number=year) except YearData.DoesNotExist: - return HttpResponseNotFound("

404 Not Found

") + return HttpResponseNotFound('

404 Not Found

') month_data = MonthData.objects.all() calendar_data = CalendarData.objects.first() + events = Event.objects.all() params = { 'calendar_data': calendar_data, 'year_data': year_data, 'month_data': month_data, 'month_days': tuple(i+1 for i in range(30)), + 'events': events, } return render(request, 'faerun_calendar/index.html', params)