Refactor dashboard.

master
Manager Bot 3 years ago
parent 20e0dc3da2
commit f545f74234
  1. 49
      Web/templates/dashboard/blog_history.html.ep
  2. 48
      Web/templates/dashboard/blog_media.html.ep
  3. 48
      Web/templates/dashboard/blog_pages.html.ep
  4. 52
      Web/templates/dashboard/blog_posts.html.ep

@ -4,29 +4,26 @@
%= include '_base/status_window';
% if ( $history ) {
<table style="border: 1px solid #ccc" class="table mt-5">
<tbody>
<tr>
<th class="text-nowrap">When?</th>
<th class="text-nowrap">What?</th>
<th class="text-nowrap">Action</th>
</tr>
</thead>
<tbody>
% for my $change ( @{$history} ) {
<tr>
<td><%= $change->{dateref} %></a></td>
<td><%= $change->{message} %></a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_history' ) %>">
<input type="hidden" name="commit_hash" value="<%= $change->{commit} %>">
<button type="submit" class="btn btn-sm btn-primary">Restore</button>
</form>
</td>
</tr>
% }
</tbody>
</table>
% }
<table style="border: 1px solid #ccc" class="table mt-5">
<tbody>
<tr>
<th class="text-nowrap">When?</th>
<th class="text-nowrap">What?</th>
<th class="text-nowrap">Action</th>
</tr>
</thead>
<tbody>
% for my $change ( @{$history} ) {
<tr>
<td><%= $change->{dateref} %></a></td>
<td><%= $change->{message} %></a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_history' ) %>">
<input type="hidden" name="commit_hash" value="<%= $change->{commit} %>">
<button type="submit" class="btn btn-sm btn-primary">Restore</button>
</form>
</td>
</tr>
% }
</tbody>
</table>

@ -16,28 +16,26 @@
</div>
</form>
% if ( $media_files ) {
<table style="border: 1px solid #ccc" class="table mt-5">
<tbody>
<tr>
<th class="text-nowrap">Image</th>
<th class="text-nowrap">Embedd Link</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $media_file ( @{$media_files} ) {
<tr>
<td><img width="250px" src="<%= $media_file->{url} %>"></img></td>
<td><%= $media_file->{markdown} %></td>
<td>
<form style="margin-top: 1.5em" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_media_remove', { file => $media_file->{filename} } ) %>">
<input type="hidden" name="setting" value="webroot">
<button type="submit" class="btn btn-sm btn-danger float-end">Delete Media File</button>
</form>
</td>
</tr>
% }
</tbody>
</table>
% }
<table style="border: 1px solid #ccc" class="table mt-5">
<tbody>
<tr>
<th class="text-nowrap">Image</th>
<th class="text-nowrap">Embedd Link</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $media_file ( @{$media_files} ) {
<tr>
<td><img width="250px" src="<%= $media_file->{url} %>"></img></td>
<td><%= $media_file->{markdown} %></td>
<td>
<form style="margin-top: 1.5em" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_media_remove', { file => $media_file->{filename} } ) %>">
<input type="hidden" name="setting" value="webroot">
<button type="submit" class="btn btn-sm btn-danger float-end">Delete Media File</button>
</form>
</td>
</tr>
% }
</tbody>
</table>

@ -15,28 +15,26 @@
</div>
</div>
% if ( $blog_pages ) {
<table style="border: 1px solid #ccc" class="table">
<tbody>
<tr>
<th class="text-nowrap">Path</th>
<th class="text-nowrap">Edit</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $page ( @{$blog_pages} ) {
<tr>
<td><%= $page->rel_path %></td>
<td><a class="btn btn-sm btn-primary" href="<%= $c->url_for( 'show_dashboard_blog_page_edit', { id => $blog->id } )->query( file => $page->rel_path ) %>">Edit Page</a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_page_remove' ) %>">
<input type="hidden" name="file" value="<%= $page->rel_path %>">
<button type="submit" class="btn btn-sm btn-danger">Delete Page</button>
</form>
</td>
</tr>
% }
</tbody>
</table>
% }
<table style="border: 1px solid #ccc" class="table">
<tbody>
<tr>
<th class="text-nowrap">Path</th>
<th class="text-nowrap">Edit</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $page ( @{$blog_pages} ) {
<tr>
<td><%= $page->rel_path %></td>
<td><a class="btn btn-sm btn-primary" href="<%= $c->url_for( 'show_dashboard_blog_page_edit', { id => $blog->id } )->query( file => $page->rel_path ) %>">Edit Page</a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_page_remove' ) %>">
<input type="hidden" name="file" value="<%= $page->rel_path %>">
<button type="submit" class="btn btn-sm btn-danger">Delete Page</button>
</form>
</td>
</tr>
% }
</tbody>
</table>

@ -15,31 +15,29 @@
</div>
</div>
% if ( $blog_posts ) {
<table style="border: 1px solid #ccc" class="table">
<tbody>
<tr>
<th class="text-nowrap">Title</th>
<th class="text-nowrap">Date</th>
<th class="text-nowrap">Edit</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $post ( @{$blog_posts} ) {
<tr>
<td><a href="<%= $c->url_for( 'show_dashboard_blog', { id => $blog->id } ) %>"><%= $post->headers->{title} %></a></td>
<td><a href="<%= $c->url_for( 'show_dashboard_blog', { id => $blog->id } ) %>"><%= $post->headers->{date} %></a></td>
<td><a class="btn btn-sm btn-primary" href="<%= $c->url_for( 'show_dashboard_blog_post_edit', { id => $blog->id } )->query( mdfile => $post->filename ) %>">Edit Post</a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_post_remove' ) %>">
<input type="hidden" name="file" value="<%= $post->filename %>">
<button type="submit" class="btn btn-sm btn-danger">Delete Post</button>
</form>
</td>
</tr>
% }
</tbody>
</table>
% }
<table style="border: 1px solid #ccc" class="table">
<tbody>
<tr>
<th class="text-nowrap">Title</th>
<th class="text-nowrap">Date</th>
<th class="text-nowrap">Edit</th>
<th class="text-nowrap">Delete</th>
</tr>
</thead>
<tbody>
% for my $post ( @{$blog_posts} ) {
<tr>
<td><a href="<%= $c->url_for( 'show_dashboard_blog', { id => $blog->id } ) %>"><%= $post->headers->{title} %></a></td>
<td><a href="<%= $c->url_for( 'show_dashboard_blog', { id => $blog->id } ) %>"><%= $post->headers->{date} %></a></td>
<td><a class="btn btn-sm btn-primary" href="<%= $c->url_for( 'show_dashboard_blog_post_edit', { id => $blog->id } )->query( mdfile => $post->filename ) %>">Edit Post</a></td>
<td>
<form style="margin-top: 1.5em; display: inline;" method="POST" action="<%= $c->url_for( 'do_dashboard_blog_post_remove' ) %>">
<input type="hidden" name="file" value="<%= $post->filename %>">
<button type="submit" class="btn btn-sm btn-danger">Delete Post</button>
</form>
</td>
</tr>
% }
</tbody>
</table>

Loading…
Cancel
Save