Skip to content

Commit

Permalink
(homepage) hide newsfeed
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Mar 12, 2024
1 parent d864220 commit 0bbeffc
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 38 deletions.
2 changes: 0 additions & 2 deletions lacommunaute/pages/tests/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

def test_context_data(client, db):
topic = TopicFactory(with_post=True, forum=ForumFactory())
news = TopicFactory(with_post=True, forum=ForumFactory(kind=ForumKind.NEWS))
article = ForumFactory(parent=ForumFactory(type=1))

disapproved_topic = TopicFactory(with_post=True, forum=ForumFactory())
Expand All @@ -26,7 +25,6 @@ def test_context_data(client, db):
assert response.status_code == 200

assert response.context_data["topics_public"].get() == topic
assert response.context_data["topics_newsfeed"].get() == news
assert response.context_data["forums_category"].get() == article


Expand Down
1 change: 0 additions & 1 deletion lacommunaute/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context["topics_public"] = Topic.objects.filter(forum__kind=ForumKind.PUBLIC_FORUM, approved=True).order_by(
"-created"
)[:4]
context["topics_newsfeed"] = Topic.objects.filter(forum__kind=ForumKind.NEWS).order_by("-last_post_on")[:4]
context["forums_category"] = Forum.objects.filter(kind=ForumKind.PUBLIC_FORUM, parent__type=1).order_by(
"-updated"
)[:4]
Expand Down
29 changes: 1 addition & 28 deletions lacommunaute/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,34 +111,7 @@ <h3 class="m-0">
</div>
</div>
</div>
<div class="s-section__col col-12 col-md-6 mb-3 mb-md-5">
<div class="c-box p-0 h-100">
<div class="p-3 p-lg-4 bg-light">
<h3 class="m-0">
<i class="ri-newspaper-line ri-lg font-weight-normal"></i>
Les dernières actualités
</h3>
</div>
<div class="px-3 px-lg-4 pt-3 pt-lg-4">
<ul class="list-unstyled mb-lg-5">
{% for topic in topics_newsfeed %}
<li class="mb-3 position-relative">
<a href="{% url 'forum_conversation:topic' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
class="matomo-event btn-link stretched-link"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="news">{{ topic.subject }}</a>
{% include "forum_conversation/partials/poster_light.html" with poster=None dated=topic.created only %}
</li>
{% endfor %}
</ul>
</div>
<div class="p-3 p-lg-4">
<a href="{{ newsfeed_url }}" class="btn btn-outline-primary btn-block matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="news">{% trans "See all news" %}</a>
</div>
</div>
</div>
<div class="s-section__col col-12 col-md-6 mb-3 mb-md-5">
<div class="s-section__col col-12 mb-3 mb-md-5">
<div class="c-box p-0 h-100">
<div class="p-3 p-lg-4 bg-light">
<h3 class="m-0">
Expand Down
3 changes: 0 additions & 3 deletions lacommunaute/templates/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<li>
<a href="{% url 'forum_conversation_extension:topics' %}">{% trans "Discussion area" %}</a>
</li>
<li>
<a href="{% url 'forum_conversation_extension:newsfeed' %}">Actualités</a>
</li>
<li>
<a href="{% url 'forum_extension:documentation' %}">{% trans "Documents" %}</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% load theme_inclusion %}
{% url 'pages:home' as home_url %}
{% url 'forum_conversation_extension:topics' as publicforum_url %}
{% url 'forum_conversation_extension:newsfeed' as newsfeed_url %}
{% url 'forum_extension:documentation' as documentation_url %}
{% url 'members:seekers' as seeker_url %}
{% url 'search:index' as search_url %}
Expand All @@ -15,9 +14,6 @@
<li class="col-12 col-lg-auto">
<a href="{{ publicforum_url }}" class="{% if request.path == publicforum_url %}is-active {% endif %}matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="topics">{% trans "Discussion area" %}</a>
</li>
<li>
<a href="{{ newsfeed_url }}" class="{% if request.path == newsfeed_url %}is-active {% endif %}matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="news_header">Actualités</a>
</li>
<li>
<a href="{{ documentation_url }}"
class="{% if request.path == documentation_url %}is-active{% endif %}matomo-event"
Expand Down

0 comments on commit 0bbeffc

Please sign in to comment.