Skip to content
Snippets Groups Projects
Commit 63cc1875 authored by Tomáš Valenta's avatar Tomáš Valenta Committed by jan.bednarik
Browse files

fix personal calendar, homepage search

parent 1d671f63
Branches
No related tags found
2 merge requests!804Release,!790Fix personal calendar, homepage search & scrape Instagram instead of using API
......@@ -92,7 +92,15 @@ class CalendarMixin(models.Model):
def get_fullcalendar_data(self) -> str:
calendar_format_events = []
for event in self.calendar.past_events + self.calendar.future_events:
for event in (
self.calendar.past_events
if self.calendar.past_events is not None
else []
) + (
self.calendar.future_events
if self.calendar.future_events is not None
else []
):
parsed_event = {
"allDay": event["all_day"],
"start": event["start"].isoformat(),
......
......@@ -19,7 +19,7 @@
<!-- Bootstrap CSS -->
<!-- Styles -->
<link rel="stylesheet" href="https://styleguide.pirati.cz/2.12.x/css/styles.css">
<link rel="stylesheet" href="https://styleguide.pirati.cz/2.13.x/css/styles.css">
<link href="{% static "shared/vendor/fancybox/jquery.fancybox.min.css" %}" rel="stylesheet">
<link rel="stylesheet" href="{% static "shared/css/helpers.css" %}">
......@@ -347,7 +347,7 @@
</footer>
<script src="{% static "styleguide291/assets/js/vue.2.6.11.js" %}"></script>
<script src="https://styleguide.pirati.cz/2.10.x/js/main.bundle.js"></script>
<script src="https://styleguide.pirati.cz/2.13.x/js/main.bundle.js"></script>
<script src="{% static "shared/vendor/jquery/jquery-3.4.1.min.js" %}"></script>
<script src="{% static "shared/vendor/lazysizes/lazysizes.min.js" %}"></script>
<script src="{% static "shared/vendor/fancybox/jquery.fancybox.min.js" %}"></script>
......
......@@ -27,7 +27,9 @@
{% if page.calendar %}
<section>
<h2 class="head-alt-md mb-3"><i class="ico--calendar mr-4"></i>Kalendář</h2>
<ui-person-calendar events='{{ page.get_fullcalendar_data|safe }}'></ui-person-calendar>
<div class="__js-root">
<ui-month-calendar events='{{ page.get_fullcalendar_data|safe }}'></ui-month-calendar>
</div>
</section>
{% endif %}
</section>
......
......@@ -503,7 +503,7 @@ class MainArticlesPage(
def get_all_articles_search_response(self, request):
article_paginator = Paginator(
MainArticlePage.objects.live().search(request.GET["q"]).order_by("-date"),
MainArticlePage.objects.live().order_by("-date").search(request.GET["q"]),
10,
)
article_page = article_paginator.get_page(request.GET.get("page", 1))
......@@ -527,7 +527,7 @@ class MainArticlesPage(
query = request.GET["q"]
article_results = (
MainArticlePage.objects.live().search(query).order_by("-date")[:11]
MainArticlePage.objects.live().order_by("-date").search(query)[:11]
)
return render(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment