# HG changeset patch # User Brian Neal # Date 1327869909 21600 # Node ID 7247a406f92b0df272720b939f1439ccc578cb2d # Parent 70722b7d10af2bb36397cbc4304eef0530851c73# Parent c094c43ec99f3e83b48e901df51004130fa1fd29 Merging change to requirements.txt made on production server. diff -r c094c43ec99f -r 7247a406f92b gpp/forums/models.py --- 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): """ diff -r c094c43ec99f -r 7247a406f92b gpp/templates/forums/topic.html --- 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" %}