From 22237890caf3c65f6ecc696a619299cba91ff90c Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Mon, 10 Aug 2009 21:39:37 -0400 Subject: untested commit. merged Adolfos mods, validated most of html, slugify urls, fixed IE issues in openid signin --- forum/models.py | 20 ++++----- forum/templatetags/extra_filters.py | 9 +++- forum/templatetags/extra_tags.py | 6 ++- locale/en/LC_MESSAGES/django.po | 44 +++++++++---------- locale/es/LC_MESSAGES/django.po | 4 +- templates/404.html | 2 +- templates/500.html | 4 +- templates/answer_edit.html | 12 ++---- templates/answer_edit_tips.html | 2 - templates/ask.html | 17 ++++---- templates/authopenid/changeemail.html | 2 +- templates/authopenid/complete.html | 28 ++++++------ templates/authopenid/sendpw.html | 4 +- templates/authopenid/signin.html | 29 ++++++------- templates/authopenid/signup.html | 10 ++--- templates/badges.html | 5 +-- templates/base.html | 10 +++-- templates/base_content.html | 12 +++--- templates/book.html | 2 +- .../content/jquery-openid/images/blogger-1.png | Bin 0 -> 432 bytes .../content/jquery-openid/images/claimid-0.png | Bin 0 -> 629 bytes templates/content/jquery-openid/images/flickr.png | Bin 0 -> 426 bytes .../content/jquery-openid/images/livejournal-1.png | Bin 0 -> 713 bytes .../content/jquery-openid/images/myopenid-2.png | Bin 0 -> 511 bytes .../content/jquery-openid/images/technorati-1.png | Bin 0 -> 606 bytes .../content/jquery-openid/images/verisign-2.png | Bin 0 -> 859 bytes templates/content/jquery-openid/images/vidoop.png | Bin 0 -> 499 bytes .../content/jquery-openid/images/wordpress.png | Bin 0 -> 566 bytes templates/content/jquery-openid/openid.css | 2 +- templates/content/style/style.css | 1 - templates/faq.html | 2 +- templates/footer.html | 6 ++- templates/header.html | 17 ++++---- templates/index.html | 12 +++--- templates/logout.html | 1 - templates/privacy.html | 1 - templates/question.html | 47 ++++++++++++--------- templates/question_edit.html | 16 +++---- templates/question_edit_tips.html | 2 - templates/question_retag.html | 7 +-- templates/questions.html | 22 +++++----- templates/tags.html | 7 ++- templates/unanswered.html | 10 ++--- templates/user_info.html | 2 +- templates/user_preferences.html | 11 ++--- templates/user_responses.html | 2 +- templates/user_stats.html | 9 ++-- templates/user_tabs.html | 2 +- templates/users_questions.html | 2 +- 49 files changed, 199 insertions(+), 204 deletions(-) create mode 100644 templates/content/jquery-openid/images/blogger-1.png create mode 100644 templates/content/jquery-openid/images/claimid-0.png create mode 100644 templates/content/jquery-openid/images/flickr.png create mode 100644 templates/content/jquery-openid/images/livejournal-1.png create mode 100644 templates/content/jquery-openid/images/myopenid-2.png create mode 100644 templates/content/jquery-openid/images/technorati-1.png create mode 100644 templates/content/jquery-openid/images/verisign-2.png create mode 100644 templates/content/jquery-openid/images/vidoop.png create mode 100644 templates/content/jquery-openid/images/wordpress.png diff --git a/forum/models.py b/forum/models.py index 7de703ca..9510476a 100644 --- a/forum/models.py +++ b/forum/models.py @@ -274,6 +274,16 @@ class Question(models.Model): class Meta: db_table = u'question' +class FavoriteQuestion(models.Model): + """A favorite Question of a User.""" + question = models.ForeignKey(Question) + user = models.ForeignKey(User, related_name='user_favorite_questions') + added_at = models.DateTimeField(default=datetime.datetime.now) + class Meta: + db_table = u'favorite_question' + def __unicode__(self): + return '[%s] favorited at %s' %(self.user, self.added_at) + class QuestionRevision(models.Model): """A revision of a Question.""" question = models.ForeignKey(Question, related_name='revisions') @@ -422,16 +432,6 @@ class AnswerRevision(models.Model): flat=True)[0] + 1 super(AnswerRevision, self).save(**kwargs) -class FavoriteQuestion(models.Model): - """A favorite Question of a User.""" - question = models.ForeignKey(Question) - user = models.ForeignKey(User, related_name='user_favorite_questions') - added_at = models.DateTimeField(default=datetime.datetime.now) - class Meta: - db_table = u'favorite_question' - def __unicode__(self): - return '[%s] favorited at %s' %(self.user, self.added_at) - class Badge(models.Model): """Awarded for notable actions performed on the site by Users.""" GOLD = 1 diff --git a/forum/templatetags/extra_filters.py b/forum/templatetags/extra_filters.py index cec97920..d8b8e61f 100644 --- a/forum/templatetags/extra_filters.py +++ b/forum/templatetags/extra_filters.py @@ -1,8 +1,13 @@ -from django import template +from django import template from forum import auth register = template.Library() +@template.defaultfilters.stringfilter +@register.filter +def collapse(input): + return ' '.join(input.split()) + @register.filter def can_vote_up(user): return auth.can_vote_up(user) @@ -80,4 +85,4 @@ def cnprog_intword(number): else: return number except: - return number \ No newline at end of file + return number diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index ac4e6ca3..06a2d27c 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -14,7 +14,8 @@ register = template.Library() GRAVATAR_TEMPLATE = ('') + '?s=%(size)s&d=identicon&r=PG" ' + 'alt="%(username)s\'s gravatar image" />') @register.simple_tag def gravatar(user, size): @@ -26,11 +27,14 @@ def gravatar(user, size): """ try: gravatar = user['gravatar'] + username = user['username'] except (TypeError, AttributeError, KeyError): gravatar = user.gravatar + username = user.username return mark_safe(GRAVATAR_TEMPLATE % { 'size': size, 'gravatar_hash': gravatar, + 'username': template.defaultfilters.urlencode(username), }) MAX_FONTSIZE = 18 diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 3dda9ce9..07532566 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -148,7 +148,7 @@ msgstr "" #: django_authopenid/views.py:417 django_authopenid/views.py:544 msgid "Welcome" -msgstr "Verification Email from Q&A forum" +msgstr "Verification Email from Q&A forum" #: django_authopenid/views.py:507 msgid "Password changed." @@ -812,7 +812,7 @@ msgid "must have valid %(email)s to post" msgstr "" "Looks like your email address, %(email)s has not " "yet been validated. To post messages you must verify your email, " -"please see more details here.
You can submit " +"please see more details here.
You can submit " "your question now and validate email after that. Your question will saved as " "pending meanwhile. " @@ -1135,12 +1135,12 @@ msgstr "" "

How? If you have just set or changed your email " "address - check your email and click the included link." -"
The link contains a key generated specifically for you. You can also " +"
The link contains a key generated specifically for you. You can also " "