Issue #362 - Simple comments - Changes based on feedback recieved from #mediagoblin
[mediagoblin.git] / mediagoblin / templates / mediagoblin / user_pages / media.html
CommitLineData
9a16e16f
SS
1{#
2# GNU MediaGoblin -- federated, autonomous media hosting
3# Copyright (C) 2011 Free Software Foundation, Inc
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" %}
aa7d1a2f
JW
19
20{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
21
9a16e16f
SS
22{% block mediagoblin_content %}
23
24 {# temporarily, an "image gallery" that isn't one really ;) #}
25 {% if media %}
37a00748 26 <h1>
d3060210 27 {{media.title}}
37a00748 28 </h1>
c042bc6e
CAW
29 <img class="media_image" src="{{ request.app.public_store.file_url(
30 media.media_files.main) }}" />
e1d9e1d1
CAW
31 <p>
32 Uploaded on
33 {{ "%4d-%02d-%02d"|format(media.created.year,
34 media.created.month, media.created.day) }}
35 by
36 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
37 user= media.uploader().username) }}">
38 {{- media.uploader().username }}</a>
39 </p>
44e2da2f 40 {% autoescape False %}
e1d9e1d1 41 <p>{{ media.description_html }}</p>
44e2da2f 42 {% endautoescape %}
54de443a 43 {% if media['uploader'] == request.user['_id'] %}
ca9c7a07
CFD
44 <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
45 user= media.uploader().username,
46 media= media._id) }}">Edit</a></p>
47 {% endif %}
aa7d1a2f
JW
48 {% if request.user %}
49 <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
50 user= media.uploader().username,
51 media=media._id) }}" method="POST">
52 <h3>Post a comment!</h3>
53 {{ wtforms_util.render_field_div(comment_form.comment) }}
54 <div class="form_submit_buttons">
55 <input type="submit" value="Submit" class="button" />
56 </div>
57 </form>
58 {% endif %}
59 {#
60 {{ wtforms_util.render_textarea_div(submit_form.description) }}
61 {{ wtforms_util.render_field_div(submit_form.file) }}
62 #}
63 {% if comments %}
64 <h3>Comments</h3>
65 {% for comment in comments %}
6f59a3a3 66 {% set comment_author = comment.author() %}
aa7d1a2f
JW
67 <div class="comment_wrapper" id="comment-{{ comment['_id'] }}">
68 <div class="comment_author">By:
69 <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
6f59a3a3
JW
70 user = comment_author['username']) }}">
71 {{ comment_author['username'] }}
aa7d1a2f
JW
72 </a>
73 </div>
74 <div class="comment_datetime">
75 <a href="#comment-{{ comment['_id'] }}">
76 {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year,
77 comment.created.month,
78 comment.created.day,
79 comment.created.hour,
80 comment.created.minute) }}
81 </a>
82 </div>
83 <div class="comment_content">
84 {% autoescape False %}
85 {{ comment.content_html }}
86 {% endautoescape %}
87 </div>
88 </div>
89 {% endfor %}
90 {% include "mediagoblin/utils/pagination.html" %}
91 {% endif %}
9a16e16f
SS
92 {% else %}
93 <p>Sorry, no such media found.<p/>
94 {% endif %}
d3060210 95{% endblock %}