|
| 1 | +%% cascade simple::_::layout { title => 'Edit ' ~ $blog.url, |
| 2 | +%% hide_welcome_screen => 1, |
| 3 | +%% } |
| 4 | + |
| 5 | +%% override sidebar_card -> { |
| 6 | +%% if ( $person_permissions.can_manage_blogs ) { |
| 7 | + <div class="card mb-4"> |
| 8 | + <div class="card-header">Actions</div> |
| 9 | + <div class="card-body"> |
| 10 | + <form method="post" action="[% $c.url_for( 'do_publish_new_blog', id => $blog.id ) %]"> |
| 11 | + <button type="submit" class="btn btn-primary float-end">Publish Blog</button> |
| 12 | + </form> |
| 13 | + </div> |
| 14 | + </div> |
| 15 | +%% } |
| 16 | +%% } |
| 17 | + |
| 18 | +%% override blog_homepage_section -> { |
| 19 | + <div class="card mb-4"> |
| 20 | + <div class="card-header">Screenshot</div> |
| 21 | + <div class="card-body"> |
| 22 | + <a target="_blank" title="Visit [% $blog.title %]" href="[% $blog.url %]"> |
| 23 | + <figure class="mb-4"><img class="img-fluid rounded" src="[% $blog.img_url %]" alt="..." /></figure> |
| 24 | + </a> |
| 25 | + </div> |
| 26 | + </div> |
| 27 | +%% } |
| 28 | + |
| 29 | +%% override panel -> { |
| 30 | + <h3>[% $blog.title %]</h3> |
| 31 | + |
| 32 | + |
| 33 | + <div class="row" style="margin: 2em"> |
| 34 | + <div class="col"> |
| 35 | + </div> |
| 36 | + <div class="col"> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | + |
| 40 | + <div class="row"> |
| 41 | + <!-- Error Handling On LHS --> |
| 42 | + <div class="col"> |
| 43 | +%% if ( $errors.size() ) { |
| 44 | + <div style="margin-top: 2em" class="alert alert-danger" role="alert"> |
| 45 | + There were errors with your request that could not be resolved: |
| 46 | + <ul> |
| 47 | +%% for $errors -> $error { |
| 48 | + <li>[% $error %]</li> |
| 49 | +%% } |
| 50 | + </ul> |
| 51 | + </div> |
| 52 | +%% } |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + |
| 56 | + <div class="row"> |
| 57 | + <div class="col"> |
| 58 | + <form method="post" action="[% $c.url_for( 'do_edit_new_blog', slug => $blog.slug ) %]"> |
| 59 | + |
| 60 | +%% include 'simple/_/form/input.tx' { type => 'text', name => 'title', |
| 61 | +%% title => 'Title', |
| 62 | +%% help => 'The title of the blog', |
| 63 | +%% value => $form_title, |
| 64 | +%% }; |
| 65 | + |
| 66 | +%% include 'simple/_/form/input.tx' { type => 'text', name => 'tagline', |
| 67 | +%% title => 'Tagline', |
| 68 | +%% help => 'The tagline of the blog.', |
| 69 | +%% value => $form_tagline, |
| 70 | +%% }; |
| 71 | + |
| 72 | + <textarea name="about" rows="4">[% $form_about %]</textarea> |
| 73 | + |
| 74 | + |
| 75 | + <br /> |
| 76 | + |
| 77 | + <div class="form-check form-switch"> |
| 78 | + |
| 79 | + <input class="form-check-input" type="checkbox" value="1" name="is_adult" id="is_adult" [% $form_adult ? " checked " : "" %]> |
| 80 | + <label class="form-check-label" for="is_adult">Adult Content</label> |
| 81 | + </div> |
| 82 | + |
| 83 | +%% for $tags -> $tag { |
| 84 | + <div class="form-check"> |
| 85 | + <input class="form-check-input" type="checkbox" value="[% $tag.id %]" name="tags" id="tag_[% $tag.id %]" [% $tag.checked ? " checked " : "" %]> |
| 86 | + <label class="form-check-label" for="tag_[% $tag.id %]">[% $tag.name %]</label> |
| 87 | + </div> |
| 88 | +%% } |
| 89 | + <br /> |
| 90 | +%% include 'simple/_/form/input.tx' { type => 'text', name => 'url', |
| 91 | +%% title => 'Homepage URL', |
| 92 | +%% help => 'The url of the blog', |
| 93 | +%% value => $form_url, |
| 94 | +%% }; |
| 95 | + |
| 96 | +%% include 'simple/_/form/input.tx' { type => 'text', name => 'rss_url', |
| 97 | +%% title => 'RSS URL', |
| 98 | +%% help => 'A URL to an RSS feed for the blog.', |
| 99 | +%% value => $form_rss_url, |
| 100 | +%% }; |
| 101 | + |
| 102 | + <button type="submit" class="btn btn-primary float-end">Update Blog Data</button> |
| 103 | + |
| 104 | + </form> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + <div class="row"> |
| 108 | + <h2>Recent Posts</h2> |
| 109 | +%% for $blog.posts -> $post { |
| 110 | + <a href="[% $post.url %]" target="_blank" alt="[% $post.date %]">[% $post.title %]</a> |
| 111 | +%% } |
| 112 | + </div> |
| 113 | + |
| 114 | +%% } |
0 commit comments