Created the media metadata editor page
authortilly-Q <nattilypigeonfowl@gmail.com>
Tue, 6 May 2014 16:39:23 +0000 (12:39 -0400)
committertilly-Q <nattilypigeonfowl@gmail.com>
Tue, 6 May 2014 16:39:23 +0000 (12:39 -0400)
mediagoblin/edit/forms.py
mediagoblin/edit/views.py
mediagoblin/templates/mediagoblin/edit/metadata.html [new file with mode: 0644]
mediagoblin/user_pages/routing.py

index 2c9b5e99ad42cc6d97383413bb0f7b27274ce87a..cff3a53f6988be28529439e351776f3307acbde5 100644 (file)
@@ -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')))
index 80590875680379d29baea9a67d579d9fa4f99df9..e20d0eccda07afa63cab87d15a39cf7003bf3092 100644 (file)
@@ -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 (file)
index 0000000..3f97555
--- /dev/null
@@ -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 %}
index f0f4d8b7ec984b6c86c954d2bdeb3f6811f94b8c..8eb51c8d14f91caa5f61f60e48cb9d1f2544b4d8 100644 (file)
@@ -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')