From ace816354fb098118539640b5d9af392da349396 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 4 Sep 2012 04:13:56 -0400 Subject: [PATCH] Add toggle to show closed issues on Milestones#show --- app/assets/javascripts/milestones.js.coffee | 7 +++++++ app/assets/stylesheets/gitlab_bootstrap/tables.scss | 5 +++++ app/controllers/milestones_controller.rb | 2 +- app/views/milestones/show.html.haml | 10 ++++++---- 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 app/assets/javascripts/milestones.js.coffee diff --git a/app/assets/javascripts/milestones.js.coffee b/app/assets/javascripts/milestones.js.coffee new file mode 100644 index 0000000..f24682b --- /dev/null +++ b/app/assets/javascripts/milestones.js.coffee @@ -0,0 +1,7 @@ +$ -> + $('.milestone-issue-filter td[data-closed]').addClass('hide') + + $('.milestone-issue-filter ul.nav li a').click -> + $('.milestone-issue-filter li').toggleClass('active') + $('.milestone-issue-filter td[data-closed]').toggleClass('hide') + false diff --git a/app/assets/stylesheets/gitlab_bootstrap/tables.scss b/app/assets/stylesheets/gitlab_bootstrap/tables.scss index 2929386..b922079 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/tables.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/tables.scss @@ -11,6 +11,11 @@ table { border-bottom: 1px solid #bbb; text-shadow: 0 1px 1px #fff; @include bg-dark-gray-gradient; + + ul.nav { + text-shadow: none; + margin: 0; + } } th, td { diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb index f8fe987..fa202cf 100644 --- a/app/controllers/milestones_controller.rb +++ b/app/controllers/milestones_controller.rb @@ -30,7 +30,7 @@ class MilestonesController < ProjectResourceController end def show - @issues = @milestone.issues.opened.page(params[:page]).per(40) + @issues = @milestone.issues @users = @milestone.participants respond_to do |format| diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index d3b1c09..e255561 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -45,18 +45,20 @@ .row .span6 - %table + %table.milestone-issue-filter %thead - %th Open Issues + %th + %ul.nav.nav-pills + %li.active.open= link_to('Open Issues', '#') + %li.all=link_to('All Issues', '#') - @issues.each do |issue| %tr - %td + %td{data: {closed: issue.closed}} = link_to [@project, issue] do %span.badge.badge-info ##{issue.id} – = link_to_gfm truncate(issue.title, length: 60), [@project, issue] %br - = paginate @issues, theme: "gitlab" .span6 %table -- libgit2 0.21.2