Guest User

Untitled

a guest
Jul 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.49 KB | None | 0 0
  1. <div class="page-header">
  2.     <h1>Index of post</h1>
  3. </div>
  4.  
  5. <div class="row">
  6.     <div class="span12">
  7.         <p><%- link_to('<i class="icon-plus icon-white"></i> New post', path_to.new_post, {class: 'btn btn-primary'}) %></>
  8.     </div>
  9. </div>
  10.  
  11. <div class="row">
  12.     <div class="span12">
  13.         <% if (posts.length > 0) { %>
  14.             <table class="table table-striped">
  15.                 <thead>
  16.                     <tr>
  17.                         <th>ID</th>
  18.                         <th>Actions</th>
  19.                     </tr>
  20.                 </thead>
  21.                 <tbody>
  22.                     <% posts.forEach(function (post) { %>
  23.                         <tr>
  24.                             <td><strong><%- link_to('post #' + post.id, path_to.post(post)) %></strong></td>
  25.                             <td>
  26.                                 <%- link_to('<i class="icon-edit"></i> Edit', path_to.edit_post(post), {class: 'btn btn-mini'}) %>
  27.                                 <%- link_to('<i class="icon-remove icon-white"></i> Delete', path_to.post(post), {class: 'btn btn-mini btn-danger', method: 'delete', remote: true, jsonp: '(function (u) {location.href = u;})'}) %>
  28.                             </td>
  29.                         </tr>
  30.                     <% }); %>
  31.                 </tbody>
  32.             </table>
  33.         <% } else { %>
  34.             <p class="alert alert-block alert-info">
  35.                 <strong>No posts were found.</strong>
  36.             </p>
  37.         <% } %>
  38.     </div>
  39. </div>
Add Comment
Please, Sign In to add comment