2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C)
2011 MediaGoblin contributors. See AUTHORS.
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 title %}{{ media.title }}
— {{ super() }}{% endblock %}
25 {% block mediagoblin_head %}
26 <link rel=
"stylesheet"
27 href=
"{{ request.staticdirect('/extlib/leaflet/leaflet.css') }}" />
28 <!--[if lte IE 8]><link rel="stylesheet"
29 href="{{ request.staticdirect('/extlib/leaflet/leaflet.ie.css') }}" /><![endif]-->
30 <script type=
"text/javascript"
31 src=
"{{ request.staticdirect('/js/comment_show.js') }}"></script>
32 <script type=
"text/javascript"
33 src=
"{{ request.staticdirect('/extlib/leaflet/leaflet.js') }}"></script>
34 <script type=
"text/javascript"
35 src=
"{{ request.staticdirect('/js/geolocation-map.js') }}"></script>
36 {% endblock mediagoblin_head %}
38 {% block mediagoblin_content %}
39 <div class=
"media_pane">
40 <div class=
"media_image_container">
41 {% block mediagoblin_media %}
42 {% set display_media = request.app.public_store.file_url(
43 media.get_display_media(media.media_files)) %}
44 {# if there's a medium file size, that means the medium size
45 # isn't the original... so link to the original!
47 {% if media.media_files.has_key('medium') %}
48 <a href=
"{{ request.app.public_store.file_url(
49 media.media_files['original']) }}">
50 <img class=
"media_image"
51 src=
"{{ display_media }}"
52 alt=
"Image for {{ media.title }}" />
55 <img class=
"media_image"
56 src=
"{{ display_media }}"
57 alt=
"Image for {{ media.title }}" />
61 <h2 class=
"media_title">
64 {% autoescape False %}
65 <p>{{ media.description_html }}
</p>
67 <p class=
"media_specs">
68 {% trans date=media.created.strftime(
"%Y-%m-%d") -%}
71 {% if request.user and
72 (media.uploader == request.user._id or
73 request.user.is_admin) %}
74 {% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
75 user= media.get_uploader.username,
77 <a class=
"button_action" href=
"{{ edit_url }}">{% trans %}Edit{% endtrans %}
</a>
78 {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete',
79 user= media.get_uploader.username,
81 <a class=
"button_action" href=
"{{ delete_url }}">{% trans %}Delete{% endtrans %}
</a>
83 {% if media.media_data.exif %}
86 - Render GPS data in a human-readable format
90 {% for tag, value in media.media_data.exif.items() %}
101 {% if comments.count()==
1 %}
102 {% trans comment_count=comments.count() -%}{{ comment_count }} comment{%- endtrans %}
103 {% elif comments.count()
>1 %}
104 {% trans comment_count=comments.count() -%}{{ comment_count }} comments{%- endtrans %}
106 {% trans %}No comments yet.{% endtrans %}
108 <div class=
"right_align">
110 {% if not request.user %}
111 href=
"{{ request.urlgen('mediagoblin.auth.login') }}"
113 class=
"button_action" id=
"button_addcomment" title=
"Add a comment">
114 {% trans %}Add one{% endtrans %}
118 {% if request.user %}
119 <form action=
"{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
120 user= media.get_uploader.username,
121 media=media._id) }}" method=
"POST" id=
"form_comment">
123 {% trans %}You can use
<a href=
"http://daringfireball.net/projects/markdown/basics">Markdown
</a> for formatting.{% endtrans %}
125 {{ wtforms_util.render_divs(comment_form) }}
126 <div class=
"form_submit_buttons">
127 <input type=
"submit" value=
"{% trans %}Add this comment{% endtrans %}" class=
"button_action" />
132 {% for comment in comments %}
133 {% set comment_author = comment.get_author %}
134 {% if pagination.active_id == comment._id %}
135 <div class=
"comment_wrapper comment_active" id=
"comment-{{ comment._id }}">
136 <a name=
"comment" id=
"comment"></a>
138 <div class=
"comment_wrapper" id=
"comment-{{ comment._id }}">
140 <div class=
"comment_content">
141 {% autoescape False %}
142 {{ comment.content_html }}
144 <img src=
"{{ request.staticdirect('/images/icon_comment.png') }}" />
145 <a href=
"{{ request.urlgen('mediagoblin.user_pages.user_home',
146 user = comment_author.username) }}">
147 {{ comment_author.username }}
149 {% trans %}at{% endtrans %}
150 <a href=
"{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
151 comment = comment._id,
152 user = media.get_uploader.username,
153 media = media.slug) }}#comment">
154 {{ comment.created.strftime(
"%I:%M%p %Y-%m-%d") }}
159 {{ render_pagination(request, pagination,
160 media.url_for_self(request.urlgen)) }}
163 <div class=
"media_sidebar">
164 {% trans user_url=request.urlgen(
165 'mediagoblin.user_pages.user_home',
166 user=media.get_uploader.username),
167 username=media.get_uploader.username -%}
168 <p>❖ Browsing media by
<a href=
"{{ user_url }}">{{ username }}
</a></p>
170 {% include
"mediagoblin/utils/prev_next.html" %}
171 {% if media.attachment_files|count %}
174 {% for attachment in media.attachment_files %}
176 <a href=
"{{ request.app.public_store.file_url(attachment.filepath) }}">
177 {{ attachment.name }}
183 {% if app_config['allow_attachments']
185 and (media.uploader == request.user._id
186 or request.user.is_admin) %}
188 <a href=
"{{ request.urlgen('mediagoblin.edit.attachments',
189 user=media.get_uploader.username,
190 media=media._id) }}">Add attachment
</a>
194 {% include
"mediagoblin/utils/tags.html" %}
197 {% if media.media_data.gps %}
200 {% set gps = media.media_data.gps %}
201 <div id=
"tile-map" style=
"width: 100%; height: 196px;">
202 <input type=
"hidden" id=
"gps-longitude"
203 value=
"{{ gps.longitude }}" />
204 <input type=
"hidden" id=
"gps-latitude"
205 value=
"{{ gps.latitude }}" />
210 <a href=
"http://openstreetmap.org/?mlat={{ gps.latitude }}&mlon={{ gps.longitude }}">
217 {% include
"mediagoblin/utils/license.html" %}