From 074ac832c3ccd22f58118d51606ede3a1e696b4c Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Wed, 29 Jun 2011 01:35:43 +0200 Subject: Issue #362 - Added new `wtforms.Form`; `MediaCommentForm()` * ADDED `MediaCommentForm` is a form for `MediaComment` user entry and posting. --- mediagoblin/user_pages/forms.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 mediagoblin/user_pages/forms.py (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py new file mode 100644 index 00000000..9f7d2fbd --- /dev/null +++ b/mediagoblin/user_pages/forms.py @@ -0,0 +1,21 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc +# +# 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 . + +import wtforms + +class MediaCommentForm(wtforms.Form): + comment = wtforms.TextAreaField('Comment', + [wtforms.validators.Required()]) \ No newline at end of file -- cgit v1.2.3 From af2fcba5c4ce16bde1a2267b95803bc2afc9e572 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Thu, 7 Jul 2011 18:04:19 +0200 Subject: Issue #431 - Prevent comment link expiry - Added functionality for comment linking * `media.html` * Changed comment textarea handle from `comment` => `field_comment` * Active comment is hilighted with the CSS class name `comment_active` and also with the hyperlink anchor #comment * Changed media.html so that pagination always uses Route('mediagoblin.user_pages.media_home') as base_url * `user_pages/forms.py` * Renamed MediaComment form field `comment` => `field_comment` * `user_pages/routing.py` * Added route for `/u/joar/m/123..456/c/234..567/`, points to `media_home` * `user_pages/views.py` * `media_home` now checks if the request contains a comment id parameter then acts accordingly with pagination whether to call it with a `jump_to_id` or not. * `media_post_comment` - Updated MediaCommentForm field name `comment` => `field_comment` * `util.py` * `redirect` now supports querystring arguments. - NOT USED (should we keep it? I think so, it might be useful, sometime [don't call me a code hoarder]). * `Pagination.__init__` now accepts one further argument, the `jump_to_id`. It assist the comment linking functionality in finding and returning the proper page for a comment. This feature will work for all kinds of objects. It might not be optimal, but it is well functional :) --- mediagoblin/user_pages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 9f7d2fbd..b234d739 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -17,5 +17,5 @@ import wtforms class MediaCommentForm(wtforms.Form): - comment = wtforms.TextAreaField('Comment', - [wtforms.validators.Required()]) \ No newline at end of file + field_comment = wtforms.TextAreaField('Comment', + [wtforms.validators.Required()]) -- cgit v1.2.3 From f646f5d36df0730a8c34019dfcc37cca31cc6bb6 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Thu, 7 Jul 2011 22:45:51 +0200 Subject: Updated `MediaCommentForm.field_comment` => `MediaCommentForm.comment_content` * Also changed file encoding of `user_pages/forms.py` from dos to unix. --- mediagoblin/user_pages/forms.py | 43 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index b234d739..8829b674 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -1,21 +1,22 @@ -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 Free Software Foundation, Inc -# -# 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 . - -import wtforms - -class MediaCommentForm(wtforms.Form): - field_comment = wtforms.TextAreaField('Comment', - [wtforms.validators.Required()]) +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc +# +# 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 . + +import wtforms + +class MediaCommentForm(wtforms.Form): + comment_content = wtforms.TextAreaField( + 'Comment', + [wtforms.validators.Required()]) -- cgit v1.2.3 From 7960ac985f9b5a80063f21012d53793cb2d22dd9 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Aug 2011 12:07:59 -0500 Subject: Converting all forms to use the "fake/null" gettext conversion function Gettext doesn't actually get run right in the form but we do need to wrap the strings in _() so stuff extracts :) --- mediagoblin/user_pages/forms.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 8829b674..0489f76a 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -16,7 +16,10 @@ import wtforms +from mediagoblin.util import pass_to_ugettext as _ + + class MediaCommentForm(wtforms.Form): - comment_content = wtforms.TextAreaField( - 'Comment', - [wtforms.validators.Required()]) + comment_content = wtforms.TextAreaField( + _('Comment'), + [wtforms.validators.Required()]) -- cgit v1.2.3 From 369fd2f97214168eae0f8408c4006741b4de8d0a Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Aug 2011 12:28:42 -0500 Subject: Ooops! We should do a fake ugettext passthrough here also. --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 0489f76a..ce7bfaa4 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -16,7 +16,7 @@ import wtforms -from mediagoblin.util import pass_to_ugettext as _ +from mediagoblin.util import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): -- cgit v1.2.3 From 9bc564ff53a7488ee3b6548dea73d5b43d234cda Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 10 Aug 2011 12:44:58 -0500 Subject: Minor change to indentation --- mediagoblin/user_pages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index ce7bfaa4..25001019 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -21,5 +21,5 @@ from mediagoblin.util import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( - _('Comment'), - [wtforms.validators.Required()]) + _('Comment'), + [wtforms.validators.Required()]) -- cgit v1.2.3 From 502073f2bf65380be18b349a678ac075777889a4 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 30 Aug 2011 23:16:46 +0200 Subject: Feature #403 - Ability to delete media entries - Fixes according to feedback * Moved `mediagoblin.confirm` stuff to `mediagoblin.user_pages`, templates too. * Removed route extension for `mediagoblin.confirm` * Created `delete_media_files` which deletes all media files on the public_store when the entry is deleted * Created a new decorator to check if a user has the permission to delete an entry. --- mediagoblin/user_pages/forms.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 25001019..4a79bedd 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -23,3 +23,10 @@ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( _('Comment'), [wtforms.validators.Required()]) + + +class ConfirmDeleteForm(wtforms.Form): + confirm = wtforms.RadioField('Confirm', + default='False', + choices=[('False', 'No, I made a mistake!'), + ('True', 'Yes, delete it!')]) -- cgit v1.2.3 From 12a100e4d8bdda7bd2353403a7e08e3a94669498 Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Thu, 1 Sep 2011 20:49:54 -0400 Subject: 508. Updates copyright/license information --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 4a79bedd..22dedfd9 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -1,5 +1,5 @@ # GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 Free Software Foundation, Inc +# Copyright (C) 2011 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 -- cgit v1.2.3 From 8daef28dc75b30917d42497a5419d54ea5ab5eae Mon Sep 17 00:00:00 2001 From: Shawn Khan Date: Mon, 5 Sep 2011 19:12:53 -0400 Subject: Page Redesign to Delete confirmation page --- mediagoblin/user_pages/forms.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 22dedfd9..bf456630 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -26,7 +26,5 @@ class MediaCommentForm(wtforms.Form): class ConfirmDeleteForm(wtforms.Form): - confirm = wtforms.RadioField('Confirm', - default='False', - choices=[('False', 'No, I made a mistake!'), - ('True', 'Yes, delete it!')]) + confirm = wtforms.BooleanField('I am sure I want to delete this', + [wtforms.validators.Required()]) -- cgit v1.2.3 From 7624c641cd0f5a6d438d88dcfb48d724b09e7763 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 5 Sep 2011 23:20:08 -0500 Subject: Updating the confirm delete form: checkboxes shouldn't be required, make translatable --- mediagoblin/user_pages/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index bf456630..57061d34 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -26,5 +26,5 @@ class MediaCommentForm(wtforms.Form): class ConfirmDeleteForm(wtforms.Form): - confirm = wtforms.BooleanField('I am sure I want to delete this', - [wtforms.validators.Required()]) + confirm = wtforms.BooleanField( + _('I am sure I want to delete this')) -- cgit v1.2.3 From ae3bc7fabf8e0abb5f3d8b6534ca451890bbe90b Mon Sep 17 00:00:00 2001 From: Aaron Williamson Date: Sat, 1 Oct 2011 09:31:42 -0400 Subject: Moved common, translation, template, and url code out of util.py and into tools/[file].py --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 57061d34..301f1f0a 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -16,7 +16,7 @@ import wtforms -from mediagoblin.util import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): -- cgit v1.2.3 From 75a12d632dd281d4d74b93f9014000a3efdc3169 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 9 Dec 2011 22:37:20 +0100 Subject: Lots of changes to media page; rearranged things, added new styles, added jquery bits, gave the comment section a refresh --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 301f1f0a..e04fd559 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -21,7 +21,7 @@ from mediagoblin.tools.translate import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( - _('Comment'), + _(''), [wtforms.validators.Required()]) -- cgit v1.2.3 From cf29e8a824e0ef4612f1144f079c80c1d20b89e5 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 2 Feb 2012 09:44:13 -0600 Subject: It's 2012 all up in here --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index e04fd559..acfbadab 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -1,5 +1,5 @@ # GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. +# 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 -- cgit v1.2.3 From 416b439fc883a570902edd094b44f310d66e849c Mon Sep 17 00:00:00 2001 From: Elrond Date: Sat, 17 Mar 2012 13:18:43 +0100 Subject: More/better translation. - Try to preserve some translations (somehow). - Mark "Tagged with" again for translation. - Do not translate the empty string --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index acfbadab..f17e6c00 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -21,7 +21,7 @@ from mediagoblin.tools.translate import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( - _(''), + '', [wtforms.validators.Required()]) -- cgit v1.2.3 From be5be1154fd22c548125ce5a055af1bdfdad9526 Mon Sep 17 00:00:00 2001 From: Aaron Williamson Date: Fri, 17 Aug 2012 00:54:40 -0400 Subject: Added basic collection functionality --- mediagoblin/user_pages/forms.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index f17e6c00..9e8ccf01 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -15,16 +15,32 @@ # along with this program. If not, see . import wtforms - +from wtforms.ext.sqlalchemy.fields import QuerySelectField from mediagoblin.tools.translate import fake_ugettext_passthrough as _ - class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( '', [wtforms.validators.Required()]) - class ConfirmDeleteForm(wtforms.Form): confirm = wtforms.BooleanField( _('I am sure I want to delete this')) + +class ConfirmCollectionItemRemoveForm(wtforms.Form): + confirm = wtforms.BooleanField( + _('I am sure I want to remove this item from the collection')) + +class MediaCollectForm(wtforms.Form): + collection = QuerySelectField(allow_blank=True, blank_text=_('-- Select --'), get_label='title',) + note = wtforms.TextAreaField( + _('Include a note'), + [wtforms.validators.Optional()],) + collection_title = wtforms.TextField( + _('Title'), + [wtforms.validators.Length(min=0, max=500)]) + collection_description = wtforms.TextAreaField( + _('Description of this collection'), + description=_("""You can use + + Markdown for formatting.""")) -- cgit v1.2.3 From 55a04f01b881830f164e8a1b0a695dead6cddba3 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 22 Jan 2013 14:38:53 +0100 Subject: Moved MediaComment form descriptions to apt. place --- mediagoblin/user_pages/forms.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index 9e8ccf01..c7398d84 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -20,8 +20,11 @@ from mediagoblin.tools.translate import fake_ugettext_passthrough as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( - '', - [wtforms.validators.Required()]) + _('Comment'), + [wtforms.validators.Required()], + description=_(u'You can use ' + u'' + u'Markdown for formatting.')) class ConfirmDeleteForm(wtforms.Form): confirm = wtforms.BooleanField( -- cgit v1.2.3 From accb073e8ca9907b1fe88a775c8fe8632e0e2e7f Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 5 Feb 2013 16:25:19 +0100 Subject: Mark "Collection" for translation in media_collect. --- mediagoblin/user_pages/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index c7398d84..e9746a6c 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -35,7 +35,9 @@ class ConfirmCollectionItemRemoveForm(wtforms.Form): _('I am sure I want to remove this item from the collection')) class MediaCollectForm(wtforms.Form): - collection = QuerySelectField(allow_blank=True, blank_text=_('-- Select --'), get_label='title',) + collection = QuerySelectField( + _('Collection'), + allow_blank=True, blank_text=_('-- Select --'), get_label='title',) note = wtforms.TextAreaField( _('Include a note'), [wtforms.validators.Optional()],) -- cgit v1.2.3 From 665b9c420aa1a7c768e44a8639b6fc185823e202 Mon Sep 17 00:00:00 2001 From: Aditi Mittal Date: Mon, 22 Apr 2013 19:18:45 +0530 Subject: Fix-bug-667-Use-lazy_pass_to_ugettext-for-forms. --- mediagoblin/user_pages/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/user_pages/forms.py') diff --git a/mediagoblin/user_pages/forms.py b/mediagoblin/user_pages/forms.py index e9746a6c..9a193680 100644 --- a/mediagoblin/user_pages/forms.py +++ b/mediagoblin/user_pages/forms.py @@ -16,7 +16,7 @@ import wtforms from wtforms.ext.sqlalchemy.fields import QuerySelectField -from mediagoblin.tools.translate import fake_ugettext_passthrough as _ +from mediagoblin.tools.translate import lazy_pass_to_ugettext as _ class MediaCommentForm(wtforms.Form): comment_content = wtforms.TextAreaField( -- cgit v1.2.3