Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jun 28, 2023
1 parent 20fc6bc commit cb357e2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
6 changes: 1 addition & 5 deletions lacommunaute/forum/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@

class ForumAdmin(BaseForumAdmin):
fieldsets = BaseForumAdmin.fieldsets
fieldsets[1][1]["fields"] += (
"members_group",
"invitation_token",
"kind",
)
fieldsets[1][1]["fields"] += ("members_group", "invitation_token", "kind", "short_description")
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.2 on 2023-06-28 10:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("forum", "0012_forum_short_description_alter_forum_kind"),
]

operations = [
migrations.AlterField(
model_name="forum",
name="short_description",
field=models.CharField(blank=True, max_length=400, null=True, verbose_name="Description courte (SEO)"),
),
]
2 changes: 1 addition & 1 deletion lacommunaute/forum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Forum(AbstractForum):
max_length=20, choices=Forum_Kind.choices, default=Forum_Kind.PUBLIC_FORUM, verbose_name="Type"
)
short_description = models.CharField(
max_length=160, blank=True, null=True, verbose_name="Description courte (SEO)"
max_length=400, blank=True, null=True, verbose_name="Description courte (SEO)"
)

objects = ForumQuerySet().as_manager()
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/templates/forum/category_forum_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ <h2>texte pour le SEO</h2>
{% endif %}
<div class="card-body pb-0">
<p class="h3 lh-base">{{ forum.name }}</p>
{% if forum.description %}
{% if forum.short_description %}
<div>
{{ forum.description.rendered|truncatechars_html:100 }}
{{ forum.short_description.rendered }}
</div>
{% endif %}
</div>
Expand Down
8 changes: 5 additions & 3 deletions lacommunaute/templates/forum/forum_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ <h3 class="h3 mb-0">
<div class="card c-card has-links-inside h-100">
<div class="card-body pb-0">
<p class="h3 lh-base">{{ node.obj.name }}</p>
<div>
{{ node.obj.description.rendered|truncatechars_html:200 }}
</div>
{% if node.obj.short_description %}
<div>
{{ node.obj.short_description }}
</div>
{% endif %}
</div>
<div class="card-footer text-right">
<a href="{% url 'forum_extension:forum' node.obj.slug node.obj.id %}"
Expand Down

0 comments on commit cb357e2

Please sign in to comment.