9ac96f808403767306f7c0b5fdb334801c79ef1c
[mediagoblin.git] / mediagoblin / templates / mediagoblin / user_pages / user.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
19 # This is the main user homepage for active users
20 #}
21 {% extends "mediagoblin/base.html" %}
22
23 {% from "mediagoblin/utils/object_gallery.html" import object_gallery %}
24
25 {% block mediagoblin_head %}
26 <link rel="alternate" type="application/atom+xml"
27 href="{{ request.urlgen(
28 'mediagoblin.user_pages.atom_feed',
29 user=user.username) }}">
30 {% endblock mediagoblin_head %}
31
32 {% block title %}
33 {%- if user -%}
34 {%- trans username=user.username -%}
35 {{ username }}'s profile
36 {%- endtrans %} &mdash; {{ super() }}
37 {%- else -%}
38 {{ super() }}
39 {%- endif -%}
40 {% endblock %}
41
42
43 {% block mediagoblin_content -%}
44 <div class="six columns">
45 <h1>
46 {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%}
47 </h1>
48
49 {% if not user.url and not user.bio and not user.location %}
50 {% if request.user and (request.user.id == user.id) %}
51 <div class="profile_sidebar empty_space">
52 <p>
53 {% trans %}Here's a spot to tell others about yourself.{% endtrans %}
54 </p>
55 <a href="{{ request.urlgen('mediagoblin.edit.profile',
56 user=user.username) }}" class="button_action">
57 {%- trans %}Edit profile{% endtrans -%}
58 </a>
59 {% else %}
60 <div class="profile_sidebar empty_space">
61 <p>
62 {% trans -%}
63 This user hasn't filled in their profile (yet).
64 {%- endtrans %}
65 </p>
66 {% endif %}
67 {% else %}
68 <div class="profile_sidebar">
69 {% include "mediagoblin/utils/profile.html" %}
70 {% if request.user and
71 (request.user.id == user.id or request.user.has_privilege('admin')) %}
72 <a href="{{ request.urlgen('mediagoblin.edit.profile',
73 user=user.username) }}">
74 {%- trans %}Edit profile{% endtrans -%}
75 </a>
76 {% endif %}
77 {% endif %}
78 <p>
79 <a href="{{ request.urlgen('mediagoblin.user_pages.collection_list',
80 user=user.username) }}">
81 {%- trans %}Browse collections{% endtrans -%}
82 </a>
83 </p>
84 </div>
85 </div><!--end six columns-->
86 {% if media_entries.count() %}
87 <div class="ten columns profile_showcase">
88 {{ object_gallery(request, media_entries, pagination,
89 pagination_base_url=user_gallery_url, col_number=3) }}
90 {% include "mediagoblin/utils/object_gallery.html" %}
91 <div class="clear"></div>
92 <p>
93 <a href="{{ user_gallery_url }}">
94 {% trans username=user.username -%}
95 View all of {{ username }}'s media{% endtrans -%}
96 </a>
97 </p>
98 {% set feed_url = request.urlgen(
99 'mediagoblin.user_pages.atom_feed',
100 user=user.username) %}
101 {% include "mediagoblin/utils/feed_link.html" %}
102 </div>
103 {% else %}
104 {% if request.user and (request.user.id == user.id) %}
105 <div class="ten columns profile_showcase empty_space">
106 <p>
107 {% trans -%}
108 This is where your media will appear, but you don't seem to have added anything yet.
109 {%- endtrans %}
110 </p>
111 <a class="button_action"
112 href="{{ request.urlgen('mediagoblin.submit.start') }}">
113 {%- trans %}Add media{% endtrans -%}
114 </a>
115 </div>
116 {% else %}
117 <div class="ten columns profile_showcase empty_space">
118 <p>
119 {% trans -%}
120 There doesn't seem to be any media here yet...
121 {%- endtrans %}
122 </p>
123 </div>
124 {% endif %}
125 {% endif %}
126 {% template_hook("user_profile") %}
127 <div class="clear"></div>
128 {% endblock %}