index.html.erb 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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, remote: true, class: "btn bold green pull-right" do %> Nuevo Vendedor <i class="fa fa-plus"></i> <% end %>
  49. <% end %>
  50. </div>
  51. </div>
  52. <div class="portlet-body">
  53. <table class="table table-striped table-bordered table-hover tableadvanced">
  54. <thead>
  55. <tr>
  56. <th>#</th>
  57. <th>Nombre</th>
  58. <th>Apellido</th>
  59. <% if current_user.usertype == "A" || current_user.usertype == "SS" %>
  60. <th>Punto de venta</th>
  61. <% end %>
  62. <th>Status</th>
  63. <th width="15%">Acciones</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <% @sellers.each_with_index do |seller, key| %>
  68. <tr>
  69. <td><%= key + 1 %></td>
  70. <td><%= seller.name %></td>
  71. <td><%= seller.last_name %></td>
  72. <% if current_user.usertype == "A" || current_user.usertype == "SS" %>
  73. <td> <%= seller.pointsale.name %> </td>
  74. <% end %>
  75. <td>
  76. <% if seller.status == "inactive" %>
  77. <i class='fa fa-times fa-2 font-red'></i>
  78. <% else %>
  79. <i class='fa fa-check fa-2 font-green'></i>
  80. <% end %>
  81. </td>
  82. <td>
  83. <% if can? :update, Seller %>
  84. <%= link_to edit_seller_path(seller), remote: true, class: "btn btn-icon-only btn-primary", title: "Editar vendedor" do %>
  85. <i class="fa fa-edit"></i>
  86. <% end %>
  87. <% if seller.active? %>
  88. <%= 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 %>
  89. <i class="fa fa-toggle-off"></i>
  90. <% end %>
  91. <% elsif seller.inactive? %>
  92. <%= 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 %>
  93. <i class="fa fa-toggle-on"></i>
  94. <% end %>
  95. <% end %>
  96. <% end %>
  97. <% if can? :destroy, Seller %>
  98. <%= link_to seller, method: :delete, :class => "btn btn-icon-only btn-danger", title: "Eliminar vendedor", data: { confirm: '¿Esta seguro de eliminar al vendedor?'} do %>
  99. <i class="fa fa-trash-o"></i>
  100. <% end %>
  101. <% end %>
  102. </td>
  103. </tr>
  104. <% end %>
  105. </tbody>
  106. </table>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <!-- END PAGE CONTENT INNER -->
  113. </div>
  114. </div>
  115. <!-- END PAGE CONTENT BODY -->
  116. <!-- END CONTENT BODY -->
  117. </div>
  118. <!-- END CONTENT -->
  119. </div>
  120. <!-- END CONTAINER -->