index.html.erb 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!-- BEGIN CONTAINER -->
  2. <div class="page-container">
  3. <!-- BEGIN CONTENT -->
  4. <div class="page-content-wrapper">
  5. <!-- BEGIN CONTENT BODY -->
  6. <!-- BEGIN PAGE HEAD-->
  7. <div class="page-head">
  8. <div class="container-fluid">
  9. <!-- BEGIN PAGE TITLE -->
  10. <div class="page-title">
  11. <h1>Vendedores</h1>
  12. </div>
  13. <!-- END PAGE TITLE -->
  14. </div>
  15. </div>
  16. <!-- END PAGE HEAD-->
  17. <!-- BEGIN PAGE CONTENT BODY -->
  18. <div class="page-content">
  19. <div class="container-fluid">
  20. <!-- BEGIN PAGE BREADCRUMBS -->
  21. <ul class="page-breadcrumb breadcrumb">
  22. <%= render_breadcrumbs :tag => :li, :separator => ' <i class="fa fa-circle"></i> ' %>
  23. </ul>
  24. <!-- END PAGE BREADCRUMBS -->
  25. <!-- BEGIN PAGE CONTENT INNER -->
  26. <div class="page-content-inner">
  27. <div id="notice">
  28. <% if success %>
  29. <div class="alert alert-success">
  30. <p><%= success %></p>
  31. </div>
  32. <% elsif warning %>
  33. <div class="alert alert-warning">
  34. <p><%= warning %></p>
  35. </div>
  36. <% end %>
  37. </div>
  38. <div class="row">
  39. <div class="col-md-12">
  40. <div class="portlet light ">
  41. <div class="portlet-title">
  42. <div class="caption">
  43. <i class="fa fa-list "></i>
  44. <span class="caption-subject bold uppercase">Lista de vendedores</span>
  45. </div>
  46. <div class="actions">
  47. <% if can? :create, Seller %>
  48. <%= link_to new_seller_path, {:class=>"btn bold green pull-right filtros"} do %> Nuevo Vendedor <i class="fa fa-plus"></i>
  49. <% end %>
  50. <% end %>
  51. </div>
  52. </div>
  53. <div class="portlet-body">
  54. <input type='hidden' name='filter' id='filter' value='<%= @filter %>' >
  55. <input type='hidden' name='current_page' id='current_page' value='<%= @current_page %>' >
  56. <table class="table table-striped table-bordered table-hover tableadvanced">
  57. <thead>
  58. <tr>
  59. <th>#</th>
  60. <th>Nombre</th>
  61. <th>Apellido</th>
  62. <% if current_user.usertype == "A" %>
  63. <th>Punto de venta</th>
  64. <% end %>
  65. <th>Status</th>
  66. <th width="15%">Acciones</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <% @sellers.each_with_index do |seller, key| %>
  71. <tr>
  72. <td><%= key + 1 %></td>
  73. <td><%= seller.name %></td>
  74. <td><%= seller.last_name %></td>
  75. <% if current_user.usertype == "A" %>
  76. <td> <%= seller.pointsale.name %> </td>
  77. <% end %>
  78. <td>
  79. <% if seller.status == "inactive" %>
  80. <i class='fa fa-times fa-2 font-red'></i>
  81. <% else %>
  82. <i class='fa fa-check fa-2 font-green'></i>
  83. <% end %>
  84. </td>
  85. <td>
  86. <% if can? :update, Seller %>
  87. <%= link_to edit_seller_path(seller), {:class=>"btn btn-icon-only btn-primary filtros", :title=>"Editar vendedor"} do %>
  88. <i class="fa fa-edit"></i>
  89. <% end %>
  90. <% if seller.active? %>
  91. <%= link_to seller_update_status_path(seller), :class=>"btn btn-icon-only default", :title=>"Desactivar vendedor", data: { confirm: '¿Esta seguro de desactivar el vendedor?', method: 'post'} do %>
  92. <i class="fa fa-toggle-off"></i>
  93. <% end %>
  94. <% elsif seller.inactive? %>
  95. <%= link_to seller_update_status_path(seller), :class=>"btn btn-icon-only green-jungle", :title=>"Activar vendedor", data: { confirm: '¿Esta seguro de activar el vendedor?', method: 'post'} do %>
  96. <i class="fa fa-toggle-on"></i>
  97. <% end %>
  98. <% end %>
  99. <% end %>
  100. <% if can? :destroy, Seller %>
  101. <%= link_to seller , method: :delete, :class => "btn btn-icon-only btn-danger", :title=>"Eliminar vendedor", data: { confirm: '¿Esta seguro de eliminar al vendedor?'} do %>
  102. <i class="fa fa-trash-o"></i>
  103. <% end %>
  104. <% end %>
  105. </td>
  106. </tr>
  107. <% end %>
  108. </tbody>
  109. </table>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <!-- END PAGE CONTENT INNER -->
  116. </div>
  117. </div>
  118. <!-- END PAGE CONTENT BODY -->
  119. <!-- END CONTENT BODY -->
  120. </div>
  121. <!-- END CONTENT -->
  122. </div>
  123. <!-- END CONTAINER -->