Skip to content

Commit

Permalink
Moves the myopenid logo to a big button, and the aol logo to a small …
Browse files Browse the repository at this point in the history
…button in the default authentication set.

Makes some other small tweaks and fixes.

git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@570 0cfe37f9-358a-4d5e-be75-b63607b5c754
  • Loading branch information
hernani committed Aug 25, 2010
1 parent 4553492 commit 77c7fb4
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
6 changes: 5 additions & 1 deletion forum/actions/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class AskAction(NodeEditAction):
verb = _("asked")

def process_data(self, **data):
question = Question(author=self.user, **self.create_revision_data(True, **data))
processed_data = self.create_revision_data(True, **data)
if 'added_at' in data:
processed_data['added_at'] = data['added_at']

question = Question(author=self.user, **processed_data)
question.save()
self.node = question

Expand Down
11 changes: 7 additions & 4 deletions forum/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,15 @@ def summary(self):
def get_revisions_url(self):
return ('revisions', (), {'id': self.id})

def update_last_activity(self, user, save=False):
def update_last_activity(self, user, save=False, time=None):
if not time:
time = datetime.datetime.now()

self.last_activity_by = user
self.last_activity_at = datetime.datetime.now()
self.last_activity_at = time

if self.parent:
self.parent.update_last_activity(user, save=True)
self.parent.update_last_activity(user, save=True, time=time)

if save:
self.save()
Expand Down Expand Up @@ -378,7 +381,7 @@ def save(self, *args, **kwargs):
super(BaseModel, self).save(*args, **kwargs)
self.active_revision = self._create_revision(self.author, 1, title=self.title, tagnames=self.tagnames,
body=self.body)
self.update_last_activity(self.author)
self.update_last_activity(self.author, time=self.added_at)

if self.parent_id and not self.abs_parent_id:
self.abs_parent = self.parent.absolute_parent
Expand Down
Binary file modified forum/skins/default/media/images/openid/aol.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added forum/skins/default/media/images/openid/aol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions forum/skins/default/templates/osqaadmin/djstyle_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="{{ settings.ADMIN_MEDIA_PREFIX }}css/base.css" type="text/css"/>
<link rel="stylesheet" href="{{ settings.ADMIN_MEDIA_PREFIX }}css/forms.css" type="text/css"/>
<link rel="stylesheet" href="{{ settings.ADMIN_MEDIA_PREFIX }}css/changelists.css" type="text/css"/>
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{{ settings.ADMIN_MEDIA_PREFIX }}css/ie.css" /><![endif]-->
<link rel="stylesheet" type="text/css" media="screen" href="{% media "/media/style/djstyle_admin.css" %}"/>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion forum_modules/localauth/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def process_authentication_request(self, request):
raise InvalidAuthentication(" ".join(form_auth.errors.values()[0]))

class LocalAuthContext(ConsumerTemplateContext):
mode = 'STACK_ITEM'
mode = 'STACK_ITEM'
weight = 1000
human_name = 'Local authentication'
stack_item_template = 'modules/localauth/loginform.html'
Expand Down
12 changes: 6 additions & 6 deletions forum_modules/openidauth/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def get_user_url(self, request):
return 'http://openid.aol.com/' + uname

class AolAuthContext(ConsumerTemplateContext):
mode = 'BIGICON'
mode = 'SMALLICON'
type = 'SIMPLE_FORM'
simple_form_context = {
'your_what': 'AOL screen name'
}
weight = 400
weight = 200
human_name = 'AOL'
icon = '/media/images/openid/aol.gif'
icon = '/media/images/openid/aol.png'


class MyOpenIdAuthConsumer(OpenIdAbstractAuthConsumer):
Expand All @@ -56,14 +56,14 @@ def get_user_url(self, request):
return "http://%s.myopenid.com/" % blog_name

class MyOpenIdAuthContext(ConsumerTemplateContext):
mode = 'SMALLICON'
mode = 'BIGICON'
type = 'SIMPLE_FORM'
simple_form_context = {
'your_what': 'MyOpenID user name'
}
weight = 200
weight = 400
human_name = 'MyOpenID'
icon = '/media/images/openid/myopenid.png'
icon = '/media/images/openid/myopenid_big.png'


class FlickrAuthConsumer(OpenIdAbstractAuthConsumer):
Expand Down

0 comments on commit 77c7fb4

Please sign in to comment.