diff options
author | Azul <azul@leap.se> | 2012-11-27 10:01:07 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-27 10:01:07 +0100 |
commit | be479d2c55d502c6e4303700b68e0a619f646834 (patch) | |
tree | 1ff9e4f0db9ab9bee2d2e0f3ace5f099bff28034 /help/app/views/tickets/index.html.haml | |
parent | a8b8a7b5431f57ebcf295b8d9389d44cc3a49e8e (diff) |
bunch of refactoring for the ticket index
* using different partials for different parts of the view
* using render @tickets.all to iterate over the tickets. #all is necessary because of CouchRest Model
* using helpers for easier querying for the open_status and admin_status params
* using helper for avoiding duplication when linking to status
Diffstat (limited to 'help/app/views/tickets/index.html.haml')
-rw-r--r-- | help/app/views/tickets/index.html.haml | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/help/app/views/tickets/index.html.haml b/help/app/views/tickets/index.html.haml index 7f8fa34..fdbeec5 100644 --- a/help/app/views/tickets/index.html.haml +++ b/help/app/views/tickets/index.html.haml @@ -7,41 +7,12 @@ Create a .row .span2 - if admin? - %h4 whose tickets - %ul.nav.nav-pills.nav-stacked - %li{:class => ("active" if params[:admin_status] == 'mine')} - = link_to 'tickets i admin', {:admin_status => 'mine', :open_status => params[:open_status]} - %li{:class => ("active" if params[:admin_status] != 'mine')} - = link_to 'all tickets', {:admin_status => 'all', :open_status => params[:open_status]} + = render 'tickets/admin-nav' .span10 - .row - .span6 - %ul.nav.nav-tabs - %li{:class => ("active" if params[:open_status] != 'closed' and params[:open_status] != 'all')} - = link_to 'open issues', {:open_status => 'open', :admin_status => params[:admin_status]} - %li{:class => ("active" if params[:open_status] == 'closed')} - = link_to 'closed issues', {:open_status => 'closed', :admin_status => params[:admin_status]} - = #%a{:href => "#"} closed issue - %li{:class => ("active" if params[:open_status] == 'all')} - = link_to 'open & closed issues', {:open_status => 'all', :admin_status => params[:admin_status]} - .span4 - %ul.nav.nav-pills.pull-right - %li - = link_to 'created at' - %li{:class=> ("active" if true)} - = link_to 'updated at' - %table.table-striped.table-bordered.table-hover + = render 'tickets/table-nav' + %table.table-striped.table-bordered.table-hover{:style => "width:100%;"} %tbody - - @tickets.each do |ticket| - %tr - %td - = link_to ticket.title, ticket - created: - = ticket.created_at.to_s(:short) - updated: - = ticket.updated_at.to_s(:short) - comments by: - = ticket.commenters + = render @tickets.all = paginate @tickets %div{"data-pjax-container" => ""} |