2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C)
2011 Free Software Foundation, Inc
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.
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.
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
/>.
18 {% extends
"mediagoblin/base.html" %}
20 {% import
"/mediagoblin/utils/wtforms.html" as wtforms_util %}
21 {% from
"mediagoblin/utils/pagination.html" import render_pagination %}
23 {% block mediagoblin_content %}
25 <div class=
"grid_11 alpha">
26 {% if media.media_files.medium %}
27 <img src=
"{{ request.app.public_store.file_url(
28 media.media_files.medium) }}" />
30 <img src=
"{{ request.app.public_store.file_url(
31 media.media_files.main) }}" />
38 {% autoescape False %}
39 <p>{{ media.description_html }}
</p>
43 — uploaded on
44 {{
"%4d-%02d-%02d"|format(media.created.year,
45 media.created.month, media.created.day) }}
47 <a href=
"{{ request.urlgen('mediagoblin.user_pages.user_home',
48 user= media.uploader().username) }}">
49 {{- media.uploader().username }}
</a>
55 <form action=
"{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
56 user= media.uploader().username,
57 media=media._id) }}" method=
"POST">
58 {{ wtforms_util.render_field_div(comment_form.comment_content) }}
59 <div class=
"form_submit_buttons">
60 <input type=
"submit" value=
"Post comment!" class=
"button" />
66 {% for comment in comments %}
67 {% set comment_author = comment.author() %}
68 {% if pagination.active_id == comment._id %}
69 <div class=
"comment_wrapper comment_active" id=
"comment-{{ comment['_id'] }}">
70 <a name=
"comment" id=
"comment"></a>
72 <div class=
"comment_wrapper" id=
"comment-{{ comment['_id'] }}">
74 <div class=
"comment_content">
75 {% autoescape False %}
76 {{ comment.content_html }}
79 <div class=
"comment_author">—
80 <a href=
"{{ request.urlgen('mediagoblin.user_pages.user_home',
81 user = comment_author['username']) }}">
82 {{ comment_author['username'] }}
</a> at
84 <div class="comment_datetime">-->
85 <a href=
"{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
86 comment = comment['_id'],
87 user = media.uploader().username,
88 media = media._id) }}#comment">
89 {{
"%4d-%02d-%02d %02d:%02d"|format(comment.created.year,
90 comment.created.month,
93 comment.created.minute) }}
99 {{ render_pagination(request, pagination,
100 request.urlgen('mediagoblin.user_pages.media_home',
101 user = media.uploader().username,
102 media = media._id)) }}
105 <div class=
"grid_5 omega">
106 {% include
"mediagoblin/utils/prev_next.html" %}
107 <h3>Sidebar content here!
</h3>
109 {% if media['uploader'] == request.user['_id'] or
110 request.user['is_admin'] %}
112 <a href=
"{{ request.urlgen('mediagoblin.edit.edit_media',
113 user= media.uploader().username,
114 media= media._id) }}"
115 ><img src=
"{{ request.staticdirect('/images/icon_edit.png') }}"
116 class=
"media_icon" />edit
</a>
119 <img src=
"{{ request.staticdirect('/images/icon_delete.png') }}"
120 class=
"media_icon" />delete
126 <p>Sorry, no such media found.
<p/>