From ba4363f23c06e522cdfc2349c8b0112867247f42 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Aug 2009 22:55:30 -0400 Subject: added some more files --- TODO | 4 + django_authopenid/decorators.py | 2 + forum/management/commands/send_email_alerts.py | 41 +++++++++ locale/en/LC_MESSAGES/django.mo | Bin 0 -> 15885 bytes locale/es/LC_MESSAGES/django.mo | Bin 0 -> 39157 bytes locale/zh_CN/LC_MESSAGES/django.mo | Bin 0 -> 37880 bytes sql_scripts/update_2009_07_05_EF.sql | 3 + templates/authopenid/email_validation.txt | 15 ++++ templates/content/jquery-openid/images/aol.gif | Bin 0 -> 2205 bytes templates/content/jquery-openid/images/blogger.ico | Bin 0 -> 3638 bytes templates/content/jquery-openid/images/claimid.ico | Bin 0 -> 3638 bytes .../content/jquery-openid/images/facebook.gif | Bin 0 -> 2075 bytes templates/content/jquery-openid/images/flickr.ico | Bin 0 -> 1150 bytes templates/content/jquery-openid/images/google.gif | Bin 0 -> 1596 bytes .../content/jquery-openid/images/livejournal.ico | Bin 0 -> 5222 bytes .../content/jquery-openid/images/myopenid.ico | Bin 0 -> 2862 bytes .../jquery-openid/images/openid-inputicon.gif | Bin 0 -> 237 bytes templates/content/jquery-openid/images/openid.gif | Bin 0 -> 740 bytes .../content/jquery-openid/images/openidico.png | Bin 0 -> 654 bytes .../content/jquery-openid/images/technorati.ico | Bin 0 -> 2294 bytes .../content/jquery-openid/images/verisign.ico | Bin 0 -> 4710 bytes templates/content/jquery-openid/images/vidoop.ico | Bin 0 -> 1406 bytes .../content/jquery-openid/images/wordpress.ico | Bin 0 -> 1150 bytes templates/content/jquery-openid/images/yahoo.gif | Bin 0 -> 1682 bytes templates/content/jquery-openid/jquery.openid.js | 92 +++++++++++++++++++++ templates/content/jquery-openid/openid.css | 33 ++++++++ 26 files changed, 190 insertions(+) create mode 100644 TODO create mode 100644 django_authopenid/decorators.py create mode 100644 forum/management/commands/send_email_alerts.py create mode 100644 locale/en/LC_MESSAGES/django.mo create mode 100644 locale/es/LC_MESSAGES/django.mo create mode 100644 locale/zh_CN/LC_MESSAGES/django.mo create mode 100644 sql_scripts/update_2009_07_05_EF.sql create mode 100644 templates/authopenid/email_validation.txt create mode 100644 templates/content/jquery-openid/images/aol.gif create mode 100644 templates/content/jquery-openid/images/blogger.ico create mode 100644 templates/content/jquery-openid/images/claimid.ico create mode 100644 templates/content/jquery-openid/images/facebook.gif create mode 100644 templates/content/jquery-openid/images/flickr.ico create mode 100644 templates/content/jquery-openid/images/google.gif create mode 100644 templates/content/jquery-openid/images/livejournal.ico create mode 100644 templates/content/jquery-openid/images/myopenid.ico create mode 100644 templates/content/jquery-openid/images/openid-inputicon.gif create mode 100644 templates/content/jquery-openid/images/openid.gif create mode 100644 templates/content/jquery-openid/images/openidico.png create mode 100644 templates/content/jquery-openid/images/technorati.ico create mode 100644 templates/content/jquery-openid/images/verisign.ico create mode 100644 templates/content/jquery-openid/images/vidoop.ico create mode 100644 templates/content/jquery-openid/images/wordpress.ico create mode 100644 templates/content/jquery-openid/images/yahoo.gif create mode 100644 templates/content/jquery-openid/jquery.openid.js create mode 100644 templates/content/jquery-openid/openid.css diff --git a/TODO b/TODO new file mode 100644 index 00000000..3769fa08 --- /dev/null +++ b/TODO @@ -0,0 +1,4 @@ +*check change email function - there is a strange 'password' field in form +*make reusable question-block template for index questions unanswered - get rid of copy-paste +*unused votes count in user profile not working - left that commented out in templates/user_info.html +*badge award notification messages need to be set fixed at place where badges are awarded diff --git a/django_authopenid/decorators.py b/django_authopenid/decorators.py new file mode 100644 index 00000000..94498574 --- /dev/null +++ b/django_authopenid/decorators.py @@ -0,0 +1,2 @@ +import settings +def diff --git a/forum/management/commands/send_email_alerts.py b/forum/management/commands/send_email_alerts.py new file mode 100644 index 00000000..3c37aaa3 --- /dev/null +++ b/forum/management/commands/send_email_alerts.py @@ -0,0 +1,41 @@ +from django.core.management.base import NoArgsCommand +from django.db import connection +from forum.models import * +import collections +from django.core.mail import EmailMessage +from django.utils.translation import ugettext as _ +import settings + +class Command(NoArgsCommand): + def handle_noargs(self,**options): + try: + self.send_email_alerts() + except Exception, e: + print e + finally: + connection.close() + + def send_email_alerts(self): + report_time = datetime.datetime.now() + feeds = EmailFeed.objects.all() + user_ctype = ContentType.objects.get_for_model(User) + + #lists of update messages keyed by email address + update_collection = collections.defaultdict(list) + for feed in feeds: + update_summary = feed.get_update_summary() + if update_summary != None: + email = feed.get_email() + update_collection[email].append(update_summary) + feed.reported_at = report_time + feed.save() + + for email, updates in update_collection.items(): + text = '\n'.join(updates) + subject = _('updates from website') + print 'sent %s to %s' % (updates,email) + msg = EmailMessage(subject, text, settings.DEFAULT_FROM_EMAIL, [email]) + msg.content_subtype = 'html' + msg.send() + + diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 00000000..39dba67d Binary files /dev/null and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/es/LC_MESSAGES/django.mo b/locale/es/LC_MESSAGES/django.mo new file mode 100644 index 00000000..a68a2fd3 Binary files /dev/null and b/locale/es/LC_MESSAGES/django.mo differ diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo new file mode 100644 index 00000000..5173c858 Binary files /dev/null and b/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/sql_scripts/update_2009_07_05_EF.sql b/sql_scripts/update_2009_07_05_EF.sql new file mode 100644 index 00000000..43c7c2f0 --- /dev/null +++ b/sql_scripts/update_2009_07_05_EF.sql @@ -0,0 +1,3 @@ +ALTER TABLE auth_user ADD COLUMN email_isvalid TINYINT(1) NOT NULL; +UPDATE auth_user SET email_isvalid=1; +ALTER TABLE auth_user ADD COLUMN email_key varchar(32); diff --git a/templates/authopenid/email_validation.txt b/templates/authopenid/email_validation.txt new file mode 100644 index 00000000..5b166a9b --- /dev/null +++ b/templates/authopenid/email_validation.txt @@ -0,0 +1,15 @@ +{% load i18n %} +{% trans "Greetings from the Q&A forum" %}, + +{% trans "To make use of the Forum, please follow the link below:" %} + +{{validation_link}} + +{% trans "Following the link above will help us verify your email address." %} + +{% blocktrans %}If you beleive that this message was sent in mistake - +no further action is needed. Just ingore this email, we apologize +for any inconvenience{% endblocktrans %} + +{% blocktrans %}Sincerely, +Forum Administrator{% endblocktrans %} diff --git a/templates/content/jquery-openid/images/aol.gif b/templates/content/jquery-openid/images/aol.gif new file mode 100644 index 00000000..decc4f12 Binary files /dev/null and b/templates/content/jquery-openid/images/aol.gif differ diff --git a/templates/content/jquery-openid/images/blogger.ico b/templates/content/jquery-openid/images/blogger.ico new file mode 100644 index 00000000..1b9730b0 Binary files /dev/null and b/templates/content/jquery-openid/images/blogger.ico differ diff --git a/templates/content/jquery-openid/images/claimid.ico b/templates/content/jquery-openid/images/claimid.ico new file mode 100644 index 00000000..2b80f491 Binary files /dev/null and b/templates/content/jquery-openid/images/claimid.ico differ diff --git a/templates/content/jquery-openid/images/facebook.gif b/templates/content/jquery-openid/images/facebook.gif new file mode 100644 index 00000000..b997b358 Binary files /dev/null and b/templates/content/jquery-openid/images/facebook.gif differ diff --git a/templates/content/jquery-openid/images/flickr.ico b/templates/content/jquery-openid/images/flickr.ico new file mode 100644 index 00000000..11f6e07f Binary files /dev/null and b/templates/content/jquery-openid/images/flickr.ico differ diff --git a/templates/content/jquery-openid/images/google.gif b/templates/content/jquery-openid/images/google.gif new file mode 100644 index 00000000..1b6cd07b Binary files /dev/null and b/templates/content/jquery-openid/images/google.gif differ diff --git a/templates/content/jquery-openid/images/livejournal.ico b/templates/content/jquery-openid/images/livejournal.ico new file mode 100644 index 00000000..f3d21ec5 Binary files /dev/null and b/templates/content/jquery-openid/images/livejournal.ico differ diff --git a/templates/content/jquery-openid/images/myopenid.ico b/templates/content/jquery-openid/images/myopenid.ico new file mode 100644 index 00000000..ceb06e6a Binary files /dev/null and b/templates/content/jquery-openid/images/myopenid.ico differ diff --git a/templates/content/jquery-openid/images/openid-inputicon.gif b/templates/content/jquery-openid/images/openid-inputicon.gif new file mode 100644 index 00000000..cde836c8 Binary files /dev/null and b/templates/content/jquery-openid/images/openid-inputicon.gif differ diff --git a/templates/content/jquery-openid/images/openid.gif b/templates/content/jquery-openid/images/openid.gif new file mode 100644 index 00000000..c718b0e6 Binary files /dev/null and b/templates/content/jquery-openid/images/openid.gif differ diff --git a/templates/content/jquery-openid/images/openidico.png b/templates/content/jquery-openid/images/openidico.png new file mode 100644 index 00000000..ab622669 Binary files /dev/null and b/templates/content/jquery-openid/images/openidico.png differ diff --git a/templates/content/jquery-openid/images/technorati.ico b/templates/content/jquery-openid/images/technorati.ico new file mode 100644 index 00000000..fa1083c1 Binary files /dev/null and b/templates/content/jquery-openid/images/technorati.ico differ diff --git a/templates/content/jquery-openid/images/verisign.ico b/templates/content/jquery-openid/images/verisign.ico new file mode 100644 index 00000000..3953af93 Binary files /dev/null and b/templates/content/jquery-openid/images/verisign.ico differ diff --git a/templates/content/jquery-openid/images/vidoop.ico b/templates/content/jquery-openid/images/vidoop.ico new file mode 100644 index 00000000..bbd9a0d5 Binary files /dev/null and b/templates/content/jquery-openid/images/vidoop.ico differ diff --git a/templates/content/jquery-openid/images/wordpress.ico b/templates/content/jquery-openid/images/wordpress.ico new file mode 100644 index 00000000..31b7d2c2 Binary files /dev/null and b/templates/content/jquery-openid/images/wordpress.ico differ diff --git a/templates/content/jquery-openid/images/yahoo.gif b/templates/content/jquery-openid/images/yahoo.gif new file mode 100644 index 00000000..42adbfa5 Binary files /dev/null and b/templates/content/jquery-openid/images/yahoo.gif differ diff --git a/templates/content/jquery-openid/jquery.openid.js b/templates/content/jquery-openid/jquery.openid.js new file mode 100644 index 00000000..eec29ab2 --- /dev/null +++ b/templates/content/jquery-openid/jquery.openid.js @@ -0,0 +1,92 @@ +//jQuery OpenID Plugin 1.1 Copyright 2009 Jarrett Vance http://jvance.com/pages/jQueryOpenIdPlugin.xhtml +$.fn.openid = function() { + var $this = $(this); + + //name input value - needed for name based OpenID + var $usr = $this.find('input[name=openid_username]'); + + //final url input value + var $id = $this.find('input[name=openid_url]'); + + //beginning and end of name OpenID url (name being the middle) + var $front = $this.find('p:has(input[name=openid_username])>span:eq(0)'); + var $end = $this.find('p:has(input[name=openid_username])>span:eq(1)'); + + //needed for special effects only + var $usrfs = $this.find('fieldset:has(input[name=openid_username])'); + var $idfs = $this.find('fieldset:has(input[name=openid_url])'); + + var submitusr = function() { + if ($usr.val().length < 1) { + $usr.focus(); + return false; + } + $id.val($front.text() + $usr.val() + $end.text()); + return true; + }; + + var submitid = function() { + if ($id.val().length < 1) { + $id.focus(); + return false; + } + return true; + + }; + var direct = function() { + var $li = $(this); + $li.parent().find('li').removeClass('highlight'); + $li.addClass('highlight'); + $usrfs.fadeOut('slow'); + $idfs.fadeOut('slow'); + $id.val($this.find("li.highlight span").text()); + setTimeout(function(){$('#bsignin').click()},1000); + return false; + }; + + var openid = function() { + var $li = $(this); + $li.parent().find('li').removeClass('highlight'); + $li.addClass('highlight'); + $usrfs.hide(); + $idfs.show(); + $id.focus(); + $this.unbind('submit').submit(submitid); + return false; + }; + + var username = function() { + var $li = $(this); + $li.parent().find('li').removeClass('highlight'); + $li.addClass('highlight'); + $idfs.hide(); + $usrfs.show(); + $this.find('#enter_your_what').text($li.attr("title")); + $front.text($li.find("span").text().split("username")[0]); + $end.text("").text($li.find("span").text().split("username")[1]); + $id.focus(); + $this.unbind('submit').submit(submitusr); + return false; + }; + + $this.find('li.direct').click(direct); + $this.find('li.openid').click(openid); + $this.find('li.username').click(username); + $id.keypress(function(e) { + if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { + return submitid(); + } + }); + $usr.keypress(function(e) { + if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { + return submitusr(); + } + }); + $this.find('li span').hide(); + $this.find('li').css('line-height', 0).css('cursor', 'pointer'); + $this.find('li:eq(0)').click(); + + return this; +}; +// submitting next=%2F&openid_username=&openid_url=http%3A%2F%2Fyahoo.com%2F +// submitting next=%2F&openid_username=&openid_url=http%3A%2F%2Fyahoo.com%2F diff --git a/templates/content/jquery-openid/openid.css b/templates/content/jquery-openid/openid.css new file mode 100644 index 00000000..e53c1823 --- /dev/null +++ b/templates/content/jquery-openid/openid.css @@ -0,0 +1,33 @@ +fieldset {border-style:none;} +img {border-style:none;} + +.logo_box {width:90px;height:40px;background:white;border:1px solid #dddddd;} +.openid_box img {margin-top:6px;} +.aol_box img {margin-top:6px;} +.yahoo_box img {margin-top:13px;} +.google_box img {margin-top:6px;} + +form.openid ul{ margin:0;padding:0;text-align:center; list-style-type:none; display:block;} +form.openid ul li {float:left; padding:4px;} +form.openid ul li span {padding:0 1em 0 3px} +form.openid ul li.first_tiny_li {clear:left;} +form.openid fieldset {clear:both;padding:10px 0px 0px 0px;} +form.openid div+fieldset {display:none} +form.openid label {display:block; font-weight:bold; margin-bottom:.5em} +input[name=openid_username] {width:8em} +input[name=openid_identifier] {width:18em} +form.openid ul li.highlight { -moz-border-radius:4px; -webkit-border-radius:4px; background-color: #FD6} +form.openid fieldset div {-moz-border-radius:4px; -webkit-border-radius:4px; + background: #DCDCDC; + padding:10px;display:inline-block} +form.openid fieldset div p {padding:0px;margin:0px;} +/*form.openid input[type='submit'] {margin-left:1em;}*/ +#openid_username {background:#ffffa0;} +#openid_url {background:#ffffa0;} + +.openid_logo{color:#F7931E;padding:6px 0px 8px 28px; +background: url(images/openidico.png) no-repeat; +} + +#openid_login {float:left; width:30%; margin:2em 1em; text-align:center} +#openid_login div{margin-top:0.5em} -- cgit v1.2.3-1-g7c22