Browse Source

Use built-in Sinatra partials

master
Adrian Short 9 years ago
parent
commit
4f45755c4e
6 changed files with 24 additions and 32 deletions
  1. +0
    -1
      app.rb
  2. +20
    -18
      views/_disqus_comments.haml
  3. +1
    -3
      views/payment.haml
  4. +1
    -3
      views/service.haml
  5. +1
    -4
      views/servicepayments.haml
  6. +1
    -3
      views/supplier.haml

+ 0
- 1
app.rb View File

@@ -1,5 +1,4 @@
require 'sinatra'
# require 'sinatra-helpers/haml/partials'
require 'tilt/haml'
require 'data_mapper'
require './models'


+ 20
- 18
views/_disqus_comments.haml View File

@@ -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>

+ 1
- 3
views/payment.haml View File

@@ -28,6 +28,4 @@
%td Amount &pound;
%td= commify(sprintf("%0.2f", @payment.amount))
.clear

.grid_9.noprint
= haml_partial "disqus_comments"
= haml :_disqus_comments

+ 1
- 3
views/service.haml View File

@@ -68,6 +68,4 @@
%td.right= sprintf("%0.1f", row['total'] / @total * 100)
.clear

.grid_9.noprint
= haml_partial "disqus_comments"
= haml :_disqus_comments

+ 1
- 4
views/servicepayments.haml View File

@@ -64,7 +64,4 @@
#payments= haml :servicepaymentsdetail, :layout => false
.clear

.grid_9.noprint
= haml_partial "disqus_comments"
= haml :_disqus_comments

+ 1
- 3
views/supplier.haml View File

@@ -75,6 +75,4 @@
%td.right= commify(sprintf("%0d", @total))
.clear

.grid_9.noprint
= haml_partial "disqus_comments"
= haml :_disqus_comments

Loading…
Cancel
Save