Commit | Line | Data |
---|---|---|
9a16e16f SS |
1 | {# |
2 | # GNU MediaGoblin -- federated, autonomous media hosting | |
cf29e8a8 | 3 | # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. |
9a16e16f SS |
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 | #} | |
954b407c | 18 | {%- extends "mediagoblin/base.html" %} |
aa7d1a2f JW |
19 | |
20 | {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} | |
5949be9a | 21 | {% from "mediagoblin/utils/pagination.html" import render_pagination %} |
aa7d1a2f | 22 | |
688f56c2 CAW |
23 | {% block title %}{{ media.title }} — {{ super() }}{% endblock %} |
24 | ||
75a12d63 | 25 | {% block mediagoblin_head %} |
e8e444a8 JW |
26 | <!--[if lte IE 8]><link rel="stylesheet" |
27 | href="{{ request.staticdirect('/extlib/leaflet/leaflet.ie.css') }}" /><![endif]--> | |
ada0642e JS |
28 | <script type="text/javascript" |
29 | src="{{ request.staticdirect('/js/comment_show.js') }}"></script> | |
64327824 JS |
30 | <script type="text/javascript" |
31 | src="{{ request.staticdirect('/js/keyboard_navigation.js') }}"></script> | |
c427278e | 32 | <script type="text/javascript" |
33 | src="{{ request.staticdirect('/js/post_comment.js') }}"></script> | |
cd1b836e | 34 | |
c0434db4 | 35 | {% template_hook("location_head") %} |
cac17c15 | 36 | {% template_hook("media_head") %} |
75a12d63 | 37 | {% endblock mediagoblin_head %} |
9a16e16f | 38 | {% block mediagoblin_content %} |
4a9a796a | 39 | <div class="row foot"> |
45842f84 | 40 | <p class="eleven columns context"> |
0dedf3f2 | 41 | {%- trans user_url=request.urlgen( |
ee9a0e3c | 42 | 'mediagoblin.user_pages.user_home', |
0f3bf8d4 JT |
43 | user=media.get_actor.username), |
44 | username=media.get_actor.username -%} | |
0dedf3f2 E |
45 | ❖ Browsing media by <a href="{{user_url}}">{{username}}</a> |
46 | {%- endtrans -%} | |
47 | </p> | |
45842f84 | 48 | <div class="five columns"> |
49 | {% include "mediagoblin/utils/prev_next.html" %} | |
50 | </div> | |
51 | </div> | |
5cdf3a0a | 52 | <div class="media_pane eleven columns"> |
03ff0b36 | 53 | {% block mediagoblin_media %} |
54 | <div class="media_image_container"> | |
38816c66 | 55 | {% set display_media = request.app.public_store.file_url( |
ddbf6af1 | 56 | media.get_display_media()[1]) %} |
38816c66 CAW |
57 | {# if there's a medium file size, that means the medium size |
58 | # isn't the original... so link to the original! | |
59 | #} | |
60 | {% if media.media_files.has_key('medium') %} | |
61 | <a href="{{ request.app.public_store.file_url( | |
62 | media.media_files['original']) }}"> | |
63 | <img class="media_image" | |
64 | src="{{ display_media }}" | |
4a5b97ba CAW |
65 | alt="{% trans media_title=media.title -%} |
66 | Image for {{ media_title }}{% endtrans %}" /> | |
38816c66 CAW |
67 | </a> |
68 | {% else %} | |
9b424b17 CAW |
69 | <img class="media_image" |
70 | src="{{ display_media }}" | |
4a5b97ba CAW |
71 | alt="{% trans media_title=media.title -%} |
72 | Image for {{ media_title }}{% endtrans %}" /> | |
38816c66 | 73 | {% endif %} |
03ff0b36 | 74 | </div> |
75 | {% endblock %} | |
4a9a796a | 76 | <div class="row head foot"> |
f80f5b58 CAW |
77 | <h2 class="media_title"> |
78 | {{ media.title }} | |
79 | </h2> | |
2baad043 | 80 | {% template_hook("media_titleinfo") %} |
ee9a0e3c | 81 | {% if request.user and |
0f3bf8d4 | 82 | (media.actor == request.user.id or |
8394febb | 83 | request.user.has_privilege('admin')) %} |
da4d97e0 | 84 | <div class="pull-right" style="padding-top:20px;"> |
ee9a0e3c | 85 | {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', |
0f3bf8d4 | 86 | user= media.get_actor.username, |
461dd971 | 87 | media_id=media.id) %} |
ee9a0e3c JS |
88 | <a class="button_action" href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a> |
89 | {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete', | |
0f3bf8d4 | 90 | user= media.get_actor.username, |
461dd971 | 91 | media_id=media.id) %} |
da4d97e0 | 92 | <a class="button_action button_warning" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> |
93 | </div> | |
ee9a0e3c | 94 | {% endif %} |
f80f5b58 CAW |
95 | {% autoescape False %} |
96 | <p>{{ media.description_html }}</p> | |
ee9a0e3c | 97 | {% endautoescape %} |
da4d97e0 | 98 | </div> |
64a456a4 | 99 | {% if request.user and request.user.has_privilege('commenter') %} |
da4d97e0 | 100 | <div class="media_comments"> |
8154ecaf CAW |
101 | {% if app_config['allow_comments'] %} |
102 | <a | |
103 | {% if not request.user %} | |
8fc57eaa RE |
104 | href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{ |
105 | request.base_url|urlencode }}" | |
8154ecaf CAW |
106 | {% endif %} |
107 | class="button_action" id="button_addcomment" title="Add a comment"> | |
108 | {% trans %}Add a comment{% endtrans %} | |
109 | </a> | |
0c7fa755 JW |
110 | {% include "mediagoblin/utils/comment-subscription.html" %} |
111 | ||
8154ecaf | 112 | {% endif %} |
e360a992 | 113 | {% if request.user %} |
aa4f958a | 114 | <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', |
0f3bf8d4 | 115 | user= media.get_actor.username, |
461dd971 | 116 | media_id=media.id) }}" method="POST" id="form_comment"> |
f80f5b58 CAW |
117 | {{ wtforms_util.render_divs(comment_form) }} |
118 | <div class="form_submit_buttons"> | |
75a12d63 | 119 | <input type="submit" value="{% trans %}Add this comment{% endtrans %}" class="button_action" /> |
f80f5b58 CAW |
120 | {{ csrf_token }} |
121 | </div> | |
c427278e | 122 | <input type="hidden" value="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', user= media.get_actor.username, media_id=media.id) }}" id="postCommentURL" /> |
5ab60299 | 123 | <input type="hidden" value="{{ request.urlgen('mediagoblin.user_pages.media_preview_comment') }}" id="previewURL" /> |
3bd62dc4 | 124 | <input type="hidden" value="{% trans %}Comment Preview{% endtrans %}" id="previewText"/> |
f80f5b58 | 125 | </form> |
5ab60299 | 126 | <div id="comment_preview"></div> |
e360a992 | 127 | {% endif %} |
5bae4af1 | 128 | <ul style="list-style:none"> |
694e965f | 129 | {% for comment in comments %} |
161bc6b2 JT |
130 | {% set comment_object = comment.comment() %} |
131 | {% set comment_author = comment_object.get_actor %} | |
5bae4af1 E |
132 | <li id="comment-{{ comment.id }}" |
133 | {%- if pagination.active_id == comment.id %} | |
134 | class="comment_wrapper comment_active"> | |
135 | <a name="comment" id="comment"></a> | |
136 | {%- else %} | |
137 | class="comment_wrapper"> | |
138 | {%- endif %} | |
139 | <div class="comment_author"> | |
694e965f JS |
140 | <img src="{{ request.staticdirect('/images/icon_comment.png') }}" /> |
141 | <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', | |
64308aca CAW |
142 | user=comment_author.username) }}" |
143 | class="comment_authorlink"> | |
4637d50c | 144 | {{- comment_author.username -}} |
694e965f | 145 | </a> |
694e965f | 146 | <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment', |
397c22d1 | 147 | comment=comment.id, |
0f3bf8d4 | 148 | user=media.get_actor.username, |
64308aca CAW |
149 | media=media.slug_or_id) }}#comment" |
150 | class="comment_whenlink"> | |
d269b1a8 | 151 | <span title='{{- comment_object.created.strftime(app_config['datetime_format']) -}}'> |
161bc6b2 | 152 | {%- trans formatted_time=timesince(comment_object.created) -%} |
eac52ac1 CAW |
153 | {{ formatted_time }} ago |
154 | {%- endtrans -%} | |
155 | </span></a>: | |
55dbaa9b JS |
156 | </div> |
157 | <div class="comment_content"> | |
4637d50c | 158 | {% autoescape False -%} |
161bc6b2 | 159 | {{ comment_object.content_html }} |
4637d50c | 160 | {%- endautoescape %} |
6f65e9eb | 161 | </div> |
30a9fe7c | 162 | <div> |
6483b370 | 163 | {% if app_config.allow_reporting %} |
164 | <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.report_comment', | |
0f3bf8d4 | 165 | user=media.get_actor.username, |
30a9fe7c | 166 | media=media.slug_or_id, |
690597ef | 167 | comment=comment.id) }}"> |
6483b370 | 168 | {% trans %}Report{% endtrans %}</a> |
169 | {% endif %} | |
30a9fe7c | 170 | </div> |
5bae4af1 | 171 | </li> |
694e965f | 172 | {% endfor %} |
5bae4af1 | 173 | </ul> |
0eb649ff E |
174 | {{ render_pagination(request, pagination, |
175 | media.url_for_self(request.urlgen)) }} | |
da4d97e0 | 176 | {% else %} |
177 | <div class="empty_space no_background"> | |
aa7d1a2f | 178 | {% endif %} |
da4d97e0 | 179 | </div> |
da4d97e0 | 180 | |
5cdf3a0a | 181 | </div> |
182 | ||
183 | ||
184 | <div class="five columns media_sidebar"> | |
34d30444 | 185 | <h3>{% trans %}Added{% endtrans %}</h3> |
d269b1a8 | 186 | <p><span title="{{ media.created.strftime(app_config['datetime_format']) }}"> |
dc31cd1b | 187 | {%- trans formatted_time=timesince(media.created) -%} |
eac52ac1 CAW |
188 | {{ formatted_time }} ago |
189 | {%- endtrans -%} | |
190 | </span></p> | |
058226d0 | 191 | |
ab4cbb10 CAW |
192 | {% block mediagoblin_after_added_sidebar %} |
193 | {% endblock %} | |
058226d0 | 194 | |
f80f5b58 CAW |
195 | {% if media.tags %} |
196 | {% include "mediagoblin/utils/tags.html" %} | |
aa7d1a2f | 197 | {% endif %} |
5d900647 | 198 | |
44004c17 | 199 | {% include "mediagoblin/utils/collections.html" %} |
be5be115 | 200 | |
6483b370 | 201 | {% if app_config.allow_reporting %} |
202 | {% include "mediagoblin/utils/report.html" %} | |
203 | {% endif %} | |
3ce0c611 | 204 | |
99a270e9 | 205 | {% include "mediagoblin/utils/license.html" %} |
6d9ce47f | 206 | |
cc7ca4da | 207 | {% include "mediagoblin/utils/exif.html" %} |
aa4f958a | 208 | |
954b407c | 209 | {%- if media.attachment_files|count %} |
62b7d1b2 JK |
210 | <h3>{% trans %}Attachments{% endtrans %}</h3> |
211 | <ul> | |
954b407c | 212 | {%- for attachment in media.attachment_files %} |
62b7d1b2 JK |
213 | <li> |
214 | <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> | |
13ab48a7 | 215 | {{- attachment.name -}} |
62b7d1b2 JK |
216 | </a> |
217 | </li> | |
954b407c | 218 | {%- endfor %} |
62b7d1b2 | 219 | </ul> |
954b407c E |
220 | {%- endif %} |
221 | {%- if app_config['allow_attachments'] | |
62b7d1b2 | 222 | and request.user |
0f3bf8d4 | 223 | and (media.actor == request.user.id |
8394febb | 224 | or request.user.has_privilege('admin')) %} |
954b407c | 225 | {%- if not media.attachment_files|count %} |
62b7d1b2 | 226 | <h3>{% trans %}Attachments{% endtrans %}</h3> |
954b407c | 227 | {%- endif %} |
62b7d1b2 JK |
228 | <p> |
229 | <a href="{{ request.urlgen('mediagoblin.edit.attachments', | |
0f3bf8d4 | 230 | user=media.get_actor.username, |
954b407c E |
231 | media_id=media.id) }}"> |
232 | {%- trans %}Add attachment{% endtrans -%} | |
233 | </a> | |
62b7d1b2 | 234 | </p> |
954b407c | 235 | {%- endif %} |
3af2d38d | 236 | {% template_hook("subtitle_sidebar") %} |
62b7d1b2 | 237 | |
8db3277c RRS |
238 | {% block mediagoblin_sidebar %} |
239 | {% endblock %} | |
240 | ||
c0434db4 JT |
241 | {%- set model = media %} |
242 | {% template_hook("location_info") %} | |
927be5e8 | 243 | {% template_hook("media_sideinfo") %} |
1c2d01ae | 244 | |
da4d97e0 | 245 | </div><!--end media_sidebar--> |
246 | ||
85778e79 | 247 | <div class="clear"></div> |
d3060210 | 248 | {% endblock %} |