From 954b407cf8386f3c40ce1f51c2c7f321075b0fe6 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 24 Feb 2013 11:30:17 +0100 Subject: Use the media id for attachmemt editing. And remove some stray white space from the output. --- .../templates/mediagoblin/edit/attachments.html | 15 ++++++++------- .../templates/mediagoblin/user_pages/media.html | 22 ++++++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html index 55d446de..3fbea3be 100644 --- a/mediagoblin/templates/mediagoblin/edit/attachments.html +++ b/mediagoblin/templates/mediagoblin/edit/attachments.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 %} @@ -28,13 +28,14 @@ {% block mediagoblin_content %}

- {% trans media_title=media.title -%} + {%- trans media_title=media.title -%} Editing attachments for {{ media_title }} - {%- endtrans %}

+ {%- endtrans -%} +
@@ -42,19 +43,19 @@ {% 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 %}

{% trans %}Add attachment{% endtrans %}

- {{ wtforms_util.render_divs(form) }} + {{- wtforms_util.render_divs(form) }}
{%- trans %}Cancel{% endtrans -%} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 7550c6c1..535ee448 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 %} @@ -155,31 +155,33 @@ {% include "mediagoblin/utils/exif.html" %} - {% if media.attachment_files|count %} + {%- if media.attachment_files|count %}

{% trans %}Attachments{% endtrans %}

- {% 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 %} {% template_hook("media_sideinfo") %} -- cgit v1.2.3