X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=mediagoblin%2Ftemplates%2Fmediagoblin%2Fuser_pages%2Fmedia.html;h=08e9d8ea1d1ebed858e97a3a5a3c3ac62090b25b;hb=744f1c83b9c94a82612c981ec56782f3db457357;hp=7e184257faf96e85d704afd19b61aacf5e2dd51e;hpb=c7d135b6eaad379511cde306043eb3058132e7b7;p=mediagoblin.git diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 7e184257..08e9d8ea 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,7 +71,7 @@ {{ media.title }} {% if request.user and - (media.uploader == request.user.id or + (media.uploader == request.user.id or request.user.is_admin) %} {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', user= media.get_uploader.username, @@ -94,15 +86,17 @@

{{ media.description_html }}

{% endautoescape %} {% if comments %} - - {% trans %}Add a comment{% endtrans %} - + {% if app_config['allow_comments'] and auth %} + + {% trans %}Add a comment{% endtrans %} + + {% endif %} {% if request.user %} -
{{ wtforms_util.render_divs(comment_form) }} @@ -125,16 +119,20 @@
+ user=comment_author.username) }}" + class="comment_authorlink"> {{- comment_author.username -}} - {% trans %}at{% endtrans %} - {{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}} - : + comment=comment.id, + user=media.get_uploader.username, + media=media.slug_or_id) }}#comment" + class="comment_whenlink"> + + {%- trans formatted_time=timesince(comment.created) -%} + {{ formatted_time }} ago + {%- endtrans -%} + :
{% autoescape False -%} @@ -149,65 +147,70 @@ {% 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 -%} +

+ + {% if app_config['original_date_visible'] %} + {% set original_date = media.media_manager.get_original_date() %} + + {% if original_date %} +

{% trans %}Created{% endtrans %}

+ +

+ {%- trans formatted_time=timesince(original_date) -%} + {{ formatted_time }} ago + {%- endtrans -%} +

+ {%- endif %} + {% endif %} + {% if media.tags %} {% include "mediagoblin/utils/tags.html" %} {% endif %} - {% if media.collections %} - {% include "mediagoblin/utils/collections.html" %} - {% endif %} + {% include "mediagoblin/utils/collections.html" %} {% include "mediagoblin/utils/license.html" %} - {% include "mediagoblin/utils/geolocation_map.html" %} - {% include "mediagoblin/utils/exif.html" %} - - {% if media.attachment_files|count %} + + {%- if media.attachment_files|count %}

{% trans %}Attachments{% endtrans %}

    - {% for attachment in media.attachment_files %} + {%- for attachment in media.attachment_files %}
  • {{- attachment.name -}}
  • - {% endfor %} + {%- endfor %}
- {% endif %} - {% if app_config['allow_attachments'] + {%- endif %} + {%- if app_config['allow_attachments'] and request.user and (media.uploader == request.user.id or request.user.is_admin) %} - {% if not media.attachment_files|count %} + {%- if not media.attachment_files|count %}

{% trans %}Attachments{% endtrans %}

- {% endif %} + {%- endif %}

{% trans %}Add attachment{% endtrans %} + media_id=media.id) }}"> + {%- trans %}Add attachment{% endtrans -%} +

- {% endif %} + {%- endif %} - {% if request.user %} -

- - - -

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