layout.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {% extends "cranefly/base.html" %}
  2. {% from "cranefly/macros.html" import messages_list %}
  3. {% block body %}
  4. <div id="wrap">
  5. <div class="navbar navbar-header navbar-static-top">
  6. <div class="navbar-inner">
  7. <div class="container">
  8. <a href="{{ url('index') }}" class="brand">{% if settings.board_header %}{{ settings.board_header }}{% else %}{{ settings.board_name }}{% endif %}</a>
  9. {% if acl.search.can_search() and not user.is_crawler() %}
  10. <form action="{{ url('search') }}" method="post" class="navbar-form pull-left">
  11. <div class="navbar-search-form">
  12. <div id="navbar-search" class="navbar-search-border">
  13. <div class="navbar-search-text">
  14. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  15. {% if thread is defined %}
  16. <input type="hidden" name="search_thread" value="{{ thread.pk }}">
  17. {% elif search_thread is defined %}
  18. <input type="hidden" name="search_thread" value="{{ search_thread.pk }}">
  19. {% endif %}
  20. <input type="text" id="search-field" name="search_query" placeholder="{% trans %}Search...{% endtrans %}"{% if search_query is defined and search_query %} value="{{ search_query }}"{% endif %}>
  21. </div>
  22. <div class="extra">
  23. <div class="extra-form">
  24. <div class="control">
  25. <label>{% trans %}Search in{% endtrans %}:</label>
  26. <select name="search_in">
  27. <option value="forums"{% if not search_in is defined or search_in == 'forums' %} selected="selected"{% endif %}>Forums</option>
  28. {% if settings.enable_private_threads and acl.private_threads.can_participate()%}
  29. <option value="private"{% if search_in == 'private' %} selected="selected"{% endif %}>Private threads</option>
  30. {% endif %}
  31. {% if acl.reports.can_handle() %}
  32. <option value="reports"{% if search_in == 'reports' %} selected="selected"{% endif %}>Reports</option>
  33. {% endif %}
  34. {% if thread is defined %}
  35. <option value="thread"{% if search_in == 'thread' %} selected="selected"{% endif %}>{% trans %}This thread{% endtrans %}</option>
  36. {% elif search_thread is defined %}
  37. <option value="thread"{% if search_in == 'thread' %} selected="selected"{% endif %}>{% trans thread=search_thread.name %}In thread "{{ thread }}"{% endtrans %}</option>
  38. {% endif %}
  39. </select>
  40. </div>
  41. <div class="control">
  42. <label>{% trans %}Author name{% endtrans %}:</label>
  43. <input type="text" name="search_author" placeholder="User name..."{% if search_author is defined and search_author %} value="{{ search_author }}"{% endif %}>
  44. </div>
  45. <div class="control">
  46. <label class="checkbox">
  47. <input name="search_thread_titles" type="checkbox"{% if search_thread_titles is defined and search_thread_titles %} checked="checked"{% endif %}> {% trans %}Search only in threads titles{% endtrans %}
  48. </label>
  49. </div>
  50. </div>
  51. <div class="form-actions">
  52. <button type="submit" class="btn btn-primary"><i class="icon-search"></i> {% trans %}Search{% endtrans%}</button>
  53. {#<a href="#">{% trans %}Advanced Search{% endtrans %}</a>#}
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </form>
  59. {% endif %}
  60. <ul class="nav navbar-blocks pull-left">
  61. <li><a href="{{ url('index') }}" title="{% trans %}Forum Home{% endtrans %}" class="tooltip-bottom"><i class="icon-th-list"></i></a></li>
  62. {{ hook_primary_menu_prepend|safe }}
  63. <li><a href="{{ url('popular_threads') }}" title="{% trans %}Popular Threads{% endtrans %}" class="hot tooltip-bottom"><i class="icon-fire"></i></a></li>
  64. <li><a href="{{ url('new_threads') }}" title="{% trans %}New Threads{% endtrans %}" class="fresh tooltip-bottom"><i class="icon-leaf"></i></a></li>{% if not user.crawler %}
  65. {% if 1==2 and acl.search.can_search() and not user.is_crawler() %}
  66. <li><a href="{{ url('search') }}" title="{% trans %}Search Forums{% endtrans %}" class="tooltip-bottom"><i class="icon-search"></i></a></li>{% endif %}
  67. {% endif %}
  68. <li><a href="{{ url('users') }}" title="{% trans %}Browse Users{% endtrans %}" class="tooltip-bottom"><i class="icon-user"></i></a></li>
  69. {% if settings.tos_url or settings.tos_content %}<li><a href="{% if settings.tos_url %}{{ settings.tos_url }}{% else %}{{ url('tos') }}{% endif %}" title="{% if settings.tos_title %}{{ settings.tos_title }}{% else %}{% trans %}Forum Terms of Service{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-certificate"></i></a></li>{% endif %}
  70. {{ hook_primary_menu_append|safe }}
  71. </ul>
  72. {% if not user.is_crawler() %}
  73. {% if user.is_authenticated() %}
  74. <ul id="fancy-user-nav" class="nav navbar-blocks navbar-compact pull-right">
  75. {{ hook_user_menu_important_prepend|safe }}
  76. {% if acl.reports.can_handle() and monitor.reported_posts %}
  77. <li><a href="{{ url('reports') }}" title="{% trans %}There are unresolved reports!{% endtrans %}" class="tooltip-bottom"><i class="icon-fire"></i><span class="label label-important">{{ monitor.reported_posts }}</span></a></li>
  78. {% endif %}
  79. {% if user.alerts %}
  80. <li><a href="{{ url('alerts') }}" title="{% trans %}You have new notifications!{% endtrans %}" class="tooltip-bottom"><i class="icon-asterisk"></i><span class="label label-important">{{ user.alerts }}</span></a></li>
  81. {% endif %}
  82. {% if settings.enable_private_threads and acl.private_threads.can_participate() and user.unread_pds %}
  83. <li><a href="{{ url('private_threads') }}" title="{% trans %}There are unread Private Threads!{% endtrans %}" class="tooltip-bottom"><i class="icon-inbox"></i><span class="label label-important">{{ user.unread_pds }}</span></a></li>
  84. {% endif %}
  85. {{ hook_user_menu_important_append|safe }}
  86. <li class="user-profile dropdown">
  87. <a href="{{ url('user', user=user.id, username=user.username_slug) }}" class="dropdown-toggle" data-toggle="dropdown"><div>{{ user.username }} <img src="{{ user.get_avatar(28) }}" alt=""><span class="caret-border"><b class="caret"></b></span></div></a>
  88. <ul class="dropdown-menu">
  89. <li><a href="{{ url('user', user=user.id, username=user.username_slug) }}"><i class="icon-user"></i> {% trans %}Your profile{% endtrans %}</a></li>
  90. <li><a href="{{ url('usercp') }}"><i class="icon-cog"></i> {% trans %}Change options{% endtrans %}</a></li>
  91. <li role="presentation" class="divider"></li>
  92. {% if acl.reports.can_handle() %}
  93. <li><a href="{{ url('reports') }}">{% if monitor.reported_posts %}<span class="label">{{ monitor.reported_posts }}</span>{% endif %}<i class="icon-fire"></i> {% trans %}Reported Posts{% endtrans %}</a></li>
  94. {% endif %}
  95. <li><a href="{{ url('alerts') }}">{% if user.alerts %}<span class="label">{{ user.alerts }}</span>{% endif %}<i class="icon-asterisk"></i> {% trans %}Notifications{% endtrans %}</a></li>
  96. {{ hook_user_menu_dropdown_prepend|safe }}
  97. {% if settings.enable_private_threads and acl.private_threads.can_participate() %}
  98. <li><a href="{{ url('private_threads') }}">{% if user.unread_pds %}<span class="label">{{ user.unread_pds }}</span>{% endif %}<i class="icon-inbox"></i> {% trans %}Private Threads{% endtrans %}</a></li>
  99. {% endif %}
  100. <li><a href="{{ url('newsfeed') }}"><i class="icon-signal"></i> {% trans %}News Feed{% endtrans %}</a></li>
  101. <li><a href="{{ url('watched_threads') }}"><i class="icon-bookmark"></i> {% trans %}Watched Threads{% endtrans %}</a></li>
  102. {{ hook_user_menu_dropdown_prepend|safe }}
  103. <li role="presentation" class="divider"></li>
  104. <li><form action="{{ url('sign_out') }}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><button type="submit" class="btn btn-link danger"><i class="icon-off"></i> {% trans %}Sign out{% endtrans %}</button></form></li>
  105. </ul>
  106. </li>
  107. </ul>
  108. <noscript>
  109. <ul class="nav navbar-blocks pull-right">
  110. {{ hook_user_menu_prepend|safe }}
  111. <li><a href="{{ url('alerts') }}" title="{% if user.alerts %}{% trans %}You have new notifications!{% endtrans %}{% else %}{% trans %}Your Notifications{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-asterisk"></i>{% if user.alerts %}<span class="label label-important">{{ user.alerts }}</span>{% endif %}</a></li>
  112. {% if acl.reports.can_handle() %}
  113. <li><a href="{{ url('reports') }}" title="{% if monitor.reported_posts %}{% trans %}There are unresolved reports!{% endtrans %}{% else %}{% trans %}Reports{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-fire"></i>{% if monitor.reported_posts %}<span class="label label-important">{{ monitor.reported_posts }}</span>{% endif %}</a></li>
  114. {% endif %}
  115. {% if settings.enable_private_threads and acl.private_threads.can_participate() %}
  116. <li><a href="{{ url('private_threads') }}" title="{% if user.unread_pds %}{% trans %}There are unread Private Threads!{% endtrans %}{% else %}{% trans %}Your Private Threads{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-inbox"></i>{% if user.unread_pds %}<span class="label label-important">{{ user.unread_pds }}</span>{% endif %}</a></li>
  117. {% endif %}
  118. <li><a href="{{ url('newsfeed') }}" title="{% trans %}Your News Feed{% endtrans %}" class="tooltip-bottom"><i class="icon-signal"></i></a></li>
  119. <li><a href="{{ url('watched_threads') }}" title="{% trans %}Threads you are watching{% endtrans %}" class="tooltip-bottom"><i class="icon-bookmark"></i></a></li>
  120. <li><a href="{{ url('usercp') }}" title="{% trans %}Edit your profile options{% endtrans %}" class="tooltip-bottom"><i class="icon-cog"></i></a></li>
  121. {{ hook_user_menu_append|safe }}
  122. <li class="user-profile"><a href="{{ url('user', user=user.id, username=user.username_slug) }}" title="{% trans %}Go to your profile{% endtrans %}" class="tooltip-bottom"><div><img src="{{ user.get_avatar(28) }}" alt=""> {{ user.username }}</div></a></li>
  123. <li><form action="{{ url('sign_out') }}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><button type="submit" title="{% trans %}Sign Out and browse as guest{% endtrans %}" class="btn btn-link danger tooltip-bottom"><i class="icon-off"></i></button></form></li>
  124. </ul>
  125. </noscript>
  126. {% else %}
  127. <ul class="nav navbar-user-nav pull-right">
  128. {{ hook_guest_menu_prepend|safe }}
  129. <li><a href="{{ url('sign_in') }}" title="{% trans %}Sign In to Your Account{% endtrans %}" class="tooltip-bottom btn btn-danger"><i class="icon-check"></i> {% trans %}Sign In{% endtrans %}</a></li>{% if settings.account_activation != 'block' %}
  130. <li><a href="{{ url('register') }}" title="{% trans %}Register new account{% endtrans %}" class="tooltip-bottom btn btn-inverse"><i class="icon-edit"></i> {% trans %}Register{% endtrans %}</a></li>{% endif %}
  131. {{ hook_guest_menu_append|safe }}
  132. </ul>
  133. {% endif %}
  134. {% endif %}
  135. </div>
  136. </div>
  137. </div>
  138. {% block container %}
  139. <div class="container container-primary">
  140. {{ messages_list(messages) }}
  141. {% block content %}
  142. {% endblock %}
  143. </div>
  144. {% endblock %}
  145. </div><!--/#wrap -->
  146. <footer>
  147. <div class="container">
  148. <ul class="breadcrumb">
  149. {% block breadcrumb %}<li class="first"><a href="{{ url('index') }}">{{ settings.board_name }}</a>{% endblock %}</li>
  150. {{ hook_foot_menu_prepend|safe }}
  151. <li class="pull-right"><i class="icon-move"></i> <a href="{{ url('forum_map') }}">{% trans %}Forum Map{% endtrans %}</a></li>
  152. {{ hook_foot_menu_append|safe }}
  153. </ul>
  154. <hr>
  155. <div class="credits">
  156. <p>
  157. {% if settings.board_credits %}
  158. {{ settings.board_credits|safe }}<br>
  159. {% endif %}
  160. <a href="http://misago-project.org">This community is powered by Misago forum software by Rafał Pitoń</a>
  161. </p>
  162. {{ hook_html_credits_side|safe }}
  163. </div>
  164. </div>
  165. </footer>{% endblock %}