Created the media metadata editor page
This commit is contained in:
parent
9f5d388ec0
commit
fffc5dcfe0
@ -122,3 +122,8 @@ class ChangeEmailForm(wtforms.Form):
|
|||||||
[wtforms.validators.Required()],
|
[wtforms.validators.Required()],
|
||||||
description=_(
|
description=_(
|
||||||
"Enter your password to prove you own this account."))
|
"Enter your password to prove you own this account."))
|
||||||
|
|
||||||
|
class EditMetaDataForm(wtforms.Form):
|
||||||
|
media_metadata = wtforms.FieldList(
|
||||||
|
wtforms.TextField(
|
||||||
|
_(u'Value')))
|
||||||
|
@ -29,7 +29,8 @@ from mediagoblin.edit import forms
|
|||||||
from mediagoblin.edit.lib import may_edit_media
|
from mediagoblin.edit.lib import may_edit_media
|
||||||
from mediagoblin.decorators import (require_active_login, active_user_from_url,
|
from mediagoblin.decorators import (require_active_login, active_user_from_url,
|
||||||
get_media_entry_by_id, user_may_alter_collection,
|
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.crypto import get_timed_signer_url
|
||||||
from mediagoblin.tools.mail import email_debug_message
|
from mediagoblin.tools.mail import email_debug_message
|
||||||
from mediagoblin.tools.response import (render_to_response,
|
from mediagoblin.tools.response import (render_to_response,
|
||||||
@ -432,3 +433,13 @@ def change_email(request):
|
|||||||
'mediagoblin/edit/change_email.html',
|
'mediagoblin/edit/change_email.html',
|
||||||
{'form': form,
|
{'form': form,
|
||||||
'user': user})
|
'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})
|
||||||
|
23
mediagoblin/templates/mediagoblin/edit/metadata.html
Normal file
23
mediagoblin/templates/mediagoblin/edit/metadata.html
Normal file
@ -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 %}
|
@ -101,3 +101,7 @@ add_route('mediagoblin.edit.edit_media',
|
|||||||
add_route('mediagoblin.edit.attachments',
|
add_route('mediagoblin.edit.attachments',
|
||||||
'/u/<string:user>/m/<int:media_id>/attachments/',
|
'/u/<string:user>/m/<int:media_id>/attachments/',
|
||||||
'mediagoblin.edit.views:edit_attachments')
|
'mediagoblin.edit.views:edit_attachments')
|
||||||
|
|
||||||
|
add_route('mediagoblin.edit.metadata',
|
||||||
|
'/u/<string:user>/m/<int:media_id>/metadata/',
|
||||||
|
'mediagoblin.edit.views:edit_metadata')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user