Skip to content

Commit

Permalink
runs linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopicchio committed Dec 11, 2024
1 parent 92e2dc4 commit 2600694
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/navigation_prototype/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Nav(ClusterableModel):
InlinePanel("links", label="Links", min_num=1),
]


class NavLinkBase(Orderable):
label = models.CharField(max_length=255)
url = models.URLField(null=True, blank=True)
Expand Down Expand Up @@ -54,10 +55,11 @@ class PrimaryNavLink(ClusterableModel, NavLinkBase):
InlinePanel("child_links", label="Sub links"),
]

class SecondaryNavLink(NavLinkBase):

class SecondaryNavLink(NavLinkBase):
parent_link = ParentalKey(
"PrimaryNavLink",
on_delete=models.PROTECT,
null=True,
related_name="child_links",
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
{% if l.child_links.exists %}
<ul>
{% for cl in l.child_links.all %}
<li><a href="{{ cl.get_url }}">{{ cl.label }}</a></li>
<li>
<a href="{{ cl.get_url }}">{{ cl.label }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
Expand Down Expand Up @@ -66,4 +68,4 @@
.nav-proto-ul li ul li a:hover {
background-color: #f0f0f0;
}
</style>
</style>
1 change: 1 addition & 0 deletions src/navigation_prototype/templatetags/nav_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from navigation_prototype.models import Nav


register = template.Library()


Expand Down
1 change: 1 addition & 0 deletions src/navigation_prototype/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ class NavAdmin(ModelAdmin):
add_to_settings_menu = False
exclude_from_explorer = False


modeladmin_register(NavAdmin)

0 comments on commit 2600694

Please sign in to comment.