Skip to content
Snippets Groups Projects
Commit b4766a4a authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents a6ca7d6b 02e26ad5
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>
......
......@@ -26,16 +26,17 @@
<table class="<%= table_classes %>">
<tbody>
<tr>
<td width="150"><%= Communication::Website::Page.human_attribute_name('slug') %></td>
<td width="150"><%= Communication::Website::Post.human_attribute_name('slug') %></td>
<td><%= @post.slug %></td>
</tr>
<tr>
<td><%= Communication::Website::Page.human_attribute_name('published_at') %></td>
<td><%= l @post.published_at, format: :long if @post.published_at %></td>
</tr>
<tr>
<td><%= Communication::Website::Page.human_attribute_name('published') %></td>
<td><%= t @post.published %></td>
<td><%= Communication::Website::Post.human_attribute_name('published') %></td>
<td>
<%= t @post.published %>
<% if @post.published & @post.published_at %>
<p><small><%= l @post.published_at, format: :long if @post.published_at %></small></p>
<% end %>
</td>
</tr>
<% if @post.imported_post %>
<tr>
......@@ -43,15 +44,19 @@
<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>
<% if @post.featured_image.attached? %>
<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">
<%= image_tag @post.featured_image.variant(resize: '400'), class: 'img-fluid' %>
</div>
</div>
<% end %>
</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