SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit a7bb6163 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Beautify forums with pills

parent 8a8c825f
No related branches found
No related tags found
No related merge requests found
<li> <li class="d-flex justify-content-between">
<a href="{{ forum.get_absolute_url }}">{{ forum }}</a> <a href="{{ forum.get_absolute_url }}">{{ forum }}</a>
<span class="badge badge-secondary badge-pill">{% with nr_posts=forum.nr_posts %}{{ nr_posts }} post{{ nr_posts|pluralize }}{% endwith %}</span>
{% if forum.child_forums.all|length > 0 %} {% if forum.child_forums.all|length > 0 %}
<ul class="list-unstyled forumList"> <ul class="list-unstyled forumList">
{% for child in forum.child_forums.all %} {% for child in forum.child_forums.all %}
......
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h3 class="highlight">{{ forum.name }}</h3> <h3 class="highlight d-flex justify-content-between">
{{ forum.name }}
<span class="badge badge-primary badge-pill">{% with nr_posts=forum.nr_posts %}{{ nr_posts }} post{{ nr_posts|pluralize }}{% endwith %}</span>
</h3>
{% if forum.parent %} {% if forum.parent %}
<p>Parent: <a href="{{ forum.parent.get_absolute_url }}">{{ forum.parent }}</a></p> <p>Parent: <a href="{{ forum.parent.get_absolute_url }}">{{ forum.parent }}</a></p>
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
<div class="card-columns"> <div class="card-columns">
{% for forum in object_list %} {% for forum in object_list %}
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header d-flex justify-content-between">
<a href="{{ forum.get_absolute_url }}">{{ forum }}</a> <a href="{{ forum.get_absolute_url }}">{{ forum }}</a>
<span class="badge badge-primary badge-pill">{{ forum.nr_posts }} posts</span>
</div> </div>
<div class="card-body"> <div class="card-body">
Forum description Forum description
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
{% if post.followup_posts.all|length > 0 %} {% if post.followup_posts.all|length > 0 %}
<div class="followupPosts"> <div class="followupPosts">
<h3>Replies [{{ post.nr_followups }}]:</h3> <h3><span class="badge badge-primary badge-pill">{% with nr_followups=post.nr_followups %}{{ nr_followups }} repl{{ nr_followups|pluralize:"y,ies" }}{% endwith %}</span></h3>
{% for followup in post.followup_posts.all %} {% for followup in post.followup_posts.all %}
{% include 'forums/post_card.html' with post=followup %} {% include 'forums/post_card.html' with post=followup %}
{% endfor %} {% endfor %}
......
...@@ -56,7 +56,7 @@ class ForumDeleteView(PermissionRequiredMixin, DeleteView): ...@@ -56,7 +56,7 @@ class ForumDeleteView(PermissionRequiredMixin, DeleteView):
""" """
A Forum can only be deleted if it does not have any descendants. A Forum can only be deleted if it does not have any descendants.
Upon deletion, all object-level permissions associated to the Upon deletion, all object-level permissions associated to the
Forum are explicitly removed. Forum are explicitly removed, to avoid orphaned permissions.
""" """
forum = get_object_or_404(Forum, slug=self.kwargs.get('slug')) forum = get_object_or_404(Forum, slug=self.kwargs.get('slug'))
groups_perms_dict = get_groups_with_perms(forum, attach_perms=True) groups_perms_dict = get_groups_with_perms(forum, attach_perms=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment