@Master['admin/admin-layout']

@Section['Content']
  <div class="row">
    <p><a class="btn btn-primary" href="/page/new/edit"><i class="fa fa-plus"></i> &nbsp; @Translate.AddNew</a></p>
  </div>
  <div class="row">
    <table class="table table-hover">
      <tr>
        <th>@Translate.Title</th>
        <th>@Translate.LastUpdated</th>
      </tr>
      @Each.Pages
        <tr>
          <td>
            @Current.Page.Title<br />
            <a href="/@Current.Page.Permalink">@Translate.View</a> &nbsp;
            <a href="/page/@Current.Page.Id/edit">@Translate.Edit</a> &nbsp;
            <a href="javascript:void(0)" onclick="deletePage('@Current.Page.Id', '@Current.Page.Title')">@Translate.Delete</a>
          </td>
          <td>@Current.UpdatedDate<br />@Translate.at @Current.UpdatedTime</td>
        </tr>
      @EndEach
    </table>
  </div>
  <form method="delete" id="deleteForm">
    @AntiForgeryToken
  </form>
@EndSection

@Section['Scripts']
  <script type="text/javascript">
    /* <![CDATA[ */
    function deletePage(id, title) {
      if (confirm('@Translate.PageDeleteWarning "' + title + '"?')) {
        document.getElementById("deleteForm").action = "/page/" + id + "/delete"
        document.getElementById("deleteForm").submit()
      }
    }
    /* ]] */
  </script>
@EndSection
