diff options
author | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-05-06 12:39:23 -0400 |
---|---|---|
committer | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-05-06 12:39:23 -0400 |
commit | fffc5dcfe031d30551a91e668b377d443d9267db (patch) | |
tree | 90dc14caa92ca90e461c38067b16758b586f6434 | |
parent | 9f5d388ec01c195ffbacc4a1fd876fb507a6f62d (diff) | |
download | mediagoblin-fffc5dcfe031d30551a91e668b377d443d9267db.tar.lz mediagoblin-fffc5dcfe031d30551a91e668b377d443d9267db.tar.xz mediagoblin-fffc5dcfe031d30551a91e668b377d443d9267db.zip |
Created the media metadata editor page
-rw-r--r-- | mediagoblin/edit/forms.py | 5 | ||||
-rw-r--r-- | mediagoblin/edit/views.py | 13 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/edit/metadata.html | 23 | ||||
-rw-r--r-- | mediagoblin/user_pages/routing.py | 4 |
4 files changed, 44 insertions, 1 deletions
diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 2c9b5e99..cff3a53f 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -122,3 +122,8 @@ class ChangeEmailForm(wtforms.Form): [wtforms.validators.Required()], description=_( "Enter your password to prove you own this account.")) + +class EditMetaDataForm(wtforms.Form): + media_metadata = wtforms.FieldList( + wtforms.TextField( + _(u'Value'))) diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 80590875..e20d0ecc 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -29,7 +29,8 @@ from mediagoblin.edit import forms from mediagoblin.edit.lib import may_edit_media from mediagoblin.decorators import (require_active_login, active_user_from_url, get_media_entry_by_id, user_may_alter_collection, - get_user_collection) + get_user_collection, user_has_privilege, + user_not_banned) from mediagoblin.tools.crypto import get_timed_signer_url from mediagoblin.tools.mail import email_debug_message from mediagoblin.tools.response import (render_to_response, @@ -432,3 +433,13 @@ def change_email(request): 'mediagoblin/edit/change_email.html', {'form': form, 'user': user}) + +@user_has_privilege(u'admin') +@require_active_login +@get_media_entry_by_id +def edit_metadata(request, media): + form = forms.EditMetaDataForm() + return render_to_response( + request, + 'mediagoblin/edit/metadata.html', + {'form':form}) diff --git a/mediagoblin/templates/mediagoblin/edit/metadata.html b/mediagoblin/templates/mediagoblin/edit/metadata.html new file mode 100644 index 00000000..3f97555e --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/metadata.html @@ -0,0 +1,23 @@ +{# +# 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/>. +#} +{%- extends "mediagoblin/base.html" %} +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + {{ wtforms_util.render_divs(form) }} +{% endblock mediagoblin_content %} diff --git a/mediagoblin/user_pages/routing.py b/mediagoblin/user_pages/routing.py index f0f4d8b7..8eb51c8d 100644 --- a/mediagoblin/user_pages/routing.py +++ b/mediagoblin/user_pages/routing.py @@ -101,3 +101,7 @@ add_route('mediagoblin.edit.edit_media', add_route('mediagoblin.edit.attachments', '/u/<string:user>/m/<int:media_id>/attachments/', 'mediagoblin.edit.views:edit_attachments') + +add_route('mediagoblin.edit.metadata', + '/u/<string:user>/m/<int:media_id>/metadata/', + 'mediagoblin.edit.views:edit_metadata') |