gitlabhq/app/views/issues/index.html.haml

90 lines
2.9 KiB
Plaintext
Raw Normal View History

2012-01-28 00:49:14 +01:00
.issues_content
2012-01-28 10:54:11 +01:00
%h3
Issues
%span.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"
2012-01-28 10:54:11 +01:00
- if can? current_user, :write_issue, @project
= link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do
New Issue
2012-02-26 21:06:40 +01:00
%br
2012-02-18 13:12:48 +01:00
%div#issues-table-holder.ui-box
.title
.row
.span8
%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
2012-01-28 00:49:14 +01:00
2012-02-18 13:12:48 +01:00
.span3.right
= 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' }
= hidden_field_tag :status, params[:f]
= search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
%ul#issues-table.unstyled
= render "issues"
- if @issues.blank?
%li
%p.padded Nothing to show here
2012-01-28 00:49:14 +01:00
2011-10-08 23:36:38 +02:00
:javascript
var href = $('.issue_search').parent().attr('action');
var last_terms = '';
2011-10-22 06:06:38 +02:00
$('.issue_search').keyup(function() {
var terms = $(this).val();
var project_id = $('#project_id').val();
2012-01-29 23:43:14 +01:00
var status = $('#status').val();
if (terms != last_terms) {
last_terms = terms;
2011-10-22 06:06:38 +02:00
if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) {
2012-01-29 11:04:09 +01:00
$('#issues-table').html(response);
setSortable();
});
}
2011-10-22 06:06:38 +02:00
}
});
$('.delete-issue').live('ajax:success', function() {
2011-10-27 17:18:50 +02:00
$(this).closest('tr').fadeOut(); updatePage();});
2011-10-15 18:56:53 +02:00
function setSortable(){
2012-01-29 11:04:09 +01:00
$('#issues-table').sortable({
2011-10-15 18:56:53 +02:00
axis: 'y',
dropOnEmpty: false,
handle: '.handle',
cursor: 'crosshair',
items: 'tr',
opacity: 0.4,
scroll: true,
update: function(){
$.ajax({
type: 'post',
2012-01-29 11:04:09 +01:00
data: $('#issues-table').sortable('serialize'),
2011-10-15 18:56:53 +02:00
dataType: 'script',
complete: function(request){
2012-01-29 11:04:09 +01:00
$('#issues-table').effect('highlight');
2011-10-15 18:56:53 +02:00
},
url: "#{sort_project_issues_path(@project)}"})
}
});
}
$(function(){
setSortable();
});