Skip to content
Snippets Groups Projects
Commit b1c70f58 authored by quido.zientek's avatar quido.zientek
Browse files

[FIX] model

parent b446f051
No related branches found
No related tags found
3 merge requests!607Pirati.cz,!593Feature/5 ajax content na homepage,!575Feature/pirati cz
Pipeline #9483 passed
......@@ -160,7 +160,9 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
def get_context(self, request, *args, **kwargs):
context = super().get_context(request, args, kwargs)
context["tweet_list"] = Tweet.objects.order_by("-twitter_id")[:4]
tweet_list = Tweet.objects.order_by("-twitter_id")
context["tweet_list"] = tweet_list[:4]
context["show_next_tweet"] = len(tweet_list) > 4
context["regions"] = REGION_CHOICES
last_month = timezone.now().today().replace(day=1) - timedelta(days=1)
first_day_of_last_month = last_month.replace(day=1)
......
......@@ -5,7 +5,7 @@
<div id="tweetsList">
{% include 'main/includes/twitter_widget.html' with tweet_list=tweet_list %}
</div>
{% if tweet_list.has_next %}
{% if show_next_tweet %}
<div class="text-center">
<a
onclick="showMoreTweets(this)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment