diff options
-rw-r--r-- | mediagoblin/auth/forms.py | 12 | ||||
-rw-r--r-- | mediagoblin/edit/forms.py | 11 | ||||
-rw-r--r-- | mediagoblin/edit/views.py | 11 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/root.html | 2 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/utils/pagination.html | 17 | ||||
-rw-r--r-- | mediagoblin/util.py | 2 |
6 files changed, 23 insertions, 32 deletions
diff --git a/mediagoblin/auth/forms.py b/mediagoblin/auth/forms.py index daf7b993..1dfaf095 100644 --- a/mediagoblin/auth/forms.py +++ b/mediagoblin/auth/forms.py @@ -24,18 +24,14 @@ class RegistrationForm(wtforms.Form): _('Username'), [wtforms.validators.Required(), wtforms.validators.Length(min=3, max=30), - wtforms.validators.Regexp(r'^\w+$')], - description=_( - u"This is the name other users will identify you with.")) + wtforms.validators.Regexp(r'^\w+$')]) password = wtforms.PasswordField( _('Password'), [wtforms.validators.Required(), wtforms.validators.Length(min=6, max=30), wtforms.validators.EqualTo( 'confirm_password', - _('Passwords must match.'))], - description=_( - u"Try to use a strong password!")) + _('Passwords must match.'))]) confirm_password = wtforms.PasswordField( _('Confirm password'), [wtforms.validators.Required()], @@ -44,9 +40,7 @@ class RegistrationForm(wtforms.Form): email = wtforms.TextField( _('Email address'), [wtforms.validators.Required(), - wtforms.validators.Email()], - description=_( - u"Your email will never be published.")) + wtforms.validators.Email()]) class LoginForm(wtforms.Form): diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index 7bf3c6a8..f81d58b2 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -25,13 +25,17 @@ class EditForm(wtforms.Form): title = wtforms.TextField( _('Title'), [wtforms.validators.Length(min=0, max=500)]) - slug = wtforms.TextField( - _('Slug'), - [wtforms.validators.Required(message=_("The slug can't be empty"))]) description = wtforms.TextAreaField('Description of this work') tags = wtforms.TextField( _('Tags'), [tag_length_validator]) + slug = wtforms.TextField( + _('Slug'), + [wtforms.validators.Required(message=_("The slug can't be empty"))], + description=_( + "The title part of this media's URL. " + "You usually don't need to change this.")) + class EditProfileForm(wtforms.Form): bio = wtforms.TextAreaField( @@ -42,6 +46,7 @@ class EditProfileForm(wtforms.Form): [wtforms.validators.Optional(), wtforms.validators.URL(message='Improperly formed URL')]) + class EditAttachmentsForm(wtforms.Form): attachment_name = wtforms.TextField( 'Title') diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index e1af1a23..11bee110 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -46,9 +46,6 @@ def edit_media(request, media): description=media['description'], tags=media_tags_as_string(media['tags'])) - if len(media['attachment_files']): - defaults['attachment_name'] = media['attachment_files'][0]['name'] - form = forms.EditForm( request.POST, **defaults) @@ -73,14 +70,6 @@ def edit_media(request, media): media['description_html'] = cleaned_markdown_conversion( media['description']) - if 'attachment_name' in request.POST: - media['attachment_files'][0]['name'] = \ - request.POST['attachment_name'] - - if 'attachment_delete' in request.POST \ - and 'y' == request.POST['attachment_delete']: - del media['attachment_files'][0] - media['slug'] = unicode(request.POST['slug']) media.save() diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index 8fc62f32..ed4878a5 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -35,7 +35,7 @@ </ul> {% if allow_registration %} - <p>Excited to join us? To add your own media, make collections and save favorites...<p> + <p>Excited to join us?<p> <a class="header_submit_highlight" href="{{ request.urlgen('mediagoblin.auth.register') }}">Create a free account</a> or <a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a> {% endif %} diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index cdac01c8..87e15e0f 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -33,15 +33,18 @@ <div class="pagination"> <p> {% if pagination.has_prev %} - <a href="{{ pagination.get_page_url_explicit( - base_url, get_params, - pagination.page - 1) }}"><img class="pagination_arrow" src="/mgoblin_static/images/pagination_left.png" alt="Previous page" />Newer</a> + {% set prev_url = pagination.get_page_url_explicit( + base_url, get_params, + pagination.page - 1) %} + <a href="{{ prev_url }}"><img class="pagination_arrow" src="/mgoblin_static/images/pagination_left.png" alt="Previous page" /></a> + <a href="{{ prev_url }}">{% trans %}Newer{% endtrans %}</a> {% endif %} {% if pagination.has_next %} - <a href="{{ pagination.get_page_url_explicit( - base_url, get_params, - pagination.page + 1) }}">Older<img class="pagination_arrow" src="/mgoblin_static/images/pagination_right.png" alt="Next page" /> - </a> + {% set next_url = pagination.get_page_url_explicit( + base_url, get_params, + pagination.page + 1) %} + <a href="{{ next_url }}">{% trans %}Older{% endtrans %}</a> + <a href="{{ next_url }}"><img class="pagination_arrow" src="/mgoblin_static/images/pagination_right.png" alt="Next page" /></a> {% endif %} <br /> Go to page: diff --git a/mediagoblin/util.py b/mediagoblin/util.py index e391b8b0..7ff3ec7f 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -689,7 +689,7 @@ def delete_media_files(media): Arguments: - media: A MediaEntry document """ - for handle, listpath in media['media_files'].items(): + for listpath in media['media_files'].itervalues(): mg_globals.public_store.delete_file( listpath) |