parent
46f28bacce
commit
a6697bfc7b
5 changed files with 231 additions and 13 deletions
@ -0,0 +1,63 @@ |
||||
% layout 'standard', title => 'Dashboard', sb_active => 'dashboard'; |
||||
|
||||
%= include 'dashboard/_blog_nav', page => 'media' |
||||
|
||||
% if ( my $confirmation = flash 'confirmation' ) { |
||||
<div style="margin-top: 2em" class="alert alert-success" role="alert"> |
||||
<%== $confirmation %> |
||||
</div> |
||||
% } |
||||
|
||||
% if ( $c->stash->{success} ) { |
||||
<div style="margin-top: 2em" class="alert alert-success" role="alert"> |
||||
<%= $c->stash->{success_message} %> |
||||
</div> |
||||
% } |
||||
|
||||
% if ( $c->stash->{errors} ) { |
||||
<div style="margin-top: 2em" class="alert alert-danger" role="alert"> |
||||
There were errors with your request that could not be resolved: |
||||
<ul> |
||||
% for my $error ( @{$c->stash->{errors}} ) { |
||||
<li><%= $error %></li> |
||||
% } |
||||
</ul> |
||||
</div> |
||||
% } |
||||
|
||||
<form method="POST" enctype="multipart/form-data" action="<%= $c->url_for( 'do_dashboard_blog_media' ) %>"> |
||||
<div class="mt-3 mb-3"> |
||||
<label for="upload" class="col-sm-2 col-form-label">File</label> |
||||
<input type="file" class="form-control" id="upload" name="upload" > |
||||
</div> |
||||
|
||||
<div class="mb-3"> |
||||
<input type="submit" class="btn btn-primary btn-sm float-end" width="100%" value="Upload File"> |
||||
</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-primary float-end">Remove Media File</button> |
||||
</form> |
||||
</td> |
||||
</tr> |
||||
% } |
||||
</tbody> |
||||
</table> |
||||
% } |
||||
Loading…
Reference in new issue