menu.tpl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!-- Fixed navbar -->
  2. {% if _u.logged == 1 and not user_in_anon_survey %}
  3. <script>
  4. $(document).ready(function () {
  5. $.get('{{ _p.web_main }}inc/ajax/message.ajax.php?a=get_count_message', function(data) {
  6. var countNotifications = (data.ms_friends + data.ms_groups + data.ms_inbox);
  7. if (countNotifications === 0 ) {
  8. $("#count_message_li").addClass('hidden');
  9. } else {
  10. $("#count_message_li").removeClass('hidden');
  11. $("#count_message").append(countNotifications);
  12. }
  13. });
  14. });
  15. </script>
  16. {% endif %}
  17. <nav class="navbar navbar-default">
  18. <div class="container">
  19. <div class="navbar-header">
  20. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  21. <span class="sr-only">Toggle navigation</span>
  22. <span class="icon-bar"></span>
  23. <span class="icon-bar"></span>
  24. <span class="icon-bar"></span>
  25. </button>
  26. <a class="navbar-brand" href="{{ _p.web }}">{{ _s.site_name }}</a>
  27. </div>
  28. <div id="navbar" class="collapse navbar-collapse">
  29. <ul class="nav navbar-nav">
  30. {% for item in menu %}
  31. {% set show_item = true %}
  32. {% if user_in_anon_survey and item.key != 'homepage' %}
  33. {% set show_item = false %}
  34. {% endif %}
  35. {% if show_item %}
  36. <li class="{{ item.key }} {{ item.current }}">
  37. <a href="{{ item.url }}" {{ item.target ? 'target="' ~ item.target ~ '"' : '' }} title="{{ item.title }}">
  38. {{ item.title }}
  39. </a>
  40. </li>
  41. {% endif %}
  42. {% endfor %}
  43. </ul>
  44. {% if _u.logged == 1 and not user_in_anon_survey %}
  45. <ul class="nav navbar-nav navbar-right">
  46. <li id="count_message_li" class="hidden">
  47. <a href="{{ message_url }}">
  48. <span id="count_message" class="badge badge-warning"></span>
  49. </a>
  50. </li>
  51. {% if language_form %}
  52. <li class="dropdown language">
  53. {{ language_form }}
  54. </li>
  55. {% endif %}
  56. {% if _u.status != 6 %}
  57. <li class="dropdown avatar-user">
  58. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
  59. aria-expanded="false">
  60. <img class="img-circle" src="{{ _u.avatar_small }}" alt="{{ _u.complete_name }}"/>
  61. <span class="username-movil">{{ _u.complete_name }}</span>
  62. <span class="caret"></span>
  63. </a>
  64. <ul class="dropdown-menu" role="menu">
  65. <li class="user-header">
  66. <div class="text-center">
  67. <a href="{{ profile_url }}">
  68. <img class="img-circle" src="{{ _u.avatar_medium }}" alt="{{ _u.complete_name }}"/>
  69. <p class="name">{{ _u.complete_name }}</p>
  70. </a>
  71. <p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ _u.email }}</p>
  72. </div>
  73. </li>
  74. <li role="separator" class="divider"></li>
  75. {% if message_url %}
  76. <li class="user-body">
  77. <a title="{{ "Inbox"|get_lang }}" href="{{ message_url }}">
  78. <em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|get_lang }}
  79. </a>
  80. </li>
  81. {% endif %}
  82. {% if pending_survey_url %}
  83. <li class="user-body">
  84. <a href="{{ pending_survey_url }}">
  85. <em class="fa fa-pie-chart"></em> {{ 'PendingSurveys'|get_lang }}
  86. </a>
  87. </li>
  88. {% endif %}
  89. {% if certificate_url %}
  90. <li class="user-body">
  91. <a title="{{ "MyCertificates"|get_lang }}" href="{{ certificate_url }}">
  92. <em class="fa fa-graduation-cap"
  93. aria-hidden="true"></em> {{ "MyCertificates"|get_lang }}
  94. </a>
  95. </li>
  96. {% endif %}
  97. <li class="user-body">
  98. <a id="logout_button" title="{{ "Logout"|get_lang }}" href="{{ logout_link }}">
  99. <em class="fa fa-sign-out"></em> {{ "Logout"|get_lang }}
  100. </a>
  101. </li>
  102. </ul>
  103. </li>
  104. {% endif %}
  105. </ul>
  106. {% endif %}
  107. </div><!--/.nav-collapse -->
  108. </div>
  109. </nav>