h1 Expenses list .row.expenses .col-md-4 ul.nav.nav-pills.nav-stacked - for state in %w(submited new accepted refused canceled) li class=("active" if params[:state] == state) a href=expense_gun.url_for(state: state) = state.capitalize span.badge.pull-right = @all_expenses.where(state: state).count li class=("active" if params[:state] == "all") a href=expense_gun.url_for(state: "all") = "All" span.badge.pull-right = @all_expenses.count hr p = link_to "New expense", expense_gun.new_expense_path, class: "btn btn-success" .col-md-8 - for expense in @expenses .panel.panel-default .panel-heading .row .col-md-8 h2.panel-title = expense.name .col-md-4 .date = expense.date .panel-body .row: .col-md-6 p strong = "Employee :" = expense.user.full_name if expense.respond_to?(:user) p strong = "State :" = expense.current_state.capitalize p strong = "Total all taxes :" = "#{expense.total_all_taxes} €" .panel-footer = link_to "Show", expense_gun.expense_path(expense), class: "btn btn-default" - if can? :edit, expense = link_to "Edit", expense_gun.edit_expense_path(expense), class: "btn btn-default" - if can? :submit, expense = link_to "Submit", expense_gun.submit_expense_path(expense), data: {method: "patch"}, class: "btn btn-primary" - if can? :accept, expense = link_to "Accept", expense_gun.accept_expense_path(expense), data: {method: "patch"}, class: "btn btn-success" - if can? :refuse, expense = link_to "Refuse", expense_gun.refuse_expense_path(expense), data: {method: "patch"}, class: "btn btn-danger" - if can? :cancel, expense = link_to "Cancel", expense_gun.cancel_expense_path(expense), data: {method: "patch"}, class: "btn btn-warning" == paginate @expenses, theme: "bootstrap3"