Skip to content

Commit

Permalink
removes pagination if there is only one page, fixe bug with reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmegatelo committed Jul 17, 2024
1 parent 35a2b4d commit fefacfe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions feed/templates/blocks/feed/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,28 @@ <h3 class="heading feed-links-list-item__title">
formaction="{% url 'api_feed_item_toggle_interesting' id=entry.id action='toggle_interesting' %}"
hx-post="{% url 'api_feed_item_toggle_interesting' id=entry.id action='toggle_interesting' %}"
>
<span class="feed-links-list-item-controls__icon {% if entry.hidden.exists %}active{% endif %}">
👎
</span>
<span class="feed-links-list-item-controls__icon {% if entry in request.user.usersettings.hidden_feed_items.all %}active{% endif %}">
👎
</span>
</button>
<button class="button button_blank button_sm feed-links-list-item-controls__button"
title="{% translate 'Like' noop %}"
type="submit"
formaction="{% url 'api_feed_item_toggle_interesting' id=entry.id action='toggle_liked' %}"
hx-post="{% url 'api_feed_item_toggle_interesting' id=entry.id action='toggle_liked' %}"
>
<span class="feed-links-list-item-controls__icon {% if entry.liked.exists %}active{% endif %}">
❤️
</span>
<span class="feed-links-list-item-controls__icon {% if entry in request.user.usersettings.liked_feed_items.all %}active{% endif %}">
❤️
</span>
</button>
</form>
</footer>
</li>
{% endfor %}
</ul>
{% include 'blocks/feed/pagination.html' %}
{% if page_obj.has_other_pages %}
{% include 'blocks/feed/pagination.html' %}
{% endif %}
{% else %}
<div class="centered-form-wrapper m-auto">
<img width="200" src="{% static 'feed/img/empty_feed.svg' %}"/>
Expand Down
2 changes: 1 addition & 1 deletion feed/views/feed/generic_feed_items_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class GenericFeedItemListView(ListView, PageMetaMixin):
model = FeedItem
paginate_by = 20
applied_filters = { 'liked': True, 'paid': True }
applied_filters = {'liked': True, 'paid': True}
title = _('My feed')

def setup(self, request, *args, **kwargs):
Expand Down

0 comments on commit fefacfe

Please sign in to comment.