508. Updates copyright/license information
[mediagoblin.git] / mediagoblin / templates / mediagoblin / user_pages / user.html
1 {#
2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C) 2011 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 {% extends "mediagoblin/base.html" %}
19
20 {% from "mediagoblin/utils/object_gallery.html" import object_gallery %}
21
22 {% block mediagoblin_head %}
23 <link rel="alternate" type="application/atom+xml"
24 href="{{ request.urlgen(
25 'mediagoblin.user_pages.atom_feed',
26 user=user.username) }}">
27 {% endblock mediagoblin_head %}
28
29 {% block mediagoblin_content -%}
30 {# If no user... #}
31 {% if not user %}
32 <p>{% trans %}Sorry, no such user found.{% endtrans %}<p/>
33
34 {# User exists, but needs verification #}
35 {% elif user.status == "needs_email_verification" %}
36 {% if user == request.user %}
37 {# this should only be visible when you are this user #}
38 <div class="grid_6 prefix_1 suffix_1 form_box">
39 <h1>{% trans %}Email verification needed{% endtrans %}</h1>
40
41 <p>
42 {% trans -%}
43 Almost done! Your account still needs to be activated.
44 {%- endtrans %}
45 </p>
46 <p>
47 {% trans -%}
48 An email should arrive in a few moments with instructions on how to do so.
49 {%- endtrans %}
50 </p>
51 <p>{% trans %}In case it doesn't:{% endtrans %}</p>
52
53 <a href="{{ request.urlgen('mediagoblin.auth.resend_verification') }}"
54 class="button">{% trans %}Resend verification email{% endtrans %}</a>
55 </div>
56 {% else %}
57 {# if the user is not you, but still needs to verify their email #}
58 <div class="grid_6 prefix_1 suffix_1 form_box">
59 <h1>{% trans %}Email verification needed{% endtrans %}</h1>
60
61 <p>
62 {% trans -%}
63 Someone has registered an account with this username, but it still has to be activated.
64 {%- endtrans %}
65 </p>
66
67 <p>
68 {% trans login_url=request.urlgen('mediagoblin.auth.login') -%}
69 If you are that person but you've lost your verification email, you can <a href="{{ login_url }}">log in</a> and resend it.
70 {%- endtrans %}
71 </p>
72 </div>
73 {% endif %}
74
75 {# Active(?) (or at least verified at some point) user, horray! #}
76 {% else %}
77 <h1>
78 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
79 </h1>
80
81 {% if not user['url'] and not user['profile'] %}
82 {% if request.user['_id'] == user['_id'] %}
83 <div class="grid_6 alpha empty_space">
84 <p>
85 {% trans %}Here's a spot to tell others about yourself.{% endtrans %}
86 </p>
87 <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{
88 user.username }}"
89 class="header_submit">
90 {%- trans %}Edit profile{% endtrans -%}
91 </a>
92 </div>
93 {% else %}
94 <div class="grid_6 alpha empty_space">
95 <p>
96 {% trans -%}
97 This user hasn't filled in their profile (yet).
98 {%- endtrans %}
99 </p>
100 </div>
101 {% endif %}
102 {% else %}
103 <div class="grid_6 alpha">
104 {% include "mediagoblin/utils/profile.html" %}
105 {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %}
106 <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{
107 user.username }}">
108 {%- trans %}Edit profile{% endtrans -%}
109 </a>
110 {% endif %}
111 </div>
112 {% endif %}
113
114 {% if media_entries.count() %}
115 <div class="grid_10 omega">
116 {{ object_gallery(request, media_entries, pagination,
117 pagination_base_url=user_gallery_url, col_number=3) }}
118 {% include "mediagoblin/utils/object_gallery.html" %}
119 <div class="clear"></div>
120 <p>
121 <a href="{{ user_gallery_url }}">
122 {% trans username=user.username -%}
123 View all of {{ username }}'s media{% endtrans -%}
124 </a>
125 </p>
126 {% set feed_url = request.urlgen(
127 'mediagoblin.user_pages.atom_feed',
128 user=user.username) %}
129 {% include "mediagoblin/utils/feed_link.html" %}
130 </div>
131 {% else %}
132 {% if request.user['_id'] == user['_id'] %}
133 <div class="grid_10 omega empty_space">
134 <p>
135 {% trans -%}
136 This is where your media will appear, but you don't seem to have added anything yet.
137 {%- endtrans %}
138 </p>
139 <a class="header_submit"
140 href="{{ request.urlgen('mediagoblin.submit.start') }}">
141 {%- trans %}Add media{% endtrans -%}
142 </a>
143 </div>
144 {% else %}
145 <div class="grid_10 omega empty_space">
146 <p>
147 {% trans -%}
148 There doesn't seem to be any media here yet...
149 {%- endtrans %}
150 </p>
151 </div>
152 {% endif %}
153 {% endif %}
154 <div class="clear"></div>
155 {% endif %}
156 {% endblock %}