Commits

salvator  committed c8414d5

navigation menu subsections

  • Participants
  • Parent commits 36866bd

Comments (0)

Files changed (4)

File admintools_bootstrap/static/admintools_bootstrap/bootstrap/less/style.css

 .stacked-inline span.delete{float:right;}.stacked-inline span.delete label{width:50px;margin-top:0px;padding-top:4px;}
 .stacked-inline span.delete input{margin-top:5px;float:left;}
 .inline-addlink{color:#fff !important;}
-.submenu li a{padding-left:25px !important;}
 .results .sortoptions{float:right;margin-left:1em;}.results .sortoptions a{padding:0px !important;}
 #menu_search{position:absolute;z-index:900;border:1px solid #555555;background-color:#eeeeee;padding:10px;left:-180px;width:190px;top:40px;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);box-shadow:0 2px 4px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;display:none;}#menu_search ul{width:100%;margin-top:0.5em;}#menu_search ul li{list-style:none;float:none;padding:0px;}#menu_search ul li a{text-shadow:none;padding:0.2em 0.5em;color:#555555;}#menu_search ul li a:hover,#menu_search ul li a:focus{color:#eeeeee;background-color:#555555;}#menu_search ul li a:hover span.highlight,#menu_search ul li a:focus span.highlight{color:#eeeeee;font-weight:bold;}
 #menu_search ul li a span.highlight{color:#333333;font-weight:bold;}
 .collapsed_fieldset{background-color:#eeeeee;}.collapsed_fieldset .accordion-toggle{font-size:14pt;}
 #dashboard-panel ul li{list-style:none outside;}
 #navigation-menu li{list-style:none;}
-#navigation-menu a.dropdown-toggle .submenu{background-color:#9d261d;}

File admintools_bootstrap/static/admintools_bootstrap/bootstrap/less/style.less

 	color: #fff !important;
 }
 
-.submenu {
-	li a {
-		padding-left: 25px !important;
-	}
-}
-
 .results {
 	.sortoptions {
 		float: right;
 	li {
 		list-style: none;
 	}
-	a.dropdown-toggle .submenu {
-		background-color: @red;
-	}
 }

File admintools_bootstrap/templates/admin/base_site.html

 {% block extrastyle %}
 {{ block.super }}
 
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admintools_bootstrap/bootstrap/less/style.css" />
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}admintools_bootstrap/bootstrap/less/style.css?{% now "c" %}" />
 {#<script type="text/javascript" src="{{ STATIC_URL }}admintools_bootstrap/js/less-1.2.1.min.js"></script>#}
 {#<script type="text/javascript" src="{{ STATIC_URL }}admintools_bootstrap/js/less.js"></script>#}
 

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

 {% load admin_tools_menu_tags %}
 {% spaceless %}
 {% 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{% if index == 'submenu' %} submenu{% endif %}" data-toggle="dropdown"{% endif %}>
-    {% if item.icon %}<i class="{{ item.icon }}"></i> {% endif %}
-  {{ item.title }}
-    {% if item.children and item.enabled %}
-      <b class="caret"></b>
-    {% endif %}
-  </a>
-    {% if item.children and item.enabled %}
-    <ul class="{% if index == 'submenu' %}submenu{% else %}dropdown-menu{% endif %}">
+{% if index == 'submenu' %}
+  {# submenu - generating sub-section #}
+  <li class="{% if not item.enabled %}disabled{% endif %}{% if selected %} active{% endif %}{% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}{% if item.children %} nav-header{% endif %}">
+    {% if item.children %}
+      {{ item.title }}</li>
         {% for child_item in item.children %}
           {% admin_tools_render_menu_item child_item 'submenu' %}
         {% endfor %}
-    </ul>
+    {% else %}
+      <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.icon %}<i class="{{ item.icon }}"></i> {% endif %}
+          {{ item.title }}
+      </a>
+    </li>
     {% endif %}
-</li>
+{% else %}
+  {# top-level menu - generating dropdowns for submenus #}
+  <li class="{% spaceless %}{% if not item.enabled %} disabled{% endif %}
+    {% if selected %} active{% endif %}
+    {% if item.css_classes %} {{ item.css_classes|join:' ' }}{% endif %}
+    {% if item.children %} dropdown{% endif %}{% endspaceless %}">
+
+  <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" data-toggle="dropdown"{% endif %}>
+      {% if item.icon %}<i class="{{ item.icon }}"></i> {% endif %}
+      {{ item.title }}
+      {% if item.children and item.enabled %}
+        <b class="caret"></b>
+      {% endif %}
+    </a>
+      {% if item.children and item.enabled %}
+      <ul class="dropdown-menu nav-list">
+          {% for child_item in item.children %}
+            {% if not forloop.first and child_item.children %}
+              <li class="divider"></li>
+            {% endif %}
+            {% admin_tools_render_menu_item child_item 'submenu' %}
+          {% endfor %}
+      </ul>
+      {% endif %}
+  </li>
+  {% endif %}
 {% endif %}
 {% endspaceless %}