nav.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  2. <div class="container">
  3. <!-- Collapsed navigation -->
  4. <div class="navbar-header">
  5. <!-- Expander button -->
  6. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  7. <span class="sr-only">Toggle navigation</span>
  8. <span class="icon-bar"></span>
  9. <span class="icon-bar"></span>
  10. <span class="icon-bar"></span>
  11. </button>
  12. <!-- Main title -->
  13. <a class="navbar-brand" href="{{ homepage_url }}">{{ site_name }}</a>
  14. </div>
  15. <!-- Expanded navigation -->
  16. <div class="navbar-collapse collapse">
  17. <!-- Main navigation -->
  18. <ul class="nav navbar-nav">
  19. {% for nav_item in nav %}
  20. {% if nav_item.children %}
  21. <li class="dropdown{% if nav_item.active %} active{% endif %}">
  22. <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ nav_item.title }} <b class="caret"></b></a>
  23. <ul class="dropdown-menu">
  24. {% for nav_item in nav_item.children %}
  25. <li {% if nav_item.active %}class="active"{% endif %}>
  26. <a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
  27. </li>
  28. {% endfor %}
  29. </ul>
  30. </li>
  31. {% else %}
  32. <li {% if nav_item.active %}class="active"{% endif %}>
  33. <a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
  34. </li>
  35. {% endif %}
  36. {% endfor %}
  37. </ul>
  38. <!-- Search, Navigation and Repo links -->
  39. <ul class="nav navbar-nav navbar-right">
  40. {% if include_search %}
  41. <li>
  42. <a href="#searchModal" data-toggle="modal"><i class="fa fa-search"></i> Search</a>
  43. </li>
  44. {% endif %}
  45. {% if false %}
  46. <li {% if not previous_page %}class="disabled"{% endif %}>
  47. <a rel="next" {% if previous_page %}href="{{ previous_page.url }}"{% endif %}>
  48. <i class="fa fa-arrow-left"></i> Previous
  49. </a>
  50. </li>
  51. <li {% if not next_page %}class="disabled"{% endif %}>
  52. <a rel="prev" {% if next_page %}href="{{ next_page.url }}"{% endif %}>
  53. Next <i class="fa fa-arrow-right"></i>
  54. </a>
  55. </li>
  56. {% endif %}
  57. {% if repo_url %}
  58. <li>
  59. <a href="{{ repo_url }}">
  60. {% if repo_name == 'GitHub' %}
  61. <i class="fa fa-github"></i>
  62. {% elif repo_name == 'Bitbucket' %}
  63. <i class="fa fa-bitbucket"></i>
  64. {% endif %}
  65. {{ repo_name }}
  66. </a>
  67. </li>
  68. {% endif %}
  69. </ul>
  70. </div>
  71. </div>
  72. </div>