2012-01-18 21:15:45 +01:00
|
|
|
= render "issues/head"
|
2011-12-19 22:32:59 +01:00
|
|
|
- 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
|
2012-01-18 21:15:45 +01:00
|
|
|
= image_tag "Rss-UI.PNG", :width => 22, :title => "feed"
|
2011-12-19 22:32:59 +01:00
|
|
|
|
2011-11-07 17:31:05 +01:00
|
|
|
%div#issues-table-holder
|
2012-01-17 23:04:27 +01:00
|
|
|
.top_panel_issues
|
2012-01-21 22:17:29 +01:00
|
|
|
= form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :right, :id => "issue_search_form" do
|
2012-01-17 23:04:27 +01:00
|
|
|
= hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
|
|
|
|
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
|
|
|
|
|
2012-01-21 22:17:29 +01:00
|
|
|
.left.issues_filter
|
2012-01-17 23:04:27 +01:00
|
|
|
= form_tag project_issues_path(@project), :method => :get do
|
|
|
|
.left
|
|
|
|
= radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "setIssueFilter(this.form, 0)", :id => "open_issues", :class => "status"
|
2012-01-21 22:17:29 +01:00
|
|
|
= label_tag "open_issues" do
|
|
|
|
%span.tag.open Open
|
2012-01-17 23:04:27 +01:00
|
|
|
.left
|
|
|
|
= radio_button_tag :f, 2, params[:f] == "2", :onclick => "setIssueFilter(this.form, 2)", :id => "closed_issues", :class => "status"
|
2012-01-21 22:17:29 +01:00
|
|
|
= label_tag "closed_issues" do
|
|
|
|
%span.tag.closed Closed
|
2012-01-17 23:04:27 +01:00
|
|
|
.left
|
|
|
|
= radio_button_tag :f, 3, params[:f] == "3", :onclick => "setIssueFilter(this.form, 3)", :id => "my_issues", :class => "status"
|
|
|
|
= label_tag "my_issues","To Me"
|
|
|
|
.left
|
|
|
|
= radio_button_tag :f, 1, params[:f] == "1", :onclick => "setIssueFilter(this.form, 1)", :id => "all_issues", :class => "status"
|
|
|
|
= label_tag "all_issues","All"
|
2011-10-08 23:36:38 +02:00
|
|
|
|
2012-01-17 23:04:27 +01:00
|
|
|
.clear
|
|
|
|
%hr
|
|
|
|
%table.no-borders#issues-table
|
2011-11-07 17:31:05 +01:00
|
|
|
= render "issues"
|
2011-10-08 23:36:38 +02:00
|
|
|
%br
|
|
|
|
:javascript
|
2011-10-26 02:15:11 +02:00
|
|
|
var href = $('.issue_search').parent().attr('action');
|
|
|
|
var last_terms = '';
|
|
|
|
|
2011-11-07 13:12:46 +01:00
|
|
|
var setIssueFilter = function(form, value){
|
|
|
|
$.cookie('issue_filter', value, { expires: 140 });
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
|
2011-10-22 06:06:38 +02:00
|
|
|
$('.issue_search').keyup(function() {
|
2011-10-26 02:15:11 +02:00
|
|
|
var terms = $(this).val();
|
|
|
|
var project_id = $('#project_id').val();
|
|
|
|
var status = $('.status:checked').val();
|
|
|
|
if (terms != last_terms) {
|
|
|
|
last_terms = terms;
|
2011-10-22 06:06:38 +02:00
|
|
|
|
2011-10-26 02:15:11 +02:00
|
|
|
if (terms.length >= 2 || terms.length == 0) {
|
|
|
|
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
|
2011-11-07 17:31:05 +01:00
|
|
|
$('#issues-table tbody').html(response);
|
2011-10-26 02:15:11 +02:00
|
|
|
setSortable();
|
|
|
|
});
|
|
|
|
}
|
2011-10-22 06:06:38 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
$('.delete-issue').live('ajax:success', function() {
|
2011-10-27 17:18:50 +02:00
|
|
|
$(this).closest('tr').fadeOut(); updatePage();});
|
2011-10-26 15:46:25 +02:00
|
|
|
|
2011-10-15 18:56:53 +02:00
|
|
|
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();
|
|
|
|
});
|