Skip to content
Snippets Groups Projects
Commit 954d8957 authored by pabois's avatar pabois
Browse files

post featured image

parent 8a80baf2
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,6 @@ class Admin::Communication::Website::PostsController < Admin::Communication::Web
def post_params
params.require(:communication_website_post)
.permit(:university_id, :website_id, :title, :description, :text, :published, :published_at)
.permit(:university_id, :website_id, :title, :description, :text, :published, :published_at, :featured_image, :featured_image_delete)
end
end
......@@ -20,7 +20,20 @@
<div class="card-body">
<%= f.input :published %>
<%= f.input :published_at, html5: true %>
<%= f.input :featured_image %>
</div>
</div>
<div class="card flex-fill w-100">
<div class="card-header">
<h5 class="card-title mb-0"><%= t('activerecord.attributes.communication/website/post.featured_image') %></h5>
</div>
<div class="card-body">
<%= f.input :featured_image,
as: :single_deletable_file,
direct_upload: true,
label: false,
input_html: { accept: '.jpg,.jpeg,.png' },
preview: true
%>
</div>
</div>
</div>
......
......@@ -52,6 +52,7 @@ en:
communication/website/post:
title: Title
description: Description (SEO)
featured_image: Featured image
text: Text
published: Published ?
published_at: Publication date
......
......@@ -51,6 +51,7 @@ fr:
website: Site Web
communication/website/post:
description: Description (SEO)
featured_image: Image à la une
published: Publié ?
published_at: Date de publication
text: Texte
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment