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

featured image

parent 3d79e993
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@
<div class="card-body">
<%= f.input :published %>
<%= f.input :published_at, html5: true %>
<%= f.input :featured_image %>
</div>
</div>
</div>
......
......@@ -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">
......
......@@ -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: >
......
......@@ -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>
......
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