Resolve merge conflict and merge.
[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
41 {# For clarification, the difference between the extra_head.html template
42 # and the head template hook is that the former should be used by
43 # themes and the latter should be used by plugins.
44 # The reason is that only one thing can override extra_head.html...
45 # but multiple plugins can hook into the template hook.
46 #}
47 {% include "mediagoblin/extra_head.html" %}
48 {% template_hook("head") %}
49
50 {% block mediagoblin_head %}
51 {% endblock mediagoblin_head %}
52 </head>
53 <body>
54 {% include 'mediagoblin/bits/body_start.html' %}
55 {% block mediagoblin_body %}
56 {% block mediagoblin_header %}
57 <header>
58 {%- include "mediagoblin/bits/logo.html" -%}
59 {% block mediagoblin_header_title %}{% endblock %}
60 <div class="header_right">
61 {%- if request.user %}
62 {% if request.user and request.user.status == 'active' %}
63
64 {% set notification_count = get_notification_count(request.user.id) %}
65 {% if notification_count %}
66 <a href="#notifications" class="notification-gem button_action" title="Notifications">
67 {{ notification_count }}</a>
68 {% endif %}
69 <a href="#header" class="button_action header_dropdown_down">&#9660;</a>
70 <a href="#no_header" class="button_action header_dropdown_up">&#9650;</a>
71 {% elif request.user and request.user.status == "needs_email_verification" %}
72 {# the following link should only appear when verification is needed #}
73 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
74 user=request.user.username) }}"
75 class="button_action_highlight">
76 {% trans %}Verify your email!{% endtrans %}</a>
77 or <a id="logout" href=
78 {% if persona is not defined %}
79 "{{ request.urlgen('mediagoblin.auth.logout') }}"
80 {% else %}
81 "javascript:;"
82 {% endif %}
83 >{% trans %}log out{% endtrans %}</a>
84 {% endif %}
85 {%- elif auth %}
86 <a href=
87 {% if persona_auth is defined %}
88 "javascript:;" id="persona_login"
89 {% else %}
90 "{{ request.urlgen('mediagoblin.auth.login') }}"
91 {% endif %}
92 >
93 {%- trans %}Log in{% endtrans -%}
94 </a>
95 {%- endif %}
96 </div>
97 <div class="clear"></div>
98 {% if request.user and request.user.status == 'active' %}
99 <div class="header_dropdown">
100 <p>
101 <span class="dropdown_title">
102 {% trans user_url=request.urlgen('mediagoblin.user_pages.user_home',
103 user=request.user.username),
104 user_name=request.user.username -%}
105 <a href="{{ user_url }}">{{ user_name }}</a>'s account
106 {%- endtrans %}
107 </span>
108 &middot;
109 <a href="{{ request.urlgen('mediagoblin.edit.account') }}">{%- trans %}Change account settings{% endtrans -%}</a>
110 &middot;
111 <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel',
112 user=request.user.username) }}">
113 {%- trans %}Media processing panel{% endtrans -%}
114 </a>
115 &middot;
116 <a id="logout" href=
117 {% if persona is not defined %}
118 "{{ request.urlgen('mediagoblin.auth.logout') }}"
119 {% else %}
120 "javascript:;"
121 {% endif %}
122 >{% trans %}Log out{% endtrans %}</a>
123 </p>
124 <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}">
125 {%- trans %}Add media{% endtrans -%}
126 </a>
127 <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}">
128 {%- trans %}Create new collection{% endtrans -%}
129 </a>
130 <a class="button_action" href="{{ request.urlgen('mediagoblin.media_types.blog.create',
131 user=request.user.username) }}">
132 {%- trans %} Blog {% endtrans -%}
133 </a>
134 {% if request.user.is_admin %}
135 <p>
136 <span class="dropdown_title">Admin powers:</span>
137 <a href="{{ request.urlgen('mediagoblin.admin.panel') }}">
138 {%- trans %}Media processing panel{% endtrans -%}
139 </a>
140 </p>
141 {% endif %}
142 {% include 'mediagoblin/fragments/header_notifications.html' %}
143 </div>
144 {% endif %}
145 </header>
146 {% endblock %}
147 <div class="container">
148 {% include 'mediagoblin/bits/above_content.html' %}
149 <div class="mediagoblin_content">
150 {% include "mediagoblin/utils/messages.html" %}
151 {% block mediagoblin_content %}
152 {% endblock mediagoblin_content %}
153 {% if csrf_token is defined %}
154 {% template_hook("persona_form") %}
155 {% endif %}
156 </div>
157 {%- include "mediagoblin/bits/base_footer.html" %}
158 </div>
159 {%- endblock mediagoblin_body %}
160 {% include 'mediagoblin/bits/body_end.html' %}
161 </body>
162 </html>