diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-01 16:29:22 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-01 16:29:22 -0600 |
commit | ed6344009abb31326acabe95449aaa449f66f4b4 (patch) | |
tree | 03d65052d550b890074dde3c18857371be974f5c /mediagoblin/templates | |
parent | 5c754fdaeeddb1bbeff165bbecb77e33b75b3c7d (diff) | |
parent | b7a3798e1806eb52a244088fb600376ff25e0de9 (diff) | |
download | mediagoblin-ed6344009abb31326acabe95449aaa449f66f4b4.tar.lz mediagoblin-ed6344009abb31326acabe95449aaa449f66f4b4.tar.xz mediagoblin-ed6344009abb31326acabe95449aaa449f66f4b4.zip |
Merge branch 'master' into joar-skip_transcoding
Conflicts:
mediagoblin/config_spec.ini
Diffstat (limited to 'mediagoblin/templates')
19 files changed, 235 insertions, 213 deletions
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 98b32f4a..66b95661 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -27,27 +27,32 @@ href="{{ request.staticdirect('/css/base.css') }}"/> <link rel="shortcut icon" href="{{ request.staticdirect('/images/goblin.ico') }}" /> - <script src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script> + <script type="text/javascript" + src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script> <script type="text/javascript" src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script> - <!--[if lt IE 9]> - <script src="{{ request.staticdirect('/js/extlib/html5shiv.js') }}"></script> - <![endif]--> - + {# For clarification, the difference between the extra_head.html template + # and the head template hook is that the former should be used by + # themes and the latter should be used by plugins. + # The reason is that only one thing can override extra_head.html... + # but multiple plugins can hook into the template hook. + #} {% include "mediagoblin/extra_head.html" %} + {% template_hook("head") %} {% block mediagoblin_head %} {% endblock mediagoblin_head %} </head> <body> + {% include 'mediagoblin/bits/body-start.html' %} {% block mediagoblin_body %} {% block mediagoblin_header %} <header> {%- include "mediagoblin/bits/logo.html" -%} {% block mediagoblin_header_title %}{% endblock %} <div class="header_right"> - {% if request.user %} + {%- if request.user %} {% if request.user and request.user.status == 'active' %} <div class="button_action header_dropdown_down">▼</div> <div class="button_action header_dropdown_up">▲</div> @@ -59,11 +64,12 @@ {% trans %}Verify your email!{% endtrans %}</a> or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a> {% endif %} - {% else %} + {%- else %} <a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{ request.base_url|urlencode }}"> - {% trans %}Log in{% endtrans %}</a> - {% endif %} + {%- trans %}Log in{% endtrans -%} + </a> + {%- endif %} </div> <div class="clear"></div> {% if request.user and request.user.status == 'active' %} @@ -76,53 +82,53 @@ <a href="{{ user_url }}">{{ user_name }}</a>'s account {%- endtrans %} </span> - (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>) + · + <a href="{{ request.urlgen('mediagoblin.edit.account') }}">{%- trans %}Change account settings{% endtrans -%}</a> + · + <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel', + user=request.user.username) }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a> + · + <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}Log out{% endtrans %}</a> </p> - <ul> - <li><a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}"> + <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}"> {%- trans %}Add media{% endtrans -%} - </a></li> - <li><a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> + </a> + <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> {%- trans %}Create new collection{% endtrans -%} - </a></li> - <li><a href="{{ request.urlgen('mediagoblin.edit.account') }}"> - {%- trans %}Change account settings{% endtrans -%} - </a></li> - <li><a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel', - user=request.user.username) }}"> - {%- trans %}Media processing panel{% endtrans -%} - </a></li> + </a> {% if request.user.is_admin %} - <li>Admin: - <ul> - <li><a href="{{ request.urlgen('mediagoblin.admin.panel') }}"> - {%- trans %}Media processing panel{% endtrans -%} - </a></li> - </ul> - </li> + <p> + <span class="dropdown_title">Admin powers:</span> + <a href="{{ request.urlgen('mediagoblin.admin.panel') }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a> + </p> {% endif %} - </ul> </div> {% endif %} </header> {% endblock %} - <div class="container"> - <div class="mediagoblin_content"> + <div class="container"> + {% include 'mediagoblin/bits/above-content.html' %} + <div class="mediagoblin_content"> {% include "mediagoblin/utils/messages.html" %} {% block mediagoblin_content %} {% endblock mediagoblin_content %} - </div> - {% block mediagoblin_footer %} + </div> + {%- block mediagoblin_footer %} <footer> {% trans -%} - Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project. + Powered by <a href="http://mediagoblin.org/" title='Version {{ version }}'>MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project. {%- endtrans %} {% trans source_link=app_config['source_link'] -%} Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available. {%- endtrans %} </footer> - {% endblock mediagoblin_footer %} - {% endblock mediagoblin_body %} - </div> + {%- endblock mediagoblin_footer %} + </div> + {%- endblock mediagoblin_body %} + {% include 'mediagoblin/bits/body-end.html' %} </body> </html> diff --git a/mediagoblin/templates/mediagoblin/bits/above-content.html b/mediagoblin/templates/mediagoblin/bits/above-content.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/above-content.html @@ -0,0 +1,17 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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/>. +-#} diff --git a/mediagoblin/templates/mediagoblin/bits/body-end.html b/mediagoblin/templates/mediagoblin/bits/body-end.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/body-end.html @@ -0,0 +1,17 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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/>. +-#} diff --git a/mediagoblin/templates/mediagoblin/bits/body-start.html b/mediagoblin/templates/mediagoblin/bits/body-start.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/body-start.html @@ -0,0 +1,17 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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/>. +-#} 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/edit/edit_account.html b/mediagoblin/templates/mediagoblin/edit/edit_account.html index 4b980301..3f508af4 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit_account.html +++ b/mediagoblin/templates/mediagoblin/edit/edit_account.html @@ -45,11 +45,11 @@ {{ wtforms_util.render_field_div(form.new_password) }} <div class="form_field_input"> <p>{{ form.wants_comment_notification }} - {{ form.wants_comment_notification.label }}</p> + {{ wtforms_util.render_label(form.wants_comment_notification) }}</p> </div> <div class="form_field_input"> <p>{{ form.license_preference }} - {{ form.license_preference.label }}</p> + {{ wtforms_util.render_label(form.license_preference) }}</p> </div> <div class="form_submit_buttons"> <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" /> diff --git a/mediagoblin/templates/mediagoblin/media_displays/image.html b/mediagoblin/templates/mediagoblin/media_displays/image.html index 30c2a90d..158dd67f 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/image.html +++ b/mediagoblin/templates/mediagoblin/media_displays/image.html @@ -18,5 +18,12 @@ {% extends 'mediagoblin/user_pages/media.html' %} +{% block mediagoblin_head %} + {{ super() }} + {% template_hook("image_head") %} +{% endblock mediagoblin_head %} + {% block mediagoblin_sidebar %} + {{ super() }} + {% template_hook("image_sideinfo") %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index 7d5ede8d..9eeb7c85 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -27,7 +27,9 @@ {%- endblock %} {% block mediagoblin_media %} - <video controls autoplay preload="auto" class="video-js vjs-mg-skin" + <video controls + {% if global_config['media_type:mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %} + preload="auto" class="video-js vjs-mg-skin" data-setup='{"height": {{ media.media_data.height }}, "width": {{ media.media_data.width }} }'> <source src="{{ request.app.public_store.file_url( diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index 5c6eb52f..529d89ef 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -19,6 +19,13 @@ {% from "mediagoblin/utils/object_gallery.html" import object_gallery %} +{% set feed_url = request.urlgen('mediagoblin.listings.atom_feed') %} + +{% block mediagoblin_head -%} + {% set feed_url = request.urlgen('mediagoblin.listings.atom_feed') -%} + <link rel="alternate" type="application/atom+xml" href="{{ feed_url }}"> +{%- endblock mediagoblin_head %} + {% block mediagoblin_content %} {% if request.user %} <h1>{% trans %}Explore{% endtrans %}</h1> @@ -39,4 +46,8 @@ {% endif %} <h2>{% trans %}Most recent media{% endtrans %}</h2> {{ object_gallery(request, media_entries, pagination) }} + + {#- Need to set feed_url within this block so template can use it. -#} + {%- set feed_url = feed_url -%} + {%- include "mediagoblin/utils/feed_link.html" -%} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html index 7499c0cf..2b790584 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html @@ -36,7 +36,7 @@ <p class="delete_checkbox_box"> {{ form.confirm }} - <label for="{{ (form.confirm.name) }}">{{ _(form.confirm.label.text) }}</label> + {{ wtforms_util.render_label(form.confirm) }} </p> <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html index 447201cd..449cc3ce 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html @@ -42,7 +42,7 @@ <p class="delete_checkbox_box"> {{ form.confirm }} - <label for="{{ (form.confirm.name) }}">{{ _(form.confirm.label.text) }}</label> + {{ wtforms_util.render_label(form.confirm) }} </p> <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index e234914f..f23bb156 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -34,16 +34,28 @@ {% block mediagoblin_content -%} <h1> - {%- trans username=user.username, - user_url=request.urlgen( - 'mediagoblin.user_pages.user_home', - user=user.username) -%} - <a href="{{ user_url }}">{{ username }}</a>'s media - {%- endtrans %} + {% if tag %} + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username), + tag_url=request.urlgen( + 'mediagoblin.listings.tags_listing', + tag=tag) -%} + <a href="{{ user_url }}">{{ username }}</a>'s media with tag <a href="{{ tag_url }}">{{ tag }}</a> + {%- endtrans %} + {% else %} + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) -%} + <a href="{{ user_url }}">{{ username }}</a>'s media + {%- endtrans %} + {% endif %} </h1> {{ object_gallery(request, media_entries, pagination) }} - + {% set feed_url = request.urlgen('mediagoblin.user_pages.atom_feed', user=user.username) %} {% include "mediagoblin/utils/feed_link.html" %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 7e184257..f151c577 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 %} @@ -30,15 +30,7 @@ <script type="text/javascript" src="{{ request.staticdirect('/js/keyboard_navigation.js') }}"></script> - {% if app_config['geolocation_map_visible'] %} - <link rel="stylesheet" - href="{{ request.staticdirect('/extlib/leaflet/leaflet.css') }}" /> - - <script type="text/javascript" - src="{{ request.staticdirect('/extlib/leaflet/leaflet.js') }}"></script> - <script type="text/javascript" - src="{{ request.staticdirect('/js/geolocation-map.js') }}"></script> - {% endif %} + {% template_hook("media_head") %} {% endblock mediagoblin_head %} {% block mediagoblin_content %} @@ -125,14 +117,14 @@ <div class="comment_author"> <img src="{{ request.staticdirect('/images/icon_comment.png') }}" /> <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user = comment_author.username) }}"> + user=comment_author.username) }}"> {{- comment_author.username -}} </a> {% trans %}at{% endtrans %} <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment', - comment = comment.id, - user = media.get_uploader.username, - media = media.slug_or_id) }}#comment"> + comment=comment.id, + user=media.get_uploader.username, + media=media.slug_or_id) }}#comment"> {{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}} </a>: </div> @@ -157,57 +149,45 @@ {% 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 %} <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 %} - {% if request.user %} - <p> - <a type="submit" href="{{ request.urlgen('mediagoblin.user_pages.media_collect', - user=media.get_uploader.username, - media=media.id) }}" - class="button_action" - title="{% trans %}Add media to collection{% endtrans %}"> - <img src="{{ request.staticdirect('/images/icon_collect.png') }}" - /> - </a> - </p> - {% endif %} + {% template_hook("media_sideinfo") %} {% block mediagoblin_sidebar %} {% endblock %} + </div> <div class="clear"></div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_collect.html b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html index 4f35dfa3..b4c9671c 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_collect.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html @@ -24,17 +24,22 @@ src="{{ request.staticdirect('/js/collection_form_show.js') }}"></script> {% endblock %} -{% block mediagoblin_content %} +{% block title -%} + {% trans media_title=media.title -%} + Add “{{ media_title }}” to a collection + {%- endtrans %} — {{ super() }} +{%- endblock %} +{% block mediagoblin_content %} <form action="{{ request.urlgen('mediagoblin.user_pages.media_collect', user=media.get_uploader.username, - media=media.id) }}" + media_id=media.id) }}" method="POST" enctype="multipart/form-data"> <div class="form_box"> <h1> - {%- trans title=media.title -%} - Add {{ title }} to collection - {%- endtrans %} + {%- trans media_title=media.title -%} + Add “{{ media_title }}” to a collection + {%- endtrans -%} </h1> <div style="text-align: center;" > @@ -42,39 +47,20 @@ </div> <br /> - - <p class="form_field_label"> - <label for="{{ (form.collection.name) }}">{{ _(form.collection.label.text) }}</label> - </p> + + {{- wtforms_util.render_label_p(form.collection) }} <div class="form_field_input"> {{ form.collection }} <a class="button_action" id="button_addcollection">{% trans %}+{% endtrans %}</a> </div> <div id="new_collection" class="subform"> + <h3>{% trans %}Add a new collection{% endtrans %}</h3> - <h3>{% trans %}Add a new collection{% endtrans %}</h3> - - <p class="form_field_label"> - <label for="{{ (form.collection_title.name) }}">{{ _(form.collection_title.label.text) }}</label> - </p> - <div class="form_field_input"> - {{ form.collection_title }} - </div> - <p class="form_field_label"> - <label for="{{ (form.collection_description.name) }}">{{ _(form.collection_description.label.text) }}</label> - </p> - <div class="form_field_input"> - {{ form.collection_description }} - </div> - - </div> - <p class="form_field_label"> - <label for="{{ (form.note.name) }}">{{ _(form.note.label.text) }}</label> - </p> - <div class="form_field_input"> - {{ form.note }} + {{- wtforms_util.render_field_div(form.collection_title) }} + {{- wtforms_util.render_field_div(form.collection_description) }} </div> + {{- wtforms_util.render_field_div(form.note) }} <div class="form_submit_buttons"> {# TODO: This isn't a button really... might do unexpected things :) #} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html index d2a5655e..1d7dcc17 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html @@ -40,7 +40,7 @@ <p class="delete_checkbox_box"> {{ form.confirm }} - <label for="{{ (form.confirm.name) }}">{{ _(form.confirm.label.text) }}</label> + {{ wtforms_util.render_label(form.confirm) }} </p> <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/utils/collections.html b/mediagoblin/templates/mediagoblin/utils/collections.html index 6cb5a342..69738e26 100644 --- a/mediagoblin/templates/mediagoblin/utils/collections.html +++ b/mediagoblin/templates/mediagoblin/utils/collections.html @@ -17,20 +17,28 @@ #} {% block collections_content -%} - <h3>{% trans collected=media.collected %}In collections ({{ collected }}){% endtrans %}</h3> - <p> - {% for collection in media.collections %} - {% if loop.last %} - {# the 'and' should only appear if there is more than one collections #} - {% if media.collections|length > 1 %} + {% if media.collections %} + <h3>{% trans %}Collected in{% endtrans %}</h3> + <p> + {%- for collection in media.collections %} + {%- if not loop.first %} · - {% endif %} - <a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> - {% elif loop.revindex == 2 %} - <a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> - {% else %} - <a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> · - {% endif %} - {% endfor %} - </p> + {%- endif %} + <a href="{{ collection.url_for_self(request.urlgen) }}"> + {{- collection.title }} ( + {{- collection.get_creator.username -}} + )</a> + {%- endfor %} + </p> + {%- endif %} + {%- if request.user %} + <p> + <a type="submit" href="{{ request.urlgen('mediagoblin.user_pages.media_collect', + user=media.get_uploader.username, + media_id=media.id) }}" + class="button_action"> + {% trans %}Add to a collection{% endtrans %} + </a> + </p> + {%- endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html deleted file mode 100644 index b48678bb..00000000 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ /dev/null @@ -1,60 +0,0 @@ -{# -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# 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/>. -#} - -{% block geolocation_map %} - {% if app_config['geolocation_map_visible'] - and media.media_data.gps_latitude is defined - and media.media_data.gps_latitude - and media.media_data.gps_longitude is defined - and media.media_data.gps_longitude %} - <h3>{% trans %}Location{% endtrans %}</h3> - <div> - {%- set lon = media.media_data.gps_longitude %} - {%- set lat = media.media_data.gps_latitude %} - {%- set osm_url = "http://openstreetmap.org/?mlat={lat}&mlon={lon}".format(lat=lat, lon=lon) %} - <div id="tile-map" style="width: 100%; height: 196px;"> - <input type="hidden" id="gps-longitude" - value="{{ lon }}" /> - <input type="hidden" id="gps-latitude" - value="{{ lat }}" /> - </div> - <script> <!-- pop up full OSM license when clicked --> - $(document).ready(function(){ - $("#osm_license_link").click(function () { - $("#osm_attrib").slideToggle("slow"); - }); - }); - </script> - <div id="osm_attrib" class="hidden"><ul><li> - Data ©<a - href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> - contributors - </li><li>Imaging ©<a - href="http://mapquest.com">MapQuest</a></li><li>Maps powered by - <a href="http://leafletjs.com/"> Leaflet</a></li></ul> - </div> - <p> - <small> - {% trans -%} - View on <a href="{{ osm_url }}">OpenStreetMap</a> - {%- endtrans %} - </small> - </p> - </div> - {% endif %} -{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/tags.html b/mediagoblin/templates/mediagoblin/utils/tags.html index 0127035c..bb4bd1a5 100644 --- a/mediagoblin/templates/mediagoblin/utils/tags.html +++ b/mediagoblin/templates/mediagoblin/utils/tags.html @@ -26,16 +26,20 @@ · {% endif %} <a href="{{ request.urlgen( - 'mediagoblin.listings.tags_listing', - tag=tag['slug']) }}">{{ tag['name'] }}</a> + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> {% elif loop.revindex == 2 %} <a href="{{ request.urlgen( - 'mediagoblin.listings.tags_listing', - tag=tag['slug']) }}">{{ tag['name'] }}</a> + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> {% else %} <a href="{{ request.urlgen( - 'mediagoblin.listings.tags_listing', - tag=tag['slug']) }}">{{ tag['name'] }}</a> · + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> + · {% endif %} {% endfor %} </p> diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 58ecb8e0..35b4aa04 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -16,11 +16,25 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #} +{# Render the label for a field #} +{% macro render_label(field) %} + {%- if field.label.text -%} + <label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label> + {%- endif -%} +{%- endmacro %} + +{# Render the label in a <p> for a field #} +{% macro render_label_p(field) %} + {%- if field.label.text %} + <p class="form_field_label"> + {{- render_label(field) -}} + </p> + {%- endif %} +{%- endmacro %} + {# Generically render a field #} {% macro render_field_div(field) %} - {% if field.label.text -%} - <p class="form_field_label"><label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label></p> - {%- endif %} + {{- render_label_p(field) }} <div class="form_field_input"> {{ field }} {%- if field.errors -%} @@ -28,7 +42,7 @@ <p class="form_field_error">{{ _(error) }}</p> {% endfor %} {%- endif %} - {% if field.description -%} + {%- if field.description %} <p class="form_field_description">{{ _(field.description)|safe }}</p> {%- endif %} </div> |