Added comment preview functionality to user pages. It works by passing the comment...
[mediagoblin.git] / mediagoblin / templates / mediagoblin / base.html
index 5e2898f9602b7343038cec48e21f21eb46ae0e1f..1fc4467cf0e9aa3aeaecd7462c40932eb18201bc 100644 (file)
@@ -34,6 +34,8 @@
             src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script>
     <script type="text/javascript"
             src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script>
+    <script type="text/javascript"
+            src="{{ request.staticdirect('/js/notifications.js') }}"></script>
 
     {# For clarification, the difference between the extra_head.html template
      # and the head template hook is that the former should be used by
           <div class="header_right">
             {%- if request.user %}
               {% if request.user and request.user.status == 'active' %}
+
+                {% set notification_count = request.notifications.get_notification_count(request.user.id) %}
+                {% if notification_count %}
+                <a href="#notifications" 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" %}
@@ -67,7 +75,7 @@
                {% trans %}Verify your email!{% endtrans %}</a>
                or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>
               {% endif %}
-            {%- else %}
+            {%- elif auth %}
               <a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{
                                                 request.base_url|urlencode }}">
                 {%- trans %}Log in{% endtrans -%}
                   </a>
                 </p>
               {% endif %}
+              {% include 'mediagoblin/fragments/header_notifications.html' %}
             </div>
           {% endif %}
         </header>
           {% block mediagoblin_content %}
           {% endblock mediagoblin_content %}
         </div>
-        {%- block mediagoblin_footer %}
-          <footer>
-            {% trans -%}
-              Powered by <a href="http://mediagoblin.org/" title='Version {{ version }}'>MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project.
-            {%- endtrans %}
-            {% trans source_link=app_config['source_link'] -%}
-              Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available.
-            {%- endtrans %}
-          </footer>
-        {%- endblock mediagoblin_footer %}
+        {%- include "mediagoblin/bits/base_footer.html" %}
       </div>
     {%- endblock mediagoblin_body %}
     {% include 'mediagoblin/bits/body_end.html' %}