At this point, I am very close to done with this code! I made one big change at
[mediagoblin:mediagoblin.git] / mediagoblin / templates / mediagoblin / base.html
1 {#
2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C) 2011, 2012 MediaGoblin contributors.  See AUTHORS.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14 #
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 -#}
18 <!doctype html>
19 <html
20 {% block mediagoblin_html_tag %}
21 {% endblock mediagoblin_html_tag %}
22 >
23   <head>
24     <meta charset="utf-8">
25     <meta name="viewport" content="width=device-width, initial-scale=1.0">
26     <meta http-equiv="X-UA-Compatible" content="IE=Edge">
27     <title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title>
28     <link rel="stylesheet" type="text/css"
29           href="{{ request.staticdirect('/css/extlib/reset.css') }}"/>
30     <link rel="stylesheet" type="text/css"
31           href="{{ request.staticdirect('/css/base.css') }}"/>
32     <link rel="shortcut icon"
33           href="{{ request.staticdirect('/images/goblin.ico') }}" />
34     <script type="text/javascript"
35             src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script>
36     <script type="text/javascript"
37             src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script>
38     <script type="text/javascript"
39             src="{{ request.staticdirect('/js/notifications.js') }}"></script>
40     <script>
41       var mark_all_comments_seen_url = "{{ request.urlgen('mediagoblin.notifications.mark_all_comment_notifications_seen') }}"
42     </script>
43
44     {# For clarification, the difference between the extra_head.html template
45      # and the head template hook is that the former should be used by
46      # themes and the latter should be used by plugins.
47      # The reason is that only one thing can override extra_head.html...
48      # but multiple plugins can hook into the template hook.
49      #}
50     {% include "mediagoblin/extra_head.html" %}
51     {% template_hook("head") %}
52
53     {% block mediagoblin_head %}
54     {% endblock mediagoblin_head %}
55   </head>
56   <body>
57     {% include 'mediagoblin/bits/body_start.html' %}
58     {% block mediagoblin_body %}
59       {% block mediagoblin_header %}
60         <header>
61           {%- include "mediagoblin/bits/logo.html" -%}
62           {% block mediagoblin_header_title %}{% endblock %}
63           <div class="header_right">
64             {%- if request.user %}
65               {% if request.user and request.user.has_privilege('active') and not request.user.is_banned() %}
66
67                 {% set notification_count = get_notification_count(request.user.id) %}
68                 {% if notification_count %}
69                   <a href="javascript:;" class="notification-gem button_action" title="Notifications">
70                   {{ notification_count }}</a>
71                 {% endif %}
72                 <a href="javascript:;" class="button_action header_dropdown_down">&#9660;</a>
73                 <a href="javascript:;" class="button_action header_dropdown_up">&#9650;</a>
74               {% elif request.user and not request.user.has_privilege('active') %}
75               {# the following link should only appear when verification is needed #}
76                 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
77                                  user=request.user.username) }}"
78                    class="button_action_highlight">
79                {% trans %}Verify your email!{% endtrans %}</a>
80                or <a id="logout" href=
81                {% if persona is not defined %}
82                  "{{ request.urlgen('mediagoblin.auth.logout') }}"
83                {% else %}
84                  "javascript:;"
85                {% endif %}
86                >{% trans %}log out{% endtrans %}</a>
87               {% elif request.user and request.user.is_banned() %}
88                 <a id="logout" href=
89                {% if persona is not defined %}
90                  "{{ request.urlgen('mediagoblin.auth.logout') }}"
91                {% else %}
92                  "javascript:;"
93                {% endif %}
94                >{% trans %}log out{% endtrans %}</a>
95                 <p class="fine_print">
96                   <a href="{{ request.urlgen('terms_of_service') }}">
97                     {%- trans %}Terms of Service{%- endtrans %}
98                   </a>
99                 </p>
100               {% endif %}
101             {%- elif auth %}
102             <a href=
103               {% if persona_auth is defined %}
104                 "javascript:;" id="persona_login"
105               {% else %}
106                 "{{ request.urlgen('mediagoblin.auth.login') }}"
107               {% endif %}
108               >
109                 {%- trans %}Log in{% endtrans -%}
110               </a>
111             {%- endif %}
112           </div>
113           <div class="clear"></div>
114           {% if request.user and request.user.has_privilege('active') %}
115             <div class="header_dropdown">
116               <p>
117                 <span class="dropdown_title">
118                   {% trans user_url=request.urlgen('mediagoblin.user_pages.user_home',
119                                                     user=request.user.username),
120                            user_name=request.user.username -%}
121                     <a href="{{ user_url }}">{{ user_name }}</a>'s account
122                   {%- endtrans %}
123                 </span>
124                 &middot;
125                 <a href="{{ request.urlgen('mediagoblin.edit.account') }}">{%- trans %}Change account settings{% endtrans -%}</a>
126                 &middot;
127                 <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
128                                              user=request.user.username) }}">
129                   {%- trans %}Media processing panel{% endtrans -%}
130                 </a>
131                 &middot;
132                 <a id="logout" href=
133                   {% if persona is not defined %}
134                     "{{ request.urlgen('mediagoblin.auth.logout') }}"
135                   {% else %}
136                     "javascript:;"
137                   {% endif %}
138                   >{% trans %}Log out{% endtrans %}</a>
139               </p>
140               <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}">
141                 {%- trans %}Add media{% endtrans -%}
142               </a>
143               <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}">
144                 {%- trans %}Create new collection{% endtrans -%}
145               </a>
146               {% if request.user.has_privilege('admin','moderator') %}
147                 <p>
148                   <span class="dropdown_title">Moderation powers:</span>
149                   <a href="{{ request.urlgen('mediagoblin.moderation.media_panel') }}">
150                     {%- trans %}Media processing panel{% endtrans -%}
151                   </a>
152                   &middot;
153                   <a href="{{ request.urlgen('mediagoblin.moderation.users') }}">
154                     {%- trans %}User management panel{% endtrans -%}
155                   </a>
156                   &middot;
157                   <a href="{{ request.urlgen('mediagoblin.moderation.reports') }}">
158                     {%- trans %}Report management panel{% endtrans -%}
159                   </a>
160                 </p>
161               {% endif %}
162                 <p class="fine_print">
163                   <a href="{{ request.urlgen('terms_of_service') }}">Terms of Service</a>
164                 </p>
165               {% include 'mediagoblin/fragments/header_notifications.html' %}
166             </div>
167           {% endif %}
168         </header>
169       {% endblock %}
170       <div class="container">
171         {% include 'mediagoblin/bits/above_content.html' %}
172         <div class="mediagoblin_content">
173           {% include "mediagoblin/utils/messages.html" %}
174           {% block mediagoblin_content %}
175           {% endblock mediagoblin_content %}
176           {% if csrf_token is defined %}
177             {% template_hook("persona_form") %}
178           {% endif %}
179         </div>
180         {%- include "mediagoblin/bits/base_footer.html" %}
181       </div>
182     {%- endblock mediagoblin_body %}
183     {% include 'mediagoblin/bits/body_end.html' %}
184   </body>
185 </html>