Skip to content
Snippets Groups Projects
Verified Commit 5c462e49 authored by jindra12's avatar jindra12
Browse files

Start working on uniweb + fix templates

parent 4c62ed7e
No related branches found
No related tags found
2 merge requests!816Release,!801Prepare basic shared tags
...@@ -525,8 +525,8 @@ class MainArticlesPage( ...@@ -525,8 +525,8 @@ class MainArticlesPage(
self.append_all_shared_articles_query( self.append_all_shared_articles_query(
MainArticlePage.objects.search( MainArticlePage.objects.search(
request.GET["q"], request.GET["q"],
),
custom_article_query=lambda query: query.search(request.GET["q"]), custom_article_query=lambda query: query.search(request.GET["q"]),
)
), ),
10, 10,
request.GET.get("page", 1), request.GET.get("page", 1),
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9"> <div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9">
<div class="flex flex-wrap font-bold mb-4 text-xs text-white uppercase"> <div class="flex flex-wrap font-bold mb-4 text-xs text-white uppercase">
<span class="mb-1 bg-green-500 mr-1 px-2 py-2">{{ article_page.date }}</span> <span class="mb-1 bg-green-500 mr-1 px-2 py-2">{{ article_page.date }}</span>
{% for tag in article_page.tags.all %} {% for tag in article_page.get_tags %}
<span class="bg-violet-600 mb-1 mr-1 px-2 py-2">{{ tag }}</span> <span class="bg-violet-600 mb-1 mr-1 px-2 py-2">{{ tag }}</span>
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</a> </a>
<div class="flex font-bold mb-4 text-xs text-white uppercase"> <div class="flex font-bold mb-4 text-xs text-white uppercase">
<span class="bg-green-500 mr-1 p-2">{{ article_page.date }}</span> <span class="bg-green-500 mr-1 p-2">{{ article_page.date }}</span>
{% for tag in article_page.tags.all %} {% for tag in article_page.get_tags %}
<span class="bg-violet-600 mr-1 p-2">{{ tag }}</span> <span class="bg-violet-600 mr-1 p-2">{{ tag }}</span>
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9"> <div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9">
<div class="flex font-bold mb-4 text-xs text-white uppercase"> <div class="flex font-bold mb-4 text-xs text-white uppercase">
<span class="bg-green-500 mr-1 px-2 py-2">{{ article_preview.date }}</span> <span class="bg-green-500 mr-1 px-2 py-2">{{ article_preview.date }}</span>
{% for tag in article_preview.tags.all %} {% for tag in article_preview.get_tags %}
<span class="bg-violet-600 mr-1 px-2 py-2">{{ tag }}</span> <span class="bg-violet-600 mr-1 px-2 py-2">{{ tag }}</span>
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -583,9 +583,8 @@ class ArticlesMixin(models.Model): ...@@ -583,9 +583,8 @@ class ArticlesMixin(models.Model):
lambda article: article.page_ptr.id, lambda article: article.page_ptr.id,
filter( filter(
lambda article: article.shared_type == page_type lambda article: article.shared_type == page_type
or ( if article.shared_type is not None
article.shared_type is None and own_page_type.value == page_type else own_page_type.value == page_type,
),
articles, articles,
), ),
) )
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
{% if article.has_tags %} {% if article.has_tags %}
<div class="inline-block-nogap mt-4"> <div class="inline-block-nogap mt-4">
{% for tag in article.tags.all %} {% for tag in article.get_tags %}
<a href="{% pageurl article.tag_filter_page %}?tag={{ tag }}" class="btn article-card__category-button btn--grey-125 btn--condensed text-sm font-light"> <a href="{% pageurl article.tag_filter_page %}?tag={{ tag }}" class="btn article-card__category-button btn--grey-125 btn--condensed text-sm font-light">
<div class="btn__body ">{{ tag }}</div> <div class="btn__body ">{{ tag }}</div>
</a> </a>
......
...@@ -558,19 +558,12 @@ class UniwebArticlesIndexPage( ...@@ -558,19 +558,12 @@ class UniwebArticlesIndexPage(
else articles, else articles,
) )
articles_ids = self.append_all_shared_articles_ids_with_type(
own_children,
filter=lambda articles: articles.filter(**tag_params)
if tag is not None
else articles,
)
context["articles"] = self.get_page_with_shared_articles( context["articles"] = self.get_page_with_shared_articles(
articles, articles,
ARTICLES_PER_PAGE, ARTICLES_PER_PAGE,
num, num,
) )
context["tags"] = self.search_tags_by_unioned_id_query(articles_ids) context["tags"] = self.search_tags_by_unioned_id_query(articles)
context["active_tag"] = tag context["active_tag"] = tag
return context return context
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
{% if page.has_tags %} {% if page.has_tags %}
<div class="my-4"> <div class="my-4">
{% for tag in page.tags.all %} {% for tag in page.get_tags %}
<a href="{% pageurl page.tag_filter_page %}?tag={{ tag }}" class="btn btn--grey-125 btn--condensed"> <a href="{% pageurl page.tag_filter_page %}?tag={{ tag }}" class="btn btn--grey-125 btn--condensed">
<div class="btn__body ">{{ tag }}</div> <div class="btn__body ">{{ tag }}</div>
</a> </a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment