Skip to content

Commit

Permalink
Some small tweaks.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@597 0cfe37f9-358a-4d5e-be75-b63607b5c754
  • Loading branch information
hernani committed Sep 23, 2010
1 parent 3401cb7 commit 40e2851
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
9 changes: 8 additions & 1 deletion forum/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def __unicode__(self):
@classmethod
def _generate_cache_key(cls, key, group="node"):
return super(Node, cls)._generate_cache_key(key, group)

@classmethod
def get_type(cls):
return cls.__name__.lower()
Expand Down Expand Up @@ -283,6 +283,13 @@ def nis(self):

return nis

@property
def last_activity(self):
try:
return self.actions.order_by('-action_date')[0].action_date
except:
return self.last_seen

@property
def state_list(self):
return [s.state_type for s in self.states.all()]
Expand Down
2 changes: 1 addition & 1 deletion forum/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from forum.models import Question
from django.conf import settings

class QuestionsSitemap(Sitemap):
class OsqaSitemap(Sitemap):
changefreq = 'daily'
priority = 0.5
def items(self):
Expand Down
6 changes: 4 additions & 2 deletions forum/skins/default/templates/question.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
{% load cache %}
{% block metadescription %}{{question.summary}}{% endblock %}
{% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}
{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
{% block forejs %}
{% block meta %}
<link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">
{% endblock %}
{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}
{% block forejs %}
{% if not question.nis.closed %}
<script type='text/javascript' src='{% media "/media/js/wmd/showdown.js" %}'></script>
<script type='text/javascript' src='{% media "/media/js/wmd/wmd.js" %}'></script>
Expand Down
2 changes: 1 addition & 1 deletion forum/skins/default/templates/questions.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block title %}{% spaceless %}{{ page_title }}{% endspaceless %}{% endblock %}

{% block forejs %}
{% block meta %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ feed_url }}">
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions forum/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from django.conf import settings as djsettings
from django.contrib import admin
from forum import views as app
from forum.sitemap import QuestionsSitemap
from forum.sitemap import OsqaSitemap
from django.utils.translation import ugettext as _
import logging

admin.autodiscover()

sitemaps = {
'questions': QuestionsSitemap
'questions': OsqaSitemap
}

APP_PATH = os.path.dirname(__file__)
Expand Down

0 comments on commit 40e2851

Please sign in to comment.