From 8d5cdaba23e11f47a3f1afbb64a260e8eaf30a5f Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Thu, 9 Sep 2010 23:06:38 +0100 Subject: [PATCH] Added disqus_shortname to settings and moved all Disqus code to the _disquus_comments partial --- lib/models.rb | 1 + views/_comment_header.haml | 7 ------- views/_disqus_comments.haml | 18 ++++++++++++++++++ views/payment.haml | 17 +++-------------- views/service.haml | 18 +++--------------- views/servicepayments.haml | 17 +++-------------- views/supplier.haml | 17 +++-------------- 7 files changed, 31 insertions(+), 64 deletions(-) delete mode 100644 views/_comment_header.haml create mode 100644 views/_disqus_comments.haml diff --git a/lib/models.rb b/lib/models.rb index cc23ab8..00084d2 100644 --- a/lib/models.rb +++ b/lib/models.rb @@ -122,6 +122,7 @@ class Setting property :org_name, String, :length => 255 property :org_url, String, :length => 255 property :data_url, String, :length => 255 + property :disqus_shortname, String, :length => 255 end DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3") diff --git a/views/_comment_header.haml b/views/_comment_header.haml deleted file mode 100644 index 41db0ab..0000000 --- a/views/_comment_header.haml +++ /dev/null @@ -1,7 +0,0 @@ -.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. \ No newline at end of file diff --git a/views/_disqus_comments.haml b/views/_disqus_comments.haml new file mode 100644 index 0000000..ac1b0bd --- /dev/null +++ b/views/_disqus_comments.haml @@ -0,0 +1,18 @@ +%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 ed29ffc..ccbfc4f 100644 --- a/views/payment.haml +++ b/views/payment.haml @@ -24,17 +24,6 @@ %td Amount £ %td= commify(sprintf("%0.2f", @payment.amount)) .clear -
-= haml_partial "comment_header" -
- - -Comments powered by Disqus -
\ No newline at end of file + +.grid_9.noprint + = haml_partial "disqus_comments" \ No newline at end of file diff --git a/views/service.haml b/views/service.haml index f54fe26..a3e3d23 100644 --- a/views/service.haml +++ b/views/service.haml @@ -67,18 +67,6 @@ %td.right= sprintf("%0.1f", row['total'] / @total * 100) .clear -
-= haml_partial "comment_header" -
- - -Comments powered by Disqus -
- \ No newline at end of file + +.grid_9.noprint + = haml_partial "disqus_comments" \ No newline at end of file diff --git a/views/servicepayments.haml b/views/servicepayments.haml index dfc0464..ac1fee8 100644 --- a/views/servicepayments.haml +++ b/views/servicepayments.haml @@ -64,17 +64,6 @@ .clear -
-= haml_partial "comment_header" -
- - -Comments powered by Disqus -
+.grid_9.noprint + = haml_partial "disqus_comments" + \ No newline at end of file diff --git a/views/supplier.haml b/views/supplier.haml index 82dc793..8c2d0a8 100644 --- a/views/supplier.haml +++ b/views/supplier.haml @@ -72,17 +72,6 @@ %td.right= commify(sprintf("%0d", @total)) .clear -
-= haml_partial "comment_header" -
- - -Comments powered by Disqus -
\ No newline at end of file + +.grid_9.noprint + = haml_partial "disqus_comments" \ No newline at end of file