An open source, stand-alone, customisable public spending data web app.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

70 lignes
2.1 KiB

  1. :javascript
  2. function getPayments(min, objj) {
  3. $('.spinner').show()
  4. $.get("/services/#{@service.slug}/paymentsdetail", { min: min }, function(data) {
  5. $('#payments').html(data);
  6. $('.spinner').hide()
  7. $('.filter a').removeClass('filter_selected');
  8. $(objj).addClass('filter_selected');
  9. $.cookie("payments_filter_min", min, { expires: 60, path: '/' }); /* expires in n days */
  10. });
  11. }
  12. $(function(){
  13. $('#min500').click(function() { getPayments(500, $(this)); return false; });
  14. $('#min1000').click(function() { getPayments(1000, $(this)); return false; });
  15. $('#min2500').click(function() { getPayments(2500, $(this)); return false; });
  16. $('#min5000').click(function() { getPayments(5000, $(this)); return false; });
  17. $('#min10000').click(function() { getPayments(10000, $(this)); return false; });
  18. $('#min20000').click(function() { getPayments(20000, $(this)); return false; });
  19. });
  20. .grid_12
  21. %ul#breadcrumb
  22. %li.home
  23. %a{ :href => '/'} Home
  24. %li
  25. %a{ :href => '/services' } Services
  26. %li
  27. %a{ :href => "/services/#{@service.slug}" }
  28. = @service.name
  29. %li Payments to Suppliers
  30. %h2= @page_title = "#{@service.name}: Payments to Suppliers"
  31. - unless @service.directorate.nil?
  32. %p
  33. A service in the
  34. %a{ :href => '/directorates/' + @service.directorate.slug }
  35. = @service.directorate.name
  36. Directorate
  37. %p.noprint
  38. %a{ :href => "/services/#{@service.slug}" }
  39. « Suppliers by Spend summary for
  40. = @service.name
  41. %p.noprint.download
  42. %a{ :href => "/services/#{@service.slug}/payments.csv" }
  43. Download data as CSV
  44. .noprint
  45. %p.filter
  46. Show payments over
  47. - for v in @FILTER_VALUES
  48. - @min.to_i == v.to_i ? klass = "filter_selected" : klass = ""
  49. %a{ :href => '#', :id => "min" + v.to_s, :class => klass }
  50. = "£" + commify(v)
  51.   
  52. %img.spinner{ :src => "/spinner.gif" } <!-- Thanks, http://ajaxload.info/ -->
  53. #payments= haml :servicepaymentsdetail, :layout => false
  54. .clear
  55. .grid_9.noprint
  56. = haml_partial "disqus_comments"