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

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

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

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

Loading…
Cancel
Save