diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-02-24 11:30:17 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-02-24 12:36:07 +0100 |
commit | 954b407cf8386f3c40ce1f51c2c7f321075b0fe6 (patch) | |
tree | 5f0d378d930d7b2cd57d03eb1d7c621a8a096152 /mediagoblin/templates | |
parent | ac7c91809607a6dfa3b3109a12f45295235e8d20 (diff) | |
download | mediagoblin-954b407cf8386f3c40ce1f51c2c7f321075b0fe6.tar.lz mediagoblin-954b407cf8386f3c40ce1f51c2c7f321075b0fe6.tar.xz mediagoblin-954b407cf8386f3c40ce1f51c2c7f321075b0fe6.zip |
Use the media id for attachmemt editing.
And remove some stray white space from the output.
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r-- | mediagoblin/templates/mediagoblin/edit/attachments.html | 15 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/user_pages/media.html | 22 |
2 files changed, 20 insertions, 17 deletions
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 <http://www.gnu.org/licenses/>. #} -{% extends "mediagoblin/base.html" %} +{%- extends "mediagoblin/base.html" %} {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} @@ -28,13 +28,14 @@ {% block mediagoblin_content %} <form action="{{ request.urlgen('mediagoblin.edit.attachments', user= media.get_uploader.username, - media= media.id) }}" + media_id=media.id) }}" method="POST" enctype="multipart/form-data"> <div class="form_box"> <h1> - {% trans media_title=media.title -%} + {%- trans media_title=media.title -%} Editing attachments for {{ media_title }} - {%- endtrans %}</h1> + {%- endtrans -%} + </h1> <div style="text-align: center;" > <img src="{{ media.thumb_url }}" /> </div> @@ -42,19 +43,19 @@ {% if media.attachment_files|count %} <h2>{% trans %}Attachments{% endtrans %}</h2> <ul> - {% for attachment in media.attachment_files %} + {%- for attachment in media.attachment_files %} <li> <a target="_blank" href="{{ request.app.public_store.file_url( attachment['filepath']) }}"> {{- attachment.name -}} </a> </li> - {% endfor %} + {%- endfor %} </ul> {% endif %} <h2>{% trans %}Add attachment{% endtrans %}</h2> - {{ wtforms_util.render_divs(form) }} + {{- wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> <a href="{{ media.url_for_self(request.urlgen) }}"> {%- 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 <http://www.gnu.org/licenses/>. #} -{% 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 %} <h3>{% trans %}Attachments{% endtrans %}</h3> <ul> - {% for attachment in media.attachment_files %} + {%- for attachment in media.attachment_files %} <li> <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> {{- attachment.name -}} </a> </li> - {% endfor %} + {%- endfor %} </ul> - {% 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 %} <h3>{% trans %}Attachments{% endtrans %}</h3> - {% endif %} + {%- endif %} <p> <a href="{{ request.urlgen('mediagoblin.edit.attachments', user=media.get_uploader.username, - media=media.id) }}">{% trans %}Add attachment{% endtrans %}</a> + media_id=media.id) }}"> + {%- trans %}Add attachment{% endtrans -%} + </a> </p> - {% endif %} + {%- endif %} {% template_hook("media_sideinfo") %} |