Merge branch 'remotes/gullydwarf-cfdv/f360_tagging' (early part) into mergetags
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 30 Jul 2011 18:09:01 +0000 (13:09 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 30 Jul 2011 18:09:01 +0000 (13:09 -0500)
Conflicts:
mediagoblin/config_spec.ini
mediagoblin/edit/views.py
mediagoblin/util.py

1  2 
mediagoblin/config_spec.ini
mediagoblin/db/indexes.py
mediagoblin/db/models.py
mediagoblin/edit/forms.py
mediagoblin/edit/views.py
mediagoblin/submit/views.py
mediagoblin/templates/mediagoblin/user_pages/media.html
mediagoblin/util.py

index 28be5f343aad55195b945e1407e8cc1d3b1edd07,5aae6439d86bba5a9c6d6762b27f9f122caf4432..a296f0c193b15feb50175b470c0b7403d32b703b
@@@ -21,9 -21,11 +21,14 @@@ direct_remote_path = string(default="/m
  email_debug_mode = boolean(default=True)
  email_sender_address = string(default="notice@mediagoblin.example.org")
  
 +# Set to false to disable registrations
 +allow_registration = boolean(default=True)
 +
+ # tag parsing
+ tags_delimiter = string(default=",")
+ tags_case_sensitive = boolean(default=False)
+ tags_max_length = integer(default=50)
  # By default not set, but you might want something like:
  # "%(here)s/user_dev/templates/"
  local_templates = string()
Simple merge
Simple merge
index 0ed52af11ea4a24b6265b735197fdc9006d2d454,e7a86bba295493f448cb15581bb52ef24e186d5c..a1783a726f6e0b1b7e7435dc20dda54169b7a98b
@@@ -23,9 -24,11 +24,12 @@@ class EditForm(wtforms.Form)
          'Title',
          [wtforms.validators.Length(min=0, max=500)])
      slug = wtforms.TextField(
 -        'Slug')
 +        '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])
  
  class EditProfileForm(wtforms.Form):
      bio = wtforms.TextAreaField('Bio',
index f372fbb9e00f2dce66324bfd060233d8782c09e2,e4ebe8d797ee47b4f963edbe811c124765c28ca1..5cbaadb5e52cf68482b9ab1641aa3e85e1c59e04
  
  
  from webob import exc
+ from string import split
  
  from mediagoblin import messages
+ from mediagoblin import mg_globals
  from mediagoblin.util import (
-     render_to_response, redirect, cleaned_markdown_conversion)
+     render_to_response, redirect, clean_html, convert_to_tag_list_of_dicts,
 -    media_tags_as_string)
++    media_tags_as_string, cleaned_markdown_conversion)
  from mediagoblin.edit import forms
  from mediagoblin.edit.lib import may_edit_media
  from mediagoblin.decorators import require_active_login, get_user_media_entry
@@@ -50,9 -56,14 +54,11 @@@ def edit_media(request, media)
          else:
              media['title'] = request.POST['title']
              media['description'] = request.POST.get('description')
+             media['tags'] = convert_to_tag_list_of_dicts(
+                                    request.POST.get('tags'))
+             
 -            md = markdown.Markdown(
 -                safe_mode = 'escape')
 -            media['description_html'] = clean_html(
 -                md.convert(
 -                    media['description']))
 +            media['description_html'] = cleaned_markdown_conversion(
 +                media['description'])
  
              media['slug'] = request.POST['slug']
              media.save()
Simple merge
index 1892378ccf6db98e30586131319c88a8a5d0ec71,f051dc507ff9ee6cf5a82ecc87d1f40cdcdaf927..bb9f6db4838e065b5516c6f68bb840d9e5d20902
@@@ -23,8 -21,10 +23,9 @@@ import smtpli
  import sys
  import re
  import urllib
 -from math import ceil
 -from string import strip
 +from math import ceil, floor
  import copy
+ import wtforms
  
  from babel.localedata import exists
  import jinja2