An open source, stand-alone, customisable public spending data web app.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

service.haml 2.5 KiB

14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
14 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .grid_12
  2. %ul#breadcrumb
  3. %li.home
  4. %a{ :href => '/'} Home
  5. %li
  6. %a{ :href => '/services' } Services
  7. %li
  8. = @service.name
  9. %h2= @page_title = @service.name
  10. %p
  11. A service in the
  12. %a{ :href => '/directorates/' + @service.directorate.slug }
  13. = @service.directorate.name
  14. Directorate
  15. %p.noprint.download
  16. %a{ :href => "/services/#{@service.slug}.csv" }
  17. Download data as CSV
  18. %p
  19. %h3 Summary
  20. %table
  21. %tr
  22. %th.right Payments
  23. %th.right Total
  24. %th.right Max
  25. %th.right Min
  26. %th.right Average
  27. %tr
  28. %td.right= @count
  29. %td.right= sprintf("£%0d", @total)
  30. %td.right= sprintf("£%0d", @max)
  31. %td.right= sprintf("£%0d", @min)
  32. %td.right= sprintf("£%0d", @avg)
  33. %p
  34. %h3 Suppliers by Spend
  35. %table
  36. %tr
  37. %th Supplier
  38. %th Total £
  39. %th Total %
  40. - for row in @results
  41. %tr
  42. %td
  43. %a{ :href => "/suppliers/#{row['supplier_slug']}" }
  44. = row['supplier_name']
  45. %td.right= sprintf("%0d", row['total'])
  46. %td.right= sprintf("%0.1f", row['total'] / @total * 100)
  47. %p
  48. %h3 Payments to Suppliers
  49. %table
  50. %tr
  51. %th Date
  52. %th Ref.
  53. %th Supplier
  54. %th.right £
  55. - for payment in @service.payments
  56. %tr
  57. %td= payment.d.strftime("%d %b %Y")
  58. %td.right
  59. %a{ :href => "/payments/#{payment.id}" }
  60. = payment.id
  61. %td
  62. %a{ :href => '/suppliers/' + payment.supplier.slug }
  63. = payment.supplier.name
  64. %td.right= sprintf("%0d", payment.amount)
  65. %tr
  66. %td
  67. %td
  68. %td
  69. %strong TOTAL
  70. %td.right= sprintf("%0d", @total)
  71. .clear
  72. <div class="grid_9 noprint">
  73. = haml_partial "comment_header"
  74. <div id="disqus_thread" class="noprint"></div>
  75. <script type="text/javascript">
  76. var disqus_developer = 1;
  77. (function() {
  78. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  79. dsq.src = 'http://armchairauditor.disqus.com/embed.js';
  80. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  81. })();
  82. </script>
  83. <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=armchairauditor">comments powered by Disqus.</a></noscript>
  84. <a href="http://disqus.com" class="dsq-brlink noprint">Comments powered by <span class="logo-disqus">Disqus</span></a>
  85. </div>