|
- :javascript
- function getPayments(min, objj) {
- $('.spinner').show()
- $.get("/services/#{@service.slug}/paymentsdetail", { min: min }, function(data) {
- $('#payments').html(data);
- $('.spinner').hide()
- $('.filter a').removeClass('filter_selected');
- $(objj).addClass('filter_selected');
- $.cookie("payments_filter_min", min, { expires: 60, path: '/' }); /* expires in n days */
- });
- }
-
- $(function(){
- $('#min500').click(function() { getPayments(500, $(this)); return false; });
- $('#min1000').click(function() { getPayments(1000, $(this)); return false; });
- $('#min2500').click(function() { getPayments(2500, $(this)); return false; });
- $('#min5000').click(function() { getPayments(5000, $(this)); return false; });
- $('#min10000').click(function() { getPayments(10000, $(this)); return false; });
- $('#min20000').click(function() { getPayments(20000, $(this)); return false; });
- });
-
- .grid_12
- %ul#breadcrumb
- %li.home
- %a{ :href => '/'} Home
- %li
- %a{ :href => '/services' } Services
- %li
- %a{ :href => "/services/#{@service.slug}" }
- = @service.name
- %li Payments to Suppliers
-
- %h2= @page_title = "#{@service.name}: Payments to Suppliers"
-
- - unless @service.directorate.nil?
- %p
- A service in the
- %a{ :href => '/directorates/' + @service.directorate.slug }
- = @service.directorate.name
- Directorate
-
- %p.noprint
- %a{ :href => "/services/#{@service.slug}" }
- « Suppliers by Spend summary for
- = @service.name
-
- %p.noprint.download
- %a{ :href => "/services/#{@service.slug}/payments.csv" }
- Download data as CSV
-
- .noprint
- %p.filter
- Show payments over
-
- - for v in @FILTER_VALUES
- - @min.to_i == v.to_i ? klass = "filter_selected" : klass = ""
- %a{ :href => '#', :id => "min" + v.to_s, :class => klass }
- = "£" + commify(v)
-
-
- %img.spinner{ :src => "/spinner.gif" } <!-- Thanks, http://ajaxload.info/ -->
-
-
- #payments= haml :servicepaymentsdetail, :layout => false
-
- .clear
- = haml :_disqus_comments
|