diff --git a/app/views/admin/communication/website/posts/_form.html.erb b/app/views/admin/communication/website/posts/_form.html.erb index 3bf62603ef38e6905409c09c8d955f10ac110456..f029d406f0f2957bcb7dbcb31b8a5d38077b6fab 100644 --- a/app/views/admin/communication/website/posts/_form.html.erb +++ b/app/views/admin/communication/website/posts/_form.html.erb @@ -20,6 +20,7 @@ <div class="card-body"> <%= f.input :published %> <%= f.input :published_at, html5: true %> + <%= f.input :featured_image %> </div> </div> </div> diff --git a/app/views/admin/communication/website/posts/_list.html.erb b/app/views/admin/communication/website/posts/_list.html.erb index 7f6971c59852bde5ff9f35caa6c9e264f52b9ab1..2d89d1a61f97e2ad5fc6caa251d79f376b06e01a 100644 --- a/app/views/admin/communication/website/posts/_list.html.erb +++ b/app/views/admin/communication/website/posts/_list.html.erb @@ -2,6 +2,7 @@ <thead> <tr> <th><%= Communication::Website::Post.human_attribute_name('title') %></th> + <th><%= Communication::Website::Post.human_attribute_name('featured_image') %></th> <th><%= Communication::Website::Post.human_attribute_name('published_at') %></th> <th></th> </tr> @@ -10,6 +11,8 @@ <% posts.each do |post| %> <tr> <td><%= link_to post, admin_communication_website_post_path(website_id: post.website.id, id: post.id) %></td> + <td><%= image_tag post.featured_image.variant(resize: 'x100'), + height: 50 if post.featured_image.attached? %></td> <td><%= l post.published_at, format: :long if post.published_at %></td> <td class="text-end"> <div class="btn-group" role="group"> diff --git a/app/views/admin/communication/website/posts/jekyll.html.erb b/app/views/admin/communication/website/posts/jekyll.html.erb index 960aa421eb97af05f1650bdc1c170a5f9bcfa0bc..36e588c2f5b09f8ecc96738d3b95b30153628f03 100644 --- a/app/views/admin/communication/website/posts/jekyll.html.erb +++ b/app/views/admin/communication/website/posts/jekyll.html.erb @@ -2,6 +2,9 @@ title: "<%= @post.title %>" date: <%= @post.published_at %> UTC slug: "<%= @post.slug %>" +<% if @post.featured_image.attached? %> +image: "<%= url_for @post.featured_image %>" +<% end %> description: > <%= prepare_for_github @post.description %> text: > diff --git a/app/views/admin/communication/website/posts/show.html.erb b/app/views/admin/communication/website/posts/show.html.erb index 1fd65d4beb3b14368fd0bdf5bdda7f97e909004d..9f7ff79dfa378699e39404d99dee1b99097a554a 100644 --- a/app/views/admin/communication/website/posts/show.html.erb +++ b/app/views/admin/communication/website/posts/show.html.erb @@ -43,6 +43,12 @@ <td><a href="<%= @post.imported_post.url %>" target="_blank">Original URL</a></td> </tr> <% end %> + <% if @post.featured_image.attached? %> + <tr> + <td><%= t('communication.website.imported.featured_image') %></td> + <td><%= image_tag @post.featured_image.variant(resize: '400'), class: 'img-responsive' %></td> + </tr> + <% end %> </tbody> </table> </div>