Anton Shestakov avatar Anton Shestakov committed 11c4242

Added disqus_shortname to app settings.

Comments (0)

Files changed (4)

             static_path=self.rel('static'),
             nsf_path=self.rel('static/nsf'),
             shots_path=self.rel('static/shots'),
+            disqus_shortname='nsfdelivery',
             ui_modules=uimodules,
             xsrf_cookies=False,
             debug=options.debug

nsfdelivery/uimodules.py

 class DisqusThread(UIModule):
     @memoize()
     def render(self, filename):
-        return self.render_string('disqus/thread.html', filename=filename)
+        disqus_shortname = self.handler.application.settings['disqus_id']
+        return self.render_string('disqus/thread.html', disqus_shortname=disqus_shortname, filename=filename)
 
 
 class DisqusCount(UIModule):
     @memoize()
     def render(self):
-        return self.render_string('disqus/count.html')
+        disqus_shortname = self.handler.application.settings['disqus_id']
+        return self.render_string('disqus/count.html', disqus_shortname=disqus_shortname)
 
 
 class DeliveryTimer(UIModule):

templates/disqus/count.html

 <script type="text/javascript">
     /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
-    var disqus_shortname = 'nsfdelivery'; // required: replace example with your forum shortname
+    var disqus_shortname = '{{ disqus_shortname }}'; // required: replace example with your forum shortname
 
     /* * * DON'T EDIT BELOW THIS LINE * * */
     (function () {

templates/disqus/thread.html

 <div id="disqus_thread"></div>
 <script type="text/javascript">
     /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
-    var disqus_shortname = 'nsfdelivery'; // required: replace example with your forum shortname
+    var disqus_shortname = '{{ disqus_shortname }}'; // required: replace example with your forum shortname
     var disqus_identifier = '{{ filename }}';
 
     /* * * DON'T EDIT BELOW THIS LINE * * */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.