An open source, stand-alone, customisable public spending data web app.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

69 рядки
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. %p
  32. A service in the
  33. %a{ :href => '/directorates/' + @service.directorate.slug }
  34. = @service.directorate.name
  35. Directorate
  36. %p.noprint
  37. %a{ :href => "/services/#{@service.slug}" }
  38. « Suppliers by Spend summary for
  39. = @service.name
  40. %p.noprint.download
  41. %a{ :href => "/services/#{@service.slug}/payments.csv" }
  42. Download data as CSV
  43. .noprint
  44. %p.filter
  45. Show payments over
  46. - for v in @FILTER_VALUES
  47. - @min.to_i == v.to_i ? klass = "filter_selected" : klass = ""
  48. %a{ :href => '#', :id => "min" + v.to_s, :class => klass }
  49. = "£" + commify(v)
  50.   
  51. %img.spinner{ :src => "/spinner.gif" } <!-- Thanks, http://ajaxload.info/ -->
  52. #payments= haml :servicepaymentsdetail, :layout => false
  53. .clear
  54. .grid_9.noprint
  55. = haml_partial "disqus_comments"