- if can? current_user, :write_issue, @project = content_for :sidebar_top_block do - if current_user.can_create_project? .alert-message.block-message.error You are able to create an issue. Click on button to add a new one = link_to new_project_issue_path(@project), :class => "btn small", :title => "New Issue", :remote => true do New Issue - if current_user.private_token = content_for :rss_icon do .rss-icon = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do = image_tag "Rss-UI.PNG", :width => 22, :title => "feed" .issues_content %h3 Issues %hr %div#issues-table-holder %ul.pills.left %li{:class => ("active" if (params[:f] == "0" || !params[:f]))} = link_to project_issues_path(@project, :f => 0) do Open %li{:class => ("active" if params[:f] == "2")} = link_to project_issues_path(@project, :f => 2) do Closed %li{:class => ("active" if params[:f] == "3")} = link_to project_issues_path(@project, :f => 3) do To Me %li{:class => ("active" if params[:f] == "1")} = link_to project_issues_path(@project, :f => 1) do All = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } %table#issues-table= render "issues" :javascript var href = $('.issue_search').parent().attr('action'); var last_terms = ''; $('.issue_search').keyup(function() { var terms = $(this).val(); var project_id = $('#project_id').val(); var status = $('.status:checked').val(); if (terms != last_terms) { last_terms = terms; if (terms.length >= 2 || terms.length == 0) { $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { $('#issues-table tbody').html(response); setSortable(); }); } } }); $('.delete-issue').live('ajax:success', function() { $(this).closest('tr').fadeOut(); updatePage();}); 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(); });