aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/user_pages')
-rw-r--r--mediagoblin/user_pages/forms.py7
-rw-r--r--mediagoblin/user_pages/routing.py2
-rw-r--r--mediagoblin/user_pages/views.py9
3 files changed, 13 insertions, 5 deletions
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'<a href="http://daringfireball.net/projects/markdown/basics">'
+ u'Markdown</a> for formatting.'))
class ConfirmDeleteForm(wtforms.Form):
confirm = wtforms.BooleanField(
diff --git a/mediagoblin/user_pages/routing.py b/mediagoblin/user_pages/routing.py
index a9431405..2b228355 100644
--- a/mediagoblin/user_pages/routing.py
+++ b/mediagoblin/user_pages/routing.py
@@ -37,7 +37,7 @@ add_route('mediagoblin.user_pages.user_gallery',
'mediagoblin.user_pages.views:user_gallery')
add_route('mediagoblin.user_pages.media_home.view_comment',
- '/u/<string:user>/m/<string:media>/c/<string:comment>/',
+ '/u/<string:user>/m/<string:media>/c/<int:comment>/',
'mediagoblin.user_pages.views:media_home')
add_route('mediagoblin.user_pages.atom_feed',
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 30c78a38..dea47fbf 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -110,12 +110,13 @@ def media_home(request, media, page, **kwargs):
"""
'Homepage' of a MediaEntry()
"""
- if request.matchdict.get('comment', None):
+ comment_id = request.matchdict.get('comment', None)
+ if comment_id:
pagination = Pagination(
page, media.get_comments(
mg_globals.app_config['comments_ascending']),
MEDIA_COMMENTS_PER_PAGE,
- request.matchdict.get('comment'))
+ comment_id)
else:
pagination = Pagination(
page, media.get_comments(
@@ -226,6 +227,10 @@ def media_collect(request, media):
messages.add_message(
request, messages.ERROR,
_('You have to select or add a collection'))
+ return redirect(request, "mediagoblin.user_pages.media_collect",
+ user=media.get_uploader.username,
+ media=media.id)
+
# Check whether media already exists in collection
elif CollectionItem.query.filter_by(