Skip to content

Commit

Permalink
refctoring disqus and adding it to the flatpages default
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Álvarez committed Apr 29, 2016
1 parent 643b4f4 commit cd33d47
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
19 changes: 19 additions & 0 deletions votai_general_theme/templates/disqus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% load votainteligente_extras %}
{% if 'enabled'|disqus and 'shortname'|disqus %}
<div class="disqus">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ 'shortname'|disqus }}'; // required: replace example with your forum shortname
var disqus_developer = {{ 'dev_mode'|disqus }};
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
{% endif %}
22 changes: 2 additions & 20 deletions votai_general_theme/templates/elections/candidate_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,7 @@ <h3>{% trans "Cuestionario" %} {% if not candidate.has_answered %}{% no_ha_respo
{% endfor %}
</div>
{% endif %}

{% if 'enabled'|disqus and 'shortname'|disqus %}
<div class="disqus">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ 'shortname'|disqus }}'; // required: replace example with your forum shortname
var disqus_developer = {{ 'dev_mode'|disqus }};
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
{% endif %}
{% include 'disqus.html' %}
<script type="text/javascript">
var API_KEY = '{{ 'client_id'|website_imgur }}';
var candidate_name = '{{candidate.name}}';
Expand All @@ -182,4 +164,4 @@ <h3>{% trans "Cuestionario" %} {% if not candidate.has_answered %}{% no_ha_respo

$('.pop-fuente').popover();
});
{% endblock extrajs %}
{% endblock extrajs %}
1 change: 1 addition & 0 deletions votai_general_theme/templates/flatpages/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<h2>{{ flatpage.title }}</h2>
{{ flatpage.content|markdown }}
</div>
{% include 'disqus.html' %}
</div>
{% endblock content %}

0 comments on commit cd33d47

Please sign in to comment.