Skip to content

Commit 8255a74

Browse files
committed
🔥 remove icon field in fds_page_extension
1 parent b169090 commit 8255a74

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

‎fragdenstaat_de/fds_cms/models.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
@extension_pool.register
2424
class FdsPageExtension(PageExtension):
25-
search_index = models.BooleanField(default=True)
25+
search_index = models.BooleanField(
26+
_("Show in search results and search engines"), default=True
27+
)
2628
image = FilerImageField(
2729
null=True,
2830
blank=True,
@@ -33,21 +35,22 @@ class FdsPageExtension(PageExtension):
3335
breadcrumb_ancestor = PageField(
3436
null=True,
3537
blank=True,
36-
help_text=_("If present, this page will be displayed as the ancestor in the breadcrumbs."),
37-
verbose_name=_("Ancestor"),
38-
related_name='breadcrumb_ancestor'
39-
)
40-
ancestor_only_upwards = models.BooleanField(_("Only show the breadcrumb ancestor on this page, but not its children"), default=True)
41-
icon = models.CharField(
42-
_("Icon"),
43-
max_length=50,
44-
blank=True,
4538
help_text=_(
46-
"""Enter an icon name from the <a href="https://fontawesome.com/v4.7.0/icons/" target="_blank">FontAwesome 4 icon set</a>"""
39+
"If present, this page will be displayed as the ancestor in the breadcrumbs."
4740
),
41+
verbose_name=_("Ancestor"),
42+
related_name="breadcrumb_ancestor",
43+
)
44+
ancestor_only_upwards = models.BooleanField(
45+
_("Only show the breadcrumb ancestor on this page, but not its children"),
46+
default=True,
4847
)
4948
breadcrumb_background = models.CharField(
50-
_("Breadcrumbs background"), choices=BACKGROUND, default="", max_length=50, blank=True
49+
_("Breadcrumbs background"),
50+
choices=BACKGROUND,
51+
default="",
52+
max_length=50,
53+
blank=True,
5154
)
5255

5356

Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
{% load i18n %}
22
{% load fds_cms_tags %}
33
{% load cms_tags %}
4-
54
<li class="breadcrumb-item">
65
{% page_url "home" as home_url %}
76
<a href="{{ home_url|default:'/' }}">
87
<i class="fa fa-home"></i>
98
<span class="sr-only">{% trans "Home Page" %}</span>
109
</a>
1110
</li>
12-
1311
{% get_breadcrumb_ancestor ancestors.0 as custom_ancestor %}
1412
{% if custom_ancestor %}
15-
<li class="breadcrumb-item">
16-
{% if custom_ancestor.icon %}<i class="fa fa-{{ custom_ancestor.icon }}" aria-hidden="true"></i>{% endif %}
17-
<a href="{{ custom_ancestor.url }}">
18-
{{ custom_ancestor.title }}
19-
</a>
20-
</li>
13+
<li class="breadcrumb-item">
14+
<a href="{{ custom_ancestor.url }}">{{ custom_ancestor.title }}</a>
15+
</li>
2116
{% endif %}
22-
2317
{% for ance in ancestors %}
2418
<li {% if forloop.last %}class="breadcrumb-item active" aria-current="page"{% else %}class="breadcrumb-item"{% endif %}>
25-
<a href="{{ ance.get_absolute_url }}"{% if forloop.last %} aria-current="page"{% endif %}>{{ ance.get_menu_title }}</a>
19+
<a href="{{ ance.get_absolute_url }}"
20+
{% if forloop.last %}aria-current="page"{% endif %}>{{ ance.get_menu_title }}</a>
2621
</li>
2722
{% endfor %}

‎fragdenstaat_de/fds_cms/templatetags/fds_cms_tags.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def get_soft_root(page):
8181

8282
@register.simple_tag(takes_context=True)
8383
def get_breadcrumb_ancestor(context, navigation_node):
84-
print(context)
8584
if navigation_node is None:
8685
return
8786

@@ -90,7 +89,6 @@ def get_breadcrumb_ancestor(context, navigation_node):
9089
except KeyError:
9190
return
9291

93-
9492
try:
9593
page = Page.objects.get(pk=navigation_node.id)
9694
ancestor = page.fdspageextension.breadcrumb_ancestor
@@ -106,6 +104,5 @@ def get_breadcrumb_ancestor(context, navigation_node):
106104

107105
title = ancestor.get_title(language=request.LANGUAGE_CODE)
108106
url = ancestor.get_absolute_url(language=request.LANGUAGE_CODE)
109-
icon = ancestor.fdspageextension.icon
110107

111-
return {"title": title, "url": url, "icon": icon}
108+
return {"title": title, "url": url}

0 commit comments

Comments
 (0)