changeset 557:7247a406f92b

Merging change to requirements.txt made on production server.
author Brian Neal <bgneal@gmail.com>
date Sun, 29 Jan 2012 14:45:09 -0600
parents 70722b7d10af (diff) c094c43ec99f (current diff)
children 9a68fd3bd8a5
files
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/forums/models.py	Thu Jan 26 22:44:45 2012 -0600
+++ b/gpp/forums/models.py	Sun Jan 29 14:45:09 2012 -0600
@@ -256,6 +256,22 @@
     def search_summary(self):
         return u''
 
+    def ogp_tags(self):
+        """
+        Returns a dict of Open Graph Protocol meta tags.
+
+        """
+        desc = 'Forum topic created by %s on %s.' % (
+            self.user.username,
+            self.creation_date.strftime('%B %d, %Y'))
+
+        return {
+            'og:title': self.name,
+            'og:type': 'article',
+            'og:url': self.get_absolute_url(),
+            'og:description': desc,
+        }
+
 
 class Post(models.Model):
     """
--- a/gpp/templates/forums/topic.html	Thu Jan 26 22:44:45 2012 -0600
+++ b/gpp/templates/forums/topic.html	Sun Jan 29 14:45:09 2012 -0600
@@ -1,7 +1,11 @@
 {% extends 'base.html' %}
 {% load url from future %}
 {% load forum_tags %}
+{% load core_tags %}
 {% block title %}Forums: {{ topic.name }}{% endblock %}
+{% block custom_meta %}
+   {% open_graph_meta_tags topic %}
+{% endblock %}
 {% block custom_js %}
    {{ form.media }}
    {% include "forums/jump_box.js" %}