if (typeof layout === 'string') {
layout = parseInt(layout);
}
- console.log(layout);
if (layout === window.admin_pages_cur_layout) {
return;
}
<h2><!--~id unset {~-->Add a new page<!--~}~--><!--~id {~-->Edit page "~title html~"<!--~}~--></h2>
+ <!--~archived_versions {~-->
+ <p><a href="admin_pages?history_page_id=~id~">View archived versions of this page</a></p>
+ <!--~}~-->
+
<form action="admin_pages" method="post"><!--~id {~--><div style="display: none"><input type="hidden" name="edit_id" value="~id attr~"></div><!--~}~-->
<div class="caption">Title</div>
<!--~listing {~-->
<h1>~$host~ Admin Control Panel</h1>
+
<h2>Manage Pages</h2>
- <!--~rows once_if {~-->
- <p><a href="admin_pages?new=1">[Add a new page]</a></p>
+ <table cellspacing="0" cellpadding="4" border="0" summary="" class="evenodd">
+ <tr>
+ <td><em>(new)</em></td>
+ <td>
+ <form style="display: inline-block" action="admin_pages"><input type="hidden" name="new" value="1"><input type="submit" value="create"></form>
+ </td>
+ </tr>
+ <!--~no_home {~-->
+ <tr>
+ <td><em>(home page)</em></td>
+ <td>
+ <form style="display: inline-block" action="admin_pages">
+ <input type="hidden" name="new" value="1">
+ <input type="hidden" name="new_filename" value="index">
+ <input type="submit" value="create"></form>
+ </td>
+ </tr>
+ <!--~}~-->
+ <!--~rows {~-->
+ <tr>
+ <td>~title html~<!--~title empty {~--><em>(untitled)</em><!--~}~--></td>
+ <td>
+ <form style="display: inline-block" action="admin_pages"><input type="hidden" name="edit_id" value="~id~"><input type="submit" value="edit"></form>
+ <form style="display: inline-block" action="admin_pages"><input type="hidden" name="history_page_id" value="~id~"><input type="submit" value="history"></form>
+ <form style="display: inline-block" action="admin_pages" onsubmit="return confirm('Permanently delete?')"><input type="hidden" name="admin_pages_delete_id" value="~id~"><input type="submit" value="delete"></form>
+ </td>
+ </tr><!--~}~-->
+
+ </table>
+ <!--~}~-->
+ <!--~page_history {~-->
+ <h1>~$host~ Admin Control Panel</h1>
+
+ <h2>Edit history for page "~title html~"</h2>
+ <!--~rows once_else {~-->
+ <p>There are no archived versions of this page.</p>
+ <!--~}~-->
+ <!--~rows once_if {~-->
<table cellspacing="0" cellpadding="4" border="0" summary="" class="evenodd">
<tr>
- <th><a href="?sort=~sorting-by-filename~filename">Filename</a></th>
- <th><a href="?sort=~sorting-by-title~title">Title</a></th>
- <th> </th>
- </tr><!--~rows {~-->
- <tr>
- <td class="listing"><a href="admin_pages?edit_id=~id~">~filename html~<!--~filename empty {~--><em>(offline)</em><!--~}~--></a></td>
- <td class="listing"><a href="admin_pages?edit_id=~id~">~title html~<!--~title empty {~--><em>(untitled)</em><!--~}~--></a></td>
- <td><a href="admin_pages?admin_pages_delete_id=~id~" onclick="return confirm('Permanently delete?')">[delete]</a></td>
- </tr><!--~}~-->
-
+ <th>title</th>
+ <th>saved at</th>
+ <th>by</th>
+ <th></th>
+ </tr>
+ <!--~rows {~-->
+ <tr>
+ <td>~title html~<!--~title empty {~--><em>(untitled)</em><!--~}~--></td>
+ <td class="timestamp">~timestamp~</td>
+ <td>~who html~</td>
+ <td>
+ <!--~first {~-->
+ <!--~filename nonempty {~-->
+ <form style="display: inline-block" action="~filename attr~"><input type="submit" value="view"></form>
+ <!--~}~-->
+ <!--~filename empty {~-->
+ <form style="display: inline-block" action="admin_pages"><input type="hidden" name="id" value="~page_id~"><input type="submit" value="view"></form>
+ <!--~}~-->
+ <!--~}~-->
+ <!--~first unset {~-->
+ <form style="display: inline-block" action="admin_pages"><input type="hidden" name="history_id" value="~history_id~"><input type="submit" value="view"></form>
+ <!--~}~-->
+ </td>
+ </tr>
+ <!--~}~-->
+ <script>
+ (function () {
+ var i, i02, d, hours, el, els
+ i02 = function (i) { return i > 9 ? i : '0' + i }
+ els = document.getElementsByClassName('timestamp');
+ for (i = 0; i < els.length; ++i) {
+ el = els[i]
+ d = new Date(parseInt(el.innerText) * 1000)
+ hours = d.getHours();
+ el.innerText =
+ i02(d.getMonth() + 1) + '/' +
+ i02(d.getDate()) + '/' +
+ d.getFullYear() + ' ' +
+ i02((hours + 11) % 12 + 1) + ':' +
+ i02(d.getMinutes()) + '' +
+ (hours < 12 ? 'am' : 'pm')
+ }
+ })();
+ </script>
</table>
<!--~}~-->
- <!--~rows once_else {~-->
- <p>No pages in database.</p>
- <!--~}~-->
-
- <p><a href="admin_pages?new=1">[Add a new page]</a></p>
<!--~}~-->
<!--~}~-->
</body>