From 4f45755c4e01ec6fd202258d8e11b40a069c1b66 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Sun, 26 Apr 2015 14:54:37 +0100 Subject: [PATCH] Use built-in Sinatra partials --- app.rb | 1 - views/_disqus_comments.haml | 38 +++++++++++++++++++------------------ views/payment.haml | 4 +--- views/service.haml | 4 +--- views/servicepayments.haml | 5 +---- views/supplier.haml | 4 +--- 6 files changed, 24 insertions(+), 32 deletions(-) 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. - -
- - -Comments powered by Disqus +- 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. + +
+ + + Comments powered by Disqus 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