diff --git a/app.rb b/app.rb index def99ea..8d675af 100644 --- a/app.rb +++ b/app.rb @@ -1,5 +1,4 @@ require 'sinatra' -# require 'sinatra-helpers/haml/partials' require 'tilt/haml' require 'data_mapper' require './models' diff --git a/views/_disqus_comments.haml b/views/_disqus_comments.haml index ac1b0bd..3c7c05b 100644 --- a/views/_disqus_comments.haml +++ b/views/_disqus_comments.haml @@ -1,18 +1,20 @@ -%h3 Comments -%p.highlight - This is an independent website. - %a{ :href => "#{SETTING.org_url}" }< - = SETTING.org_name - might not see your comments here or reply to them. - -<div id="disqus_thread" class="noprint"></div> -<script type="text/javascript"> -var disqus_developer = 1; -(function() { -var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; -dsq.src = "http://#{SETTING.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=#{SETTING.disqus_shortname}">comments powered by Disqus.</a></noscript> -<a href="http://disqus.com" class="dsq-brlink noprint">Comments powered by <span class="logo-disqus">Disqus</span></a> +- if SETTING.disqus_shortname > '' + .grid_9.noprint + %h3 Comments + %p.highlight + This is an independent website. + %a{ :href => "#{SETTING.org_url}" }< + = SETTING.org_name + might not see your comments here or reply to them. + + <div id="disqus_thread" class="noprint"></div> + <script type="text/javascript"> + var disqus_developer = 1; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = "http://#{SETTING.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=#{SETTING.disqus_shortname}">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink noprint">Comments powered by <span class="logo-disqus">Disqus</span></a> diff --git a/views/payment.haml b/views/payment.haml index 8c9ce5f..2fb77ae 100644 --- a/views/payment.haml +++ b/views/payment.haml @@ -28,6 +28,4 @@ %td Amount £ %td= commify(sprintf("%0.2f", @payment.amount)) .clear - -.grid_9.noprint - = haml_partial "disqus_comments" \ No newline at end of file += haml :_disqus_comments diff --git a/views/service.haml b/views/service.haml index 0b16a90..a5f58e7 100644 --- a/views/service.haml +++ b/views/service.haml @@ -68,6 +68,4 @@ %td.right= sprintf("%0.1f", row['total'] / @total * 100) .clear - -.grid_9.noprint - = haml_partial "disqus_comments" \ No newline at end of file += haml :_disqus_comments diff --git a/views/servicepayments.haml b/views/servicepayments.haml index 311a609..7658ef6 100644 --- a/views/servicepayments.haml +++ b/views/servicepayments.haml @@ -64,7 +64,4 @@ #payments= haml :servicepaymentsdetail, :layout => false .clear - -.grid_9.noprint - = haml_partial "disqus_comments" - \ No newline at end of file += haml :_disqus_comments diff --git a/views/supplier.haml b/views/supplier.haml index a4d75a1..cc96143 100644 --- a/views/supplier.haml +++ b/views/supplier.haml @@ -75,6 +75,4 @@ %td.right= commify(sprintf("%0d", @total)) .clear - -.grid_9.noprint - = haml_partial "disqus_comments" \ No newline at end of file += haml :_disqus_comments