summaryrefslogtreecommitdiff
path: root/app/views/issues/index.html.haml
blob: 6f4548a806644bc7c602a3eceacd6f1315cd3412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%div
  - if can? current_user, :write_issue, @project
    .left= link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm"
  .right
    = form_tag project_issues_path(@project), :method => :get do
      .span-2
        = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues"
        = label_tag "open_issues","Open"
      .span-2
        = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues"
        = label_tag "closed_issues","Closed"
      .span-2
        = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues"
        = label_tag "my_issues","To Me"
        
      .span-2
        = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues"
        = label_tag "all_issues","All"

  #issues-table-holder= render "issues"
  %br
:javascript
  $('.delete-issue').live('ajax:success', function() {  
    $(this).closest('tr').fadeOut(); });  
  
  function setSortable(){
    $('#issues-table>tbody').sortable({
      axis: 'y',
      dropOnEmpty: false,
      handle: '.handle',
      cursor: 'crosshair',
      items: 'tr',
      opacity: 0.4,
      scroll: true,
      update: function(){
        $.ajax({
        type: 'post',
        data: $('#issues-table>tbody').sortable('serialize'),
        dataType: 'script',
        complete: function(request){
          $('#issues-table>tbody').effect('highlight');
        },
        url: "#{sort_project_issues_path(@project)}"})
        }
      });
  }

  $(function(){
    setSortable();
  });