Improving the whitespace around the {% trans %} adjustments from tilly-q
[mediagoblin.git] / mediagoblin / templates / mediagoblin / base.html
index 25186b18e829b699a7f304126c35d802bc6b3a45..6394fa4f384221a3f120edf395c791c34c44ebff 100644 (file)
@@ -23,6 +23,7 @@
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
     <title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title>
     <link rel="stylesheet" type="text/css"
           href="{{ request.staticdirect('/css/extlib/reset.css') }}"/>
@@ -36,6 +37,9 @@
             src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script>
     <script type="text/javascript"
             src="{{ request.staticdirect('/js/notifications.js') }}"></script>
+    <script>
+      var mark_all_comments_seen_url = "{{ request.urlgen('mediagoblin.notifications.mark_all_comment_notifications_seen') }}"
+    </script>
 
     {# For clarification, the difference between the extra_head.html template
      # and the head template hook is that the former should be used by
           {% block mediagoblin_header_title %}{% endblock %}
           <div class="header_right">
             {%- if request.user %}
-              {% if request.user and request.user.status == 'active' %}
+              {% if request.user and 
+                    request.user.has_privilege('active') and 
+                    not request.user.is_banned() %}
 
-                {% set notification_count = request.notifications.get_notification_count(request.user.id) %}
+                {% set notification_count = get_notification_count(request.user.id) %}
                 {% if notification_count %}
-                <a href="#notifications" class="notification-gem button_action" title="Notifications">
-                {{ notification_count }}</a>
+                  <a href="javascript:;" class="notification-gem button_action" title="Notifications">
+                  {{ notification_count }}</a>
                 {% endif %}
-                <div class="button_action header_dropdown_down">&#9660;</div>
-                <div class="button_action header_dropdown_up">&#9650;</div>
-              {% elif request.user and request.user.status == "needs_email_verification" %}
+                <a href="javascript:;" class="button_action header_dropdown_down">&#9660;</a>
+                <a href="javascript:;" class="button_action header_dropdown_up">&#9650;</a>
+              {% elif request.user and not request.user.has_privilege('active') %}
               {# the following link should only appear when verification is needed #}
                 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                  user=request.user.username) }}"
                    class="button_action_highlight">
                {% trans %}Verify your email!{% endtrans %}</a>
-               or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>
+               or <a id="logout" href=
+               {% if persona is not defined %}
+                 "{{ request.urlgen('mediagoblin.auth.logout') }}"
+               {% else %}
+                 "javascript:;"
+               {% endif %}
+               >{% trans %}log out{% endtrans %}</a>
+              {% elif request.user and request.user.is_banned() %}
+                <a id="logout" href=
+               {% if persona is not defined %}
+                 "{{ request.urlgen('mediagoblin.auth.logout') }}"
+               {% else %}
+                 "javascript:;"
+               {% endif %}
+               >{% trans %}log out{% endtrans %}</a>
+                <p class="fine_print">
+                  <a href="{{ request.urlgen('terms_of_service') }}">
+                    {%- trans %}Terms of Service{%- endtrans %}
+                  </a>
+                </p>
               {% endif %}
-            {%- else %}
-              <a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{
-                                                request.base_url|urlencode }}">
+            {%- elif auth %}
+            <a href=
+              {% if persona_auth is defined %}
+                "javascript:;" id="persona_login"
+              {% else %}
+                "{{ request.urlgen('mediagoblin.auth.login') }}"
+              {% endif %}
+              >
                 {%- trans %}Log in{% endtrans -%}
               </a>
             {%- endif %}
           </div>
           <div class="clear"></div>
-          {% if request.user and request.user.status == 'active' %}
+          {% if request.user and request.user.has_privilege('active') %}
             <div class="header_dropdown">
               <p>
                 <span class="dropdown_title">
                   {%- trans %}Media processing panel{% endtrans -%}
                 </a>
                 &middot;
-                <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}Log out{% endtrans %}</a>
+                <a id="logout" href=
+                  {% if persona is not defined %}
+                    "{{ request.urlgen('mediagoblin.auth.logout') }}"
+                  {% else %}
+                    "javascript:;"
+                  {% endif %}
+                  >{% trans %}Log out{% endtrans %}</a>
               </p>
               <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}">
                 {%- trans %}Add media{% endtrans -%}
               <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}">
                 {%- trans %}Create new collection{% endtrans -%}
               </a>
-              {% if request.user.is_admin %}
+              {% if request.user.has_privilege('admin','moderator') %}
                 <p>
-                  <span class="dropdown_title">Admin powers:</span>
-                  <a href="{{ request.urlgen('mediagoblin.admin.panel') }}">
+                  <span class="dropdown_title">Moderation powers:</span>
+                  <a href="{{ request.urlgen('mediagoblin.moderation.media_panel') }}">
                     {%- trans %}Media processing panel{% endtrans -%}
                   </a>
+                  &middot;
+                  <a href="{{ request.urlgen('mediagoblin.moderation.users') }}">
+                    {%- trans %}User management panel{% endtrans -%}
+                  </a>
+                  &middot;
+                  <a href="{{ request.urlgen('mediagoblin.moderation.reports') }}">
+                    {%- trans %}Report management panel{% endtrans -%}
+                  </a>
                 </p>
               {% endif %}
+                <p class="fine_print">
+                  <a href="{{ request.urlgen('terms_of_service') }}">Terms of Service</a>
+                </p>
               {% include 'mediagoblin/fragments/header_notifications.html' %}
             </div>
           {% endif %}
           {% include "mediagoblin/utils/messages.html" %}
           {% block mediagoblin_content %}
           {% endblock mediagoblin_content %}
+          {% if csrf_token is defined %}
+            {% template_hook("persona_form") %}
+          {% endif %}
         </div>
         {%- include "mediagoblin/bits/base_footer.html" %}
       </div>