From ccfbbd7f183538e96df76d82b2f4081fcc119b1f Mon Sep 17 00:00:00 2001 From: hrcerqueira Date: Sun, 7 Mar 2010 23:41:26 +0000 Subject: Lots of small fixes, including the missing comments problem. --- .idea/workspace.xml | 232 ++++++++------------- forum/badges/__init__.py | 10 + forum/badges/base.py | 11 + forum/management/commands/sximport.py | 109 ++++++++++ forum/models/__init__.py | 12 +- forum/models/base.py | 10 +- forum/models/meta.py | 8 +- forum/modules.py | 1 - forum/skins/default/media/style/style.css | 3 - .../default/templates/authopenid/changeemail.html | 88 -------- .../default/templates/authopenid/changeopenid.html | 35 ---- .../default/templates/authopenid/changepw.html | 18 -- .../default/templates/authopenid/complete.html | 130 ------------ .../default/templates/authopenid/confirm_email.txt | 13 -- .../skins/default/templates/authopenid/delete.html | 39 ---- .../templates/authopenid/email_validation.txt | 15 -- .../authopenid/external_legacy_login_info.html | 15 -- .../default/templates/authopenid/failure.html | 14 -- .../skins/default/templates/authopenid/sendpw.html | 26 --- .../default/templates/authopenid/sendpw_email.txt | 9 - .../default/templates/authopenid/settings.html | 43 ---- .../skins/default/templates/authopenid/signin.html | 186 ----------------- .../skins/default/templates/authopenid/signup.html | 32 --- .../skins/default/templates/authopenid/yadis.xrdf | 14 -- forum/skins/default/templates/index.html | 2 +- forum/views/auth.py | 1 + forum_modules/facebookauth/views.py | 2 +- settings.py | 3 +- settings_local.py.dist | 3 + 29 files changed, 244 insertions(+), 840 deletions(-) create mode 100755 forum/badges/__init__.py create mode 100755 forum/badges/base.py create mode 100755 forum/management/commands/sximport.py delete mode 100644 forum/skins/default/templates/authopenid/changeemail.html delete mode 100644 forum/skins/default/templates/authopenid/changeopenid.html delete mode 100644 forum/skins/default/templates/authopenid/changepw.html delete mode 100644 forum/skins/default/templates/authopenid/complete.html delete mode 100644 forum/skins/default/templates/authopenid/confirm_email.txt delete mode 100644 forum/skins/default/templates/authopenid/delete.html delete mode 100644 forum/skins/default/templates/authopenid/email_validation.txt delete mode 100644 forum/skins/default/templates/authopenid/external_legacy_login_info.html delete mode 100644 forum/skins/default/templates/authopenid/failure.html delete mode 100644 forum/skins/default/templates/authopenid/sendpw.html delete mode 100644 forum/skins/default/templates/authopenid/sendpw_email.txt delete mode 100644 forum/skins/default/templates/authopenid/settings.html delete mode 100755 forum/skins/default/templates/authopenid/signin.html delete mode 100644 forum/skins/default/templates/authopenid/signup.html delete mode 100644 forum/skins/default/templates/authopenid/yadis.xrdf diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0fe5d429..f4717294 100755 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -24,6 +24,7 @@ + @@ -41,8 +42,10 @@ + + @@ -58,8 +61,10 @@ + + @@ -85,7 +90,6 @@ - @@ -98,10 +102,12 @@ + + @@ -119,12 +125,14 @@ + + @@ -177,8 +185,11 @@ + + + @@ -220,6 +231,7 @@ + @@ -231,7 +243,6 @@ - @@ -241,6 +252,7 @@ + @@ -249,11 +261,12 @@ + - + @@ -270,11 +283,15 @@ + + + + @@ -291,6 +308,7 @@ + @@ -318,9 +336,12 @@ + + + @@ -384,28 +405,19 @@ - - - - - - - - - - - + + - + - - + + - + @@ -414,52 +426,25 @@ - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -475,22 +460,22 @@ @@ -549,20 +534,6 @@ @@ -715,11 +672,12 @@ - + + @@ -850,7 +808,7 @@ - @@ -1005,114 +963,100 @@ - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/forum/badges/__init__.py b/forum/badges/__init__.py new file mode 100755 index 00000000..5ed245af --- /dev/null +++ b/forum/badges/__init__.py @@ -0,0 +1,10 @@ +import re + +from forum.badges.base import BadgeImplementation +from forum.modules import get_modules_script_classes + +ALL_BADGES = dict([ + (re.sub('BadgeImpl', '', name).lower(), cls) for name, cls + in get_modules_script_classes('badges', BadgeImplementation).items() + if not re.search('AbstractBadgeImpl$', name) + ]) \ No newline at end of file diff --git a/forum/badges/base.py b/forum/badges/base.py new file mode 100755 index 00000000..154d4dfd --- /dev/null +++ b/forum/badges/base.py @@ -0,0 +1,11 @@ + + +class BadgeImplementation(object): + name = "" + description = "" + + def install(self): + pass + + def process_job(self): + raise NotImplementedError \ No newline at end of file diff --git a/forum/management/commands/sximport.py b/forum/management/commands/sximport.py new file mode 100755 index 00000000..5a0bb96a --- /dev/null +++ b/forum/management/commands/sximport.py @@ -0,0 +1,109 @@ +from django.core.management.base import LabelCommand +from zipfile import ZipFile +from xml.dom import minidom as dom +import datetime + +from forum.models import User + +class Command(LabelCommand): + def handle_label(self, label, **options): + zip = ZipFile(label) + + map = {} + + map['users'] = self.import_users(zip.open("Users.xml")) + map['questions'], map['answers'] = self.import_posts(zip.open("Posts.xml")) + + + def row_to_dic(self, row): + return dict([ + (child.localName.lower(), + " ".join([t.nodeValue for t in child.childNodes if t.nodeType == t.TEXT_NODE])) + for child in row.childNodes + if child.nodeType == child.ELEMENT_NODE + ]) + + def from_sx_time(self, timestring): + if timestring is None: + return timestring + + try: + return datetime.datetime.strptime(timestring, '%Y-%m-%dT%H:%M:%S') + except: + return datetime.datetime.strptime(timestring, '%Y-%m-%dT%H:%M:%S.%f') + + + def import_users(self, users): + pkey_map = {} + doc = dom.parse(users) + + rows = doc.getElementsByTagName('row') + unknown_count = 0 + + added_names = [] + + for row in rows: + values = self.row_to_dic(row) + + username = values.get('displayname', + values.get('realname', + values.get('email', None))) + + if username is None: + unknown_count += 1 + username = 'Unknown User %d' % unknown_count + + if username in added_names: + cnt = 1 + new_username = "%s %d" % (username, cnt) + while new_username in added_names: + cnt += 1 + new_username = "%s %d" % (username, cnt) + + username = new_username + + added_names.append(username) + + user = User(username=username, email=values.get('email', '')) + + user.reputation = values['reputation'] + user.last_seen = self.from_sx_time(values['lastaccessdate']) + + user.real_name = values.get('realname', '') + user.about = values.get('aboutme', '') + user.website = values.get('websiteurl', '') + user.date_of_birth = self.from_sx_time(values.get('birthday', None)) + user.location = values.get('location', '') + + user.is_active = True + user.email_isvalid = True + + + if int(values['usertypeid']) == 5: + user.is_superuser = True + + if int(values['usertypeid']) == 5: + user.is_staff = True + + user.save() + + pkey_map[values['id']] = user + + return users + + def import_posts(self, posts, map): + pkey_map = {} + doc = dom.parse(posts) + + rows = doc.getElementsByTagName('row') + + for row in rows: + map = { + 'title': row[''] + } + + pass + pass + + + diff --git a/forum/models/__init__.py b/forum/models/__init__.py index 09f5627f..01086213 100755 --- a/forum/models/__init__.py +++ b/forum/models/__init__.py @@ -122,9 +122,9 @@ def record_answer_event(instance, created, **kwargs): if created: q_author = instance.question.author found_match = False - print 'going through %d messages' % q_author.message_set.all().count() + #print 'going through %d messages' % q_author.message_set.all().count() for m in q_author.message_set.all(): - print m.message + #print m.message match = record_answer_event_re.search(m.message) if match: found_match = True @@ -134,15 +134,15 @@ def record_answer_event(instance, created, **kwargs): cnt = 1 m.message = u"You have received %d new responses."\ % (cnt+1, q_author.get_profile_url()) - print 'updated message' - print m.message + #print 'updated message' + #print m.message m.save() break if not found_match: msg = u"You have received a new response."\ % q_author.get_profile_url() - print 'new message' - print msg + #print 'new message' + #print msg q_author.message_set.create(message=msg) activity = Activity(user=instance.author, \ diff --git a/forum/models/base.py b/forum/models/base.py index 657f1e2f..2a8f3df9 100755 --- a/forum/models/base.py +++ b/forum/models/base.py @@ -19,6 +19,13 @@ import logging from forum.const import * +class UserContent(models.Model): + user = models.ForeignKey(User, related_name='%(class)ss') + + class Meta: + abstract = True + app_label = 'forum' + class MetaContent(models.Model): """ Base class for Vote, Comment and FlaggedItem @@ -26,7 +33,6 @@ class MetaContent(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey('content_type', 'object_id') - user = models.ForeignKey(User, related_name='%(class)ss') class Meta: abstract = True @@ -117,7 +123,7 @@ class Content(models.Model): except Exception: logging.debug('problem pinging google did you register you sitemap with google?') - def get_object_comments(self): + def get_comments(self): comments = self.comments.all().order_by('id') return comments diff --git a/forum/models/meta.py b/forum/models/meta.py index 7c3f5d36..af4a9f3d 100755 --- a/forum/models/meta.py +++ b/forum/models/meta.py @@ -22,7 +22,7 @@ class VoteManager(models.Manager): return 0 -class Vote(MetaContent): +class Vote(MetaContent, UserContent): VOTE_UP = +1 VOTE_DOWN = -1 VOTE_CHOICES = ( @@ -57,7 +57,7 @@ class FlaggedItemManager(models.Manager): else: return 0 -class FlaggedItem(MetaContent): +class FlaggedItem(MetaContent, UserContent): """A flag on a Question or Answer indicating offensive content.""" flagged_at = models.DateTimeField(default=datetime.datetime.now) @@ -70,7 +70,7 @@ class FlaggedItem(MetaContent): def __unicode__(self): return '[%s] flagged at %s' %(self.user, self.flagged_at) -class Comment(MetaContent): +class Comment(MetaContent, UserContent): comment = models.CharField(max_length=300) added_at = models.DateTimeField(default=datetime.datetime.now) @@ -86,4 +86,4 @@ class Comment(MetaContent): logging.debug('problem pinging google did you register you sitemap with google?') def __unicode__(self): - return self.comment \ No newline at end of file + return self.comment diff --git a/forum/modules.py b/forum/modules.py index f786c719..6c9a9dba 100755 --- a/forum/modules.py +++ b/forum/modules.py @@ -54,7 +54,6 @@ def get_all_handlers(name): def get_handler(name, default): all = get_all_handlers(name) - print(len(all)) return len(all) and all[0] or default module_template_re = re.compile('^modules\/(\w+)\/(.*)$') diff --git a/forum/skins/default/media/style/style.css b/forum/skins/default/media/style/style.css index 02148ab0..4f6b366b 100755 --- a/forum/skins/default/media/style/style.css +++ b/forum/skins/default/media/style/style.css @@ -1,8 +1,5 @@ @import url(jquery.autocomplete.css); -@import url(openid.css); -@import url(prettify.css); -/* 公用 */ body { background: #FFF; font-size: 12px; diff --git a/forum/skins/default/templates/authopenid/changeemail.html b/forum/skins/default/templates/authopenid/changeemail.html deleted file mode 100644 index 94d1881c..00000000 --- a/forum/skins/default/templates/authopenid/changeemail.html +++ /dev/null @@ -1,88 +0,0 @@ -{% extends "base_content.html" %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Change email" %}{% endspaceless %}{% endblock %} -{% block content %} - -{% ifequal action_type "change" %} -
- {% if user.email %} - {% trans "Change email" %} - {% else %} - {% trans "Save your email address" %} - {% endif %} -
-

- {% if user.email %} - {% blocktrans %}change {{email}} info{% endblocktrans %} - {% else %} - {% blocktrans %}here is why email is required, see {{gravatar_faq_url}}{% endblocktrans %} - {% endif %} -

- {% if msg %} -

{{ msg }}

- {% endif %} - -
-
- {% if next %} - - {% endif %} -
- - {% if form.email.errors %} -

{{form.email.errors|join:", "}}

- {% endif %} - {{ form.email }} -
-
- - {% if user.email %} - - {% endif %} -
- -
-
-{% endifequal %} -{% ifequal action_type "validate" %} -
- {% trans "Validate email" %} -
-

- {% blocktrans %}validate {{email}} info or go to {{change_email_url}}{% endblocktrans %} -

-{% endifequal %} -{% ifequal action_type "keep" %} -
- {% trans "Email not changed" %} -
-

- {% blocktrans %}old {{email}} kept, if you like go to {{change_email_url}}{% endblocktrans %} -

-{% endifequal %} -{% ifequal action_type "done_novalidate" %} -
- {% trans "Email changed" %} -
-

- {% blocktrans %}your current {{email}} can be used for this{% endblocktrans %} -

-{% endifequal %} -{% ifequal action_type "validation_complete" %} -
- {% trans "Email verified" %} -
-

- {% trans "thanks for verifying email" %} -

-{% endifequal %} -{% ifequal action_type "key_not_sent" %} -
- {% trans "email key not sent" %} -
-

- {% blocktrans %}email key not sent {{email}} change email here {{change_link}}{% endblocktrans %} -

-{% endifequal %} -{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/changeopenid.html b/forum/skins/default/templates/authopenid/changeopenid.html deleted file mode 100644 index d01788fb..00000000 --- a/forum/skins/default/templates/authopenid/changeopenid.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Change OpenID" %}{% endspaceless %}{% endblock %} -{% block content %} -
-

- {% trans "Account: change OpenID URL" %} -

-
- -

{% blocktrans %}This is where you can change your OpenID URL. Make sure you remember it!{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
- {% if form.openid_url.errors %} - {{ form.openid_url.errors|join:", " }} - {% endif %} - - -

-{% endif %} -{% if msg %} -

{{ msg }}

-{% endif %} - -
-
- -
{{ form.openid_url }}
-

- -
-
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/changepw.html b/forum/skins/default/templates/authopenid/changepw.html deleted file mode 100644 index 8b059544..00000000 --- a/forum/skins/default/templates/authopenid/changepw.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% block head %}{% endblock %} -{% block title %}{% spaceless %}{% trans "Change password" %}{% endspaceless %}{% endblock %} -{% block content %} -
{% trans "Account: change password" %}
-

{% blocktrans %}This is where you can change your password. Make sure you remember it!{% endblocktrans %}

-
-
-
    - {{form.as_ul}} -
-
-
-
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/complete.html b/forum/skins/default/templates/authopenid/complete.html deleted file mode 100644 index 62970e38..00000000 --- a/forum/skins/default/templates/authopenid/complete.html +++ /dev/null @@ -1,130 +0,0 @@ -{% extends "base_content.html" %} - -{% comment %} -views calling this template: -* django_authopenid.views.register with login_type='openid' -* django_authopenid.views.signin - with login_type='legacy' - -parameters: -* provider -* login_type openid|legacy -* username (same as screen name or username in the models, and nickname in openid sreg) -* form1 - OpenidRegisterForm -* form2 - OpenidVerifyForm not clear what this form is supposed to do, not used for legacy -* email_feeds_form forum.forms.SimpleEmailSubscribeForm -* openid_username_exists -{% endcomment %} -{% load i18n %} -{% block head %}{% endblock %} -{% block title %}{% spaceless %}{% trans "Connect your OpenID with this site" %}{% endspaceless %}{% endblock %} -{% block content %} -
- {% trans "Connect your OpenID with your account on this site" %} -
-
-
- {% ifequal login_type 'openid' %} - {% blocktrans %}register new {{provider}} account info, see {{gravatar_faq_url}}{% endblocktrans %} - {% else %} - {% ifequal login_type 'legacy' %} - {% if external_login_name_is_taken %} - {% blocktrans %}{{username}} already exists, choose another name for - {{provider}}. Email is required too, see {{gravatar_faq_url}} - {% endblocktrans %} - {% else %} - {% blocktrans %}register new external {{provider}} account info, see {{gravatar_faq_url}}{% endblocktrans %} - {% endif %} - {% else %} - {% blocktrans %}register new Facebook connect account info, see {{gravatar_faq_url}}{% endblocktrans %} - {% endifequal %} - {% endifequal %} -
-

{% trans "This account already exists, please use another." %}

-
- - {% if form1.errors %} -
    - {% if form1.non_field_errors %} - {% for error in form1.non_field_errors %} -
  • {{error}}
  • - {% endfor %} - {% endif %} -
- {% endif %} - {% comment %} - {% if form2.errors %} -
- {% trans "Sorry, looks like we have some errors:" %}
-
    - {% if form2.username.errors %} -
  • {{ form2.username.errors|join:", " }}
  • - {% endif %} - {% if form2.password.errors %} -
  • {{ form2.password.errors|join:", " }}
  • - {% endif %} -
-
- {% endif %} - {% endcomment %} - - - {% comment %} - {% if form2 %} - - {% endif %} - {% endcomment %} -{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/confirm_email.txt b/forum/skins/default/templates/authopenid/confirm_email.txt deleted file mode 100644 index 3a01f146..00000000 --- a/forum/skins/default/templates/authopenid/confirm_email.txt +++ /dev/null @@ -1,13 +0,0 @@ -{% load i18n %} -{% trans "Thank you for registering at our Q&A forum!" %} - -{% trans "Your account details are:" %} - -{% trans "Username:" %} {{ username }} -{% trans "Password:" %} {{ password }} - -{% trans "Please sign in here:" %} -{{signup_url}} - -{% blocktrans %}Sincerely, -Forum Administrator{% endblocktrans %} diff --git a/forum/skins/default/templates/authopenid/delete.html b/forum/skins/default/templates/authopenid/delete.html deleted file mode 100644 index 0f9f1c60..00000000 --- a/forum/skins/default/templates/authopenid/delete.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Delete account" %}{% endspaceless %}{% endblock %} -{% block content %} -
-

- {% trans "Account: delete account" %} -

-
- -

{% blocktrans %}Note: After deleting your account, anyone will be able to register this username.{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
- {% if form.confirm.errors %} - {% trans "Check confirm box, if you want delete your account." %}
- {% endif %} - {% if form.password.errors %} - {% trans "Password:" %} {{ form.password.errors|join:", " }} - {% endif %} -

-{% endif %} -{% if msg %} -

{% trans "Please correct errors below:" %}
- {{ msg }} -

-{% endif %} -
-
- -
{{ form.confirm }} {% trans "I am sure I want to delete my account." %}
-
{{ form.password }} {% trans "(required for your security)" %}
- -

- -
-
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/email_validation.txt b/forum/skins/default/templates/authopenid/email_validation.txt deleted file mode 100644 index 5b166a9b..00000000 --- a/forum/skins/default/templates/authopenid/email_validation.txt +++ /dev/null @@ -1,15 +0,0 @@ -{% 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/forum/skins/default/templates/authopenid/external_legacy_login_info.html b/forum/skins/default/templates/authopenid/external_legacy_login_info.html deleted file mode 100644 index 3318499c..00000000 --- a/forum/skins/default/templates/authopenid/external_legacy_login_info.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends "base_content.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Traditional login information" %}{% endspaceless %}{% endblock %} -{% block content %} -
- {% trans "Traditional login information" %} -
-{% spaceless %} -
- -{% blocktrans %}how to login with password through external login website or use {{feedback_url}}{% endblocktrans %} -
-{% endspaceless %} -{% endblock %} diff --git a/forum/skins/default/templates/authopenid/failure.html b/forum/skins/default/templates/authopenid/failure.html deleted file mode 100644 index d075d6b0..00000000 --- a/forum/skins/default/templates/authopenid/failure.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - OpenID failed - - -

OpenID failed

- -

{{ message|escape }}

- - - diff --git a/forum/skins/default/templates/authopenid/sendpw.html b/forum/skins/default/templates/authopenid/sendpw.html deleted file mode 100644 index 6241c811..00000000 --- a/forum/skins/default/templates/authopenid/sendpw.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Send new password" %}{% endspaceless %}{% endblock %} -{% block content %} -
- {% trans "Send new password" %} -
-

-{% trans "password recovery information" %} -

-{% if msg %} -

{{msg}}

-{% endif %} - -

-
-
    - {{form.as_ul}} -
-

- {% trans "return to login" %}

-
-
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/sendpw_email.txt b/forum/skins/default/templates/authopenid/sendpw_email.txt deleted file mode 100644 index f044ca45..00000000 --- a/forum/skins/default/templates/authopenid/sendpw_email.txt +++ /dev/null @@ -1,9 +0,0 @@ -{% load i18n %} -{% blocktrans%}Someone has requested to reset your password on {{site_url}}. -If it were not you, it is safe to ignore this email.{% endblocktrans %} - -{% blocktrans %}email explanation how to use new {{password}} for {{username}} -with the {{key_link}}{% endblocktrans %} - -{% blocktrans %}Sincerely, -Forum Administrator{% endblocktrans %} diff --git a/forum/skins/default/templates/authopenid/settings.html b/forum/skins/default/templates/authopenid/settings.html deleted file mode 100644 index 66ea5953..00000000 --- a/forum/skins/default/templates/authopenid/settings.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "base_content.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Account functions" %}{% endspaceless %}{% endblock %} -{% block head %} - -{% endblock %} - -{% block content %} -
-

{{ request.user.username }} {% trans "Profile" %}

-
-
- {% if msg %} -

{{ msg }}

- {% endif %} - -
-
» {% trans "Change password" %}
-
{% trans "Give your account a new password." %}
-
» {% trans "Change email " %}
-
{% trans "Add or update the email address associated with your account." %}
- {% if is_openid %} -
» {% trans "Change OpenID" %}
-
{% trans "Change openid associated to your account" %}
- {% endif %} - -
» {% trans "Delete account" %}
-
{% trans "Erase your username and all your data from website" %}
-
-
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/signin.html b/forum/skins/default/templates/authopenid/signin.html deleted file mode 100755 index 4e060d0f..00000000 --- a/forum/skins/default/templates/authopenid/signin.html +++ /dev/null @@ -1,186 +0,0 @@ -{% extends "base.html" %} - -{% load i18n %} -{% load extra_tags %} -{% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %} -{% block forejs %} - - - - - - -{% endblock %} -{% block content %} -
- {% trans "User login" %} -
- {% if msg %} -

{{ msg }}

- {% endif %} - {% if answer %} -
- {% blocktrans with answer.question.title as title and answer.summary as summary %} - Your answer to {{title}} {{summary}} will be posted once you log in - {% endblocktrans %} -
- {% endif %} - {% if question %} -
- {% blocktrans with question.title as title and question.summary as summary %}Your question - {{title}} {{summary}} will be posted once you log in - {% endblocktrans %} -
- {% endif %} -
-
- {% trans "Click to sign in through any of these services." %} -
-
    -
  • - - -
  • -
  • -
    - iconhttps://www.google.com/accounts/o8/id -
    -
  • -
  • -
    - iconhttp://yahoo.com/ -
    -
  • -
  • -
    - iconhttp://openid.aol.com/username -
    -
  • -
-
    - - -
  • - icon - http://{your-openid-url} -
  • -
  • - icon - http://username.myopenid.com/ -
  • -
  • - icon - http://flickr.com/username/ -
  • -
  • - icon - http://technorati.com/people/technorati/username/ -
  • -
  • - icon - http://username.wordpress.com -
  • -
  • - icon - http://username.blogspot.com/ -
  • -
  • - icon - http://username.livejournal.com -
  • -
  • - icon - http://claimid.com/username -
  • -
  • - icon - http://username.myvidoop.com/ -
  • -
  • - icon - http://username.pip.verisignlabs.com/ -
  • -
- {{ form2.next }} -
-

{% trans 'Enter your Provider user name' %}

-

- - -

-
-
-

{% trans 'Enter your web address' %}

-

-

-
-
-

{% trans 'Enter your login name and password' %}

- {% if form1.errors %} - {{form1.non_field_errors.as_ul}} - {% endif %} -
- -

- - {% trans "Create account" %}
- {% trans "Forgot your password?" %} -

-
-
-
-{% endblock %} - -{% block sidebar %} -
-

{% trans "Why use OpenID?" %}

-
    -
  • - {% trans "with openid it is easier" %} -
  • -
  • - {% trans "reuse openid" %} -
  • -
  • - {% trans "openid is widely adopted" %} -
  • -
  • - {% trans "openid is supported open standard" %} -
  • - -
- -
- - -{% endblock%} - - - diff --git a/forum/skins/default/templates/authopenid/signup.html b/forum/skins/default/templates/authopenid/signup.html deleted file mode 100644 index fdb236c2..00000000 --- a/forum/skins/default/templates/authopenid/signup.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "base_content.html" %} - -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Signup" %}{% endspaceless %}{% endblock %} - -{% block content %} -
- {% trans "Create login name and password" %} -
-

{% trans "Traditional signup info" %}

-
-
    -
  • {{form.username}}{{form.username.errors}}
  • -
  • {{form.email}}{{form.email.errors}}
  • -
  • {{form.password1}}{{form.password1.errors}}
  • -
  • {{form.password2}}{{form.password2.errors}}
  • -
-

{% trans "receive updates motivational blurb" %}

-
- {{email_feeds_form.subscribe}} - {% if email_feeds_form.errors %} -

{% trans "please select one of the options above" %}

- {% endif %} -
- - {{form.recaptcha}} - -
-{% endblock %} - diff --git a/forum/skins/default/templates/authopenid/yadis.xrdf b/forum/skins/default/templates/authopenid/yadis.xrdf deleted file mode 100644 index a9ed44fe..00000000 --- a/forum/skins/default/templates/authopenid/yadis.xrdf +++ /dev/null @@ -1,14 +0,0 @@ - - - - - http://specs.openid.net/auth/2.0/return_to - {% for uri in return_to %} - {{ uri }} - {% endfor %} - - - \ No newline at end of file diff --git a/forum/skins/default/templates/index.html b/forum/skins/default/templates/index.html index eb4dc224..61a5e6b3 100755 --- a/forum/skins/default/templates/index.html +++ b/forum/skins/default/templates/index.html @@ -71,7 +71,7 @@ {% for award in awards %}
  • -  {{ award.badge_name }} {% trans "given to" %} +  {{ award.badge_name }} {{ award.user_name }}
  • {% endfor %} diff --git a/forum/views/auth.py b/forum/views/auth.py index 1b57853a..72b0af29 100644 --- a/forum/views/auth.py +++ b/forum/views/auth.py @@ -271,6 +271,7 @@ def auth_settings(request): request.user.message_set.create(message=_("Your password was changed")) else: request.user.message_set.create(message=_("New password set")) + form = ChangePasswordForm(user=user_) user_.set_password(form.cleaned_data['password1']) user_.save() diff --git a/forum_modules/facebookauth/views.py b/forum_modules/facebookauth/views.py index d1d72c5d..f77c6282 100755 --- a/forum_modules/facebookauth/views.py +++ b/forum_modules/facebookauth/views.py @@ -4,7 +4,7 @@ from django.http import HttpResponse def user_is_registered(request): try: fb_uid = request.POST['fb_uid'] - print fb_uid + #print fb_uid AuthKeyUserAssociation.objects.get(key=fb_uid) return HttpResponse('yes') except: diff --git a/settings.py b/settings.py index f9357877..a84ba4a6 100644 --- a/settings.py +++ b/settings.py @@ -5,7 +5,7 @@ import sys SITE_ID = 1 -ADMIN_MEDIA_PREFIX = '/forum/admin/media/' +ADMIN_MEDIA_PREFIX = '/admin_media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -69,6 +69,7 @@ INSTALLED_APPS = [ 'django.contrib.humanize', 'django.contrib.sitemaps', 'debug_toolbar', + #'django_evolution', 'forum', ] diff --git a/settings_local.py.dist b/settings_local.py.dist index a27946af..5651fec7 100755 --- a/settings_local.py.dist +++ b/settings_local.py.dist @@ -42,6 +42,9 @@ DATABASE_PORT = '' #CACHE_BACKEND = 'file://%s' % os.path.join(os.path.dirname(__file__),'cache').replace('\\','/') CACHE_BACKEND = 'dummy://' +#If you use memcache you may want to uncomment the following line to enable memcached based sessions +#SESSION_ENGINE = 'django.contrib.sessions.backends.cache_db' + #email server settings SERVER_EMAIL = '' DEFAULT_FROM_EMAIL = '' -- cgit v1.2.3-1-g7c22