Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. <% include ../layout/head %>
  2. <%if(query.created=="true"){%>
  3. <div id="successAlert" class="alert alert-success">¡Super! Se creó la Categoría</div>
  4. <script>
  5. setTimeout(() => {
  6. document.getElementById("successAlert").style.display = 'none'
  7. }, 2000)
  8. </script>
  9. <%}%>
  10. <%if(query.deleted=="true"){%>
  11. <div id="successAlert" class="alert alert-success">La categoría se eliminó</div>
  12. <script>
  13. setTimeout(() => {
  14. document.getElementById("successAlert").style.display = 'none'
  15. }, 2000)
  16. </script>
  17. <%}%>
  18. <%if(query.updated=="true"){%>
  19. <div id="successAlert" class="alert alert-success">La categoría se actualizó correctamente</div>
  20. <script>
  21. setTimeout(() => {
  22. document.getElementById("successAlert").style.display = 'none'
  23. }, 2000)
  24. </script>
  25. <%}%>
  26.  
  27. <div class="container">
  28. <div class="row">
  29. <!-- FORM -->
  30. <div class="col-md-4">
  31. <h2>Crear Categoría</h2>
  32. <div class="card">
  33. <div class="card-body">
  34.  
  35. <form action="/categories" method="post">
  36. <div class="form-group">
  37. <label for="exampleFormControlInput1">Category Name</label>
  38. <input name="category_name" type="text" class="form-control" id="exampleFormControlInput1"
  39. placeholder="Entretainment">
  40. </div>
  41. <div class="form-group">
  42. <label for="exampleFormControlInput1">Icon Name (see react native icons)</label>
  43. <input name="icon_name" type="text" class="form-control" id="exampleFormControlInput1"
  44. placeholder="umbrella">
  45. </div>
  46. <div class="form-group">
  47. <label for="exampleFormControlSelect1">Icon Family</label>
  48. <select name="icon_type" class="form-control" id="exampleFormControlSelect1">
  49. <Option>AntDesign</Option>
  50. <Option>Ionicons</Option>
  51. <Option>Entypo</Option>
  52. <Option>EvilIcons</Option>
  53. <Option>Feather</Option>
  54. <Option>FontAwesome</Option>
  55. <Option>FontAwesome5</Option>
  56. <Option>Foundation</Option>
  57. <Option>MaterialIcons</Option>
  58. <Option>MaterialCommunityIcons</Option>
  59. <Option>Octicons</Option>
  60. <Option>Roboto</Option>
  61. <Option>rubicon-icon-font</Option>
  62. <Option>SimpleLineIcons</Option>
  63. <Option>Zocial</Option>
  64. </select>
  65. </div>
  66. <button type="submit" class="btn btn-block btn-primary">
  67. Insertar
  68. </button>
  69. </form>
  70.  
  71. </div>
  72. </div>
  73. </div>
  74. <div class="col-md-8">
  75. <table class="table table-bordered table-hover">
  76. <thead>
  77. <tr>
  78. <th>Category Name</th>
  79. <th>Icon Name</th>
  80. <th>Icon Type</th>
  81. <th>Opciones</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <% categories.forEach(cat=>{ %>
  86. <tr>
  87. <td> <%= cat.category_name %> </td>
  88. <td> <%= cat.icon_name %> </td>
  89. <td> <%= cat.icon_type %> </td>
  90. <td>
  91. <a href="/categories/delete/<%=cat._id%>" data-confirmation="Estás seguro?" class="btn btn-danger">Delete</a>
  92. <a href="/categories/edit/<%=cat._id%>" class="btn btn-info">Edit</a>
  93. </td>
  94. </tr>
  95. <% }) %>
  96.  
  97. </tbody>
  98. <tfoot>
  99. </tfoot>
  100. </table>
  101. </div>
  102. </div>
  103. </div>
  104. <% include ../layout/foot %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement