X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=mediagoblin%2Ftemplates%2Fmediagoblin%2Fuser_pages%2Fmedia.html;h=81e5013e88e812ab04caa2d696e168e4a7f1a4d6;hb=56c4ad89ebef32bd5a40c00d987811ce4501ce22;hp=21990442a6cfadfe8b95584ee0d6eaadccf1fa15;hpb=879ff4bde6afaee8bf5bdc2a0e659d66e767d424;p=mediagoblin.git diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 21990442..81e5013e 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -15,7 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . #} -{% extends "mediagoblin/base.html" %} +{%- extends "mediagoblin/base.html" %} {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% from "mediagoblin/utils/pagination.html" import render_pagination %} @@ -30,15 +30,7 @@ - {% if app_config['geolocation_map_visible'] %} - - - - - {% endif %} + {% template_hook("media_head") %} {% endblock mediagoblin_head %} {% block mediagoblin_content %} @@ -51,11 +43,11 @@ {%- endtrans -%}

{% include "mediagoblin/utils/prev_next.html" %} -
+
{% block mediagoblin_media %} {% set display_media = request.app.public_store.file_url( - media.get_display_media(media.media_files)) %} + media.get_display_media()[1]) %} {# if there's a medium file size, that means the medium size # isn't the original... so link to the original! #} @@ -79,114 +71,155 @@ {{ media.title }} {% if request.user and - (media.uploader == request.user._id or - request.user.is_admin) %} + (media.uploader == request.user.id or + request.user.has_privilege('admin')) %} {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', user= media.get_uploader.username, - media= media._id) %} + media_id=media.id) %} {% trans %}Edit{% endtrans %} {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete', user= media.get_uploader.username, - media= media._id) %} + media_id=media.id) %} {% trans %}Delete{% endtrans %} + {% endif %} {% autoescape False %}

{{ media.description_html }}

{% endautoescape %} - {% if media.attachment_files|count %} -

Attachments

- - {% endif %} - {% if app_config['allow_attachments'] - and request.user - and (media.uploader == request.user._id - or request.user.is_admin) %} -

- Add attachment -

- {% endif %} - {% if comments %} - - {% trans %}Add a comment{% endtrans %} - + {% if comments and request.user and request.user.has_privilege('commenter') %} + {% if app_config['allow_comments'] %} + + {% trans %}Add a comment{% endtrans %} + + {% include "mediagoblin/utils/comment-subscription.html" %} + + {% endif %} {% if request.user %} -
-

- {% trans %}You can use Markdown for formatting.{% endtrans %} -

+ media_id=media.id) }}" method="POST" id="form_comment"> {{ wtforms_util.render_divs(comment_form) }}
{{ csrf_token }}
+ +
+
{% endif %} + {{ render_pagination(request, pagination, media.url_for_self(request.urlgen)) }} {% endif %}
- {% trans date=media.created.strftime("%Y-%m-%d") -%} -

Added on

-

{{ date }}

- {%- endtrans %} +

{% trans %}Added{% endtrans %}

+

+ {%- trans formatted_time=timesince(media.created) -%} + {{ formatted_time }} ago + {%- endtrans -%} +

+ + {% block mediagoblin_after_added_sidebar %} + {% endblock %} + {% if media.tags %} {% include "mediagoblin/utils/tags.html" %} {% endif %} - {% include "mediagoblin/utils/license.html" %} + {% include "mediagoblin/utils/collections.html" %} - {% include "mediagoblin/utils/geolocation_map.html" %} + {% if app_config.allow_reporting %} + {% include "mediagoblin/utils/report.html" %} + {% endif %} + + {% include "mediagoblin/utils/license.html" %} {% include "mediagoblin/utils/exif.html" %} - + + {%- if media.attachment_files|count %} +

{% trans %}Attachments{% endtrans %}

+ + {%- endif %} + {%- if app_config['allow_attachments'] + and request.user + and (media.uploader == request.user.id + or request.user.has_privilege('admin')) %} + {%- if not media.attachment_files|count %} +

{% trans %}Attachments{% endtrans %}

+ {%- endif %} +

+ + {%- trans %}Add attachment{% endtrans -%} + +

+ {%- endif %} + + {% template_hook("media_sideinfo") %} + {% block mediagoblin_sidebar %} {% endblock %} +
{% endblock %}