Commit 651e46fd225cfc4b9e99e674e116411b7b4c0aec
1 parent
864745a4
Exists in
master
and in
1 other branch
button added to show/hide all errs per app
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
app/controllers/apps_controller.rb
... | ... | @@ -10,7 +10,13 @@ class AppsController < ApplicationController |
10 | 10 | def show |
11 | 11 | respond_to do |format| |
12 | 12 | format.html do |
13 | - @errs = @app.errs.ordered.paginate(:page => params[:page], :per_page => current_user.per_page) | |
13 | + if(params[:all_errs]) | |
14 | + @errs = @app.errs.ordered.paginate(:page => params[:page], :per_page => current_user.per_page) | |
15 | + @all_errs = true | |
16 | + else | |
17 | + @errs = @app.errs.unresolved.ordered.paginate(:page => params[:page], :per_page => current_user.per_page) | |
18 | + @all_errs = false | |
19 | + end | |
14 | 20 | @deploys = @app.deploys.order_by(:created_at.desc).limit(5) |
15 | 21 | end |
16 | 22 | format.atom do | ... | ... |
app/views/apps/show.html.haml
... | ... | @@ -12,6 +12,10 @@ |
12 | 12 | - if current_user.admin? |
13 | 13 | = link_to 'edit', edit_app_path(@app), :class => 'button' |
14 | 14 | = link_to 'destroy', app_path(@app), :method => :delete, :confirm => 'Seriously?', :class => 'button' |
15 | + - if @all_errs == true | |
16 | + = link_to 'unresolved errs', app_path(@app), :class => 'button' | |
17 | + - else | |
18 | + = link_to 'all errs', app_path(@app, {all_errs: true}), :class => 'button' | |
15 | 19 | |
16 | 20 | %h3 Watchers |
17 | 21 | %table.watchers | ... | ... |