add posst card image
This commit is contained in:
parent
6b459d4f46
commit
d3a38a1b03
|
@ -51,3 +51,7 @@
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.choices__list--dropdown {
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
|
@ -84,6 +84,9 @@ class Post implements EntityInterface
|
||||||
#[ORM\OneToMany(targetEntity: PostFollow::class, mappedBy: 'post', orphanRemoval: true)]
|
#[ORM\OneToMany(targetEntity: PostFollow::class, mappedBy: 'post', orphanRemoval: true)]
|
||||||
private $postFollows;
|
private $postFollows;
|
||||||
|
|
||||||
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||||
|
private $image2;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->categories = new ArrayCollection();
|
$this->categories = new ArrayCollection();
|
||||||
|
@ -423,4 +426,16 @@ class Post implements EntityInterface
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getImage2(): ?string
|
||||||
|
{
|
||||||
|
return $this->image2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setImage2(?string $image2): self
|
||||||
|
{
|
||||||
|
$this->image2 = $image2;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ use Symfony\Component\Validator\Constraints\Range;
|
||||||
use Symfony\Component\Validator\Constraints\Url;
|
use Symfony\Component\Validator\Constraints\Url;
|
||||||
use App\Form\Type\SimpleMdTextareaType;
|
use App\Form\Type\SimpleMdTextareaType;
|
||||||
use App\Core\Form\Type\EditorJsTextareaType;
|
use App\Core\Form\Type\EditorJsTextareaType;
|
||||||
|
use App\Core\Form\FileManager\FilePickerType;
|
||||||
|
|
||||||
class PostType extends AbstractType
|
class PostType extends AbstractType
|
||||||
{
|
{
|
||||||
|
@ -160,6 +161,20 @@ class PostType extends AbstractType
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$builder->add(
|
||||||
|
'image2',
|
||||||
|
FilePickerType::class,
|
||||||
|
[
|
||||||
|
'label' => 'Image (carte)',
|
||||||
|
'required' => false,
|
||||||
|
'data_class' => null,
|
||||||
|
'attr' => [
|
||||||
|
],
|
||||||
|
'constraints' => [
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$builder->add(
|
$builder->add(
|
||||||
'tags',
|
'tags',
|
||||||
CollectionType::class,
|
CollectionType::class,
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% for item in ['image', 'status', 'contentFormat', 'publishedAt'] %}
|
{% for item in ['image', 'image2', 'status', 'contentFormat', 'publishedAt'] %}
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{{ form_row(form[item]) }}
|
{{ form_row(form[item]) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -99,6 +99,17 @@
|
||||||
-
|
-
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span class="font-weight-bold pb-3 d-block">Image (carte)</span>
|
||||||
|
|
||||||
|
{% if entity.image2 %}
|
||||||
|
<figure>
|
||||||
|
<img src="{{ asset(entity.image2) }}" class="img-fluid">
|
||||||
|
</figure>
|
||||||
|
{% else %}
|
||||||
|
-
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<span class="font-weight-bold pb-2 d-block">Statut</span>
|
<span class="font-weight-bold pb-2 d-block">Statut</span>
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
{% set color = generate_color_by_string(post.title) %}
|
{% set color = generate_color_by_string(post.title) %}
|
||||||
|
|
||||||
{%- set image -%}
|
{%- set image -%}
|
||||||
{%- if post.image -%}
|
{%- if post.image2 -%}
|
||||||
|
{{ asset(post.image2)|imagine_filter('post_preview_filter') }}
|
||||||
|
{%- elseif post.image -%}
|
||||||
{{ asset(post.image)|imagine_filter('post_preview_filter') }}
|
{{ asset(post.image)|imagine_filter('post_preview_filter') }}
|
||||||
{%- elseif post.quickImage -%}
|
{%- elseif post.quickImage -%}
|
||||||
{{ post.quickImage }}
|
{{ post.quickImage }}
|
||||||
|
|
Loading…
Reference in a new issue