Simplify/Robustify the thumbnail URL usage in templates
[mediagoblin.git] / mediagoblin / templates / mediagoblin / user_pages / media_collect.html
1 {#
2 # GNU MediaGoblin -- federated, autonomous media hosting
3 # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
4 #
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.
9 #
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.
14 #
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/>.
17 #}
18 {% extends "mediagoblin/base.html" %}
19
20 {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
21
22 {% block mediagoblin_head %}
23 <script type="text/javascript"
24 src="{{ request.staticdirect('/js/collection_form_show.js') }}"></script>
25 {% endblock %}
26
27 {% block mediagoblin_content %}
28
29 <form action="{{ request.urlgen('mediagoblin.user_pages.media_collect',
30 user=media.get_uploader.username,
31 media=media._id) }}"
32 method="POST" enctype="multipart/form-data">
33 <div class="form_box">
34 <h1>
35 {%- trans title=media.title -%}
36 Add {{ title }} to collection
37 {%- endtrans %}
38 </h1>
39
40 <div style="text-align: center;" >
41 <img src="{{ media.thumb_url }}" />
42 </div>
43
44 <br />
45
46 <p class="form_field_label">
47 <label for="{{ (form.collection.name) }}">{{ _(form.collection.label.text) }}</label>
48 </p>
49 <div class="form_field_input">
50 {{ form.collection }}
51 <a class="button_action" id="button_addcollection">{% trans %}+{% endtrans %}</a>
52 </div>
53
54 <div id="new_collection" class="subform">
55
56 <h3>{% trans %}Add a new collection{% endtrans %}</h3>
57
58 <p class="form_field_label">
59 <label for="{{ (form.collection_title.name) }}">{{ _(form.collection_title.label.text) }}</label>
60 </p>
61 <div class="form_field_input">
62 {{ form.collection_title }}
63 </div>
64 <p class="form_field_label">
65 <label for="{{ (form.collection_description.name) }}">{{ _(form.collection_description.label.text) }}</label>
66 </p>
67 <div class="form_field_input">
68 {{ form.collection_description }}
69 </div>
70
71 </div>
72 <p class="form_field_label">
73 <label for="{{ (form.note.name) }}">{{ _(form.note.label.text) }}</label>
74 </p>
75 <div class="form_field_input">
76 {{ form.note }}
77 </div>
78
79 <div class="form_submit_buttons">
80 {# TODO: This isn't a button really... might do unexpected things :) #}
81 <a class="button_action" href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a>
82 <input type="submit" value="{% trans %}Add{% endtrans %}" class="button_form" />
83 {{ csrf_token }}
84 </div>
85 </div>
86 </form>
87 {% endblock %}