-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrap 4 menus #328 #352
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% extends 'menus/bootstrap4/main_menu_dropdown.html' %} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% load menu_tags %} | ||
<ul class="navbar-nav mr-auto"> | ||
{% for item in menu_items %} | ||
<li class="nav-item {{ item.active_class }}{% if item.has_children_in_menu %} dropdown{% endif %}"> | ||
<a href="{{ item.href }}" class="nav-link{% if item.has_children_in_menu %} dropdown-toggle" id="ddtoggle_{{ item.link_page.pk }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"{% else %}"{% endif %}>{{ item.text }}{% if item.has_children_in_menu %} <span class="caret"></span>{% endif %}</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this would be slightly easier to follow if there were 2 if statements on this line - one within |
||
{% if item.has_children_in_menu %} | ||
{% sub_menu item template="menus/bootstrap4/sub_menu.html" %} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% load menu_tags %} | ||
{% if menu_items %} | ||
<div class="dropdown-menu" aria-labelledby="ddtoggle_{{ parent_page.pk }}"> | ||
{% for item in menu_items %} | ||
<a href="{{ item.href }}" class="dropdown-item{% if item.has_children_in_menu %} dropdown-toggle" id="ddtoggle_{{ item.pk }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"{% else %}"{% endif %}>{{ item.text }}{% if item.has_children_in_menu %} <span class="caret"></span>{% endif %}</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We seem to have gone from having Also, I think we should end the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ababic It may be a bit late ... but the bootstrap 4 docs do "recommend" the dropdown is rendered as a https://getbootstrap.com/docs/4.5/components/navbar/#supported-content
|
||
{% if item.has_children_in_menu %} | ||
{% sub_menu item template=current_template %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no difference between this and
main_menu_dropdown.html
, I think it might just be simpler to just renamemain_menu_dropdown.html
tomain_menu.html
.