1. Thomas Woolford
  2. django-admintools-bootstrap

Commits

salvator  committed 396ba9f

#2 nested dropdowns (submenu-like)

  • Participants
  • Parent commits 9762b82
  • Branches default

Comments (0)

Files changed (2)

File admintools_bootstrap/static/admintools_bootstrap/lib/style.less

View file
  • Ignore whitespace
 .inline-addlink {
 	color: #fff !important;
 }
+
+.submenu {
+	li a {
+		padding-left: 25px !important;
+	}
+}

File admintools_bootstrap/templates/admin_tools/menu/item.html

View file
  • Ignore whitespace
 {% if not item.is_empty %}
 <li class="{% if not item.enabled %} disabled{% endif %}{% if selected %} active{% endif %}{% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}{% if item.children %} dropdown{% endif %}">
 <a href="{% if item.url and item.enabled %}{{ item.url }}{% else %}#{% endif %}"{% if item.description %} title="{{ item.description }}"{% endif %}{% if item.accesskey %} accesskey="{{ item.accesskey }}"{% endif %}
-  {% if item.children and item.enabled %}class="dropdown-toggle"{% endif %}>{{ item.title }}</a>
+  {% if item.children and item.enabled %}class="dropdown-toggle"{% endif %}>{{ item.title }}
+  </a>
     {% if item.children and item.enabled %}
-    <ul class="dropdown-menu">
+    <ul class="{% if index == 'submenu' %}submenu open{% else %}dropdown-menu{% endif %}">
         {% for child_item in item.children %}
-          {% admin_tools_render_menu_item child_item forloop.counter %}
+          {% admin_tools_render_menu_item child_item 'submenu' %}
         {% endfor %}
     </ul>
     {% endif %}