add quick show video
This commit is contained in:
parent
136803d5aa
commit
35a9a8aad1
|
@ -65,7 +65,7 @@
|
||||||
"symfony/browser-kit": "^5.2",
|
"symfony/browser-kit": "^5.2",
|
||||||
"symfony/css-selector": "^5.2",
|
"symfony/css-selector": "^5.2",
|
||||||
"symfony/debug-bundle": "^5.2",
|
"symfony/debug-bundle": "^5.2",
|
||||||
"symfony/maker-bundle": "^1.0",
|
"symfony/maker-bundle": "^1.37",
|
||||||
"symfony/phpunit-bridge": "^5.2",
|
"symfony/phpunit-bridge": "^5.2",
|
||||||
"symfony/stopwatch": "^5.2",
|
"symfony/stopwatch": "^5.2",
|
||||||
"symfony/var-dumper": "^5.2",
|
"symfony/var-dumper": "^5.2",
|
||||||
|
|
|
@ -108,6 +108,11 @@ class Post implements EntityInterface
|
||||||
*/
|
*/
|
||||||
private $quickVideoHeight;
|
private $quickVideoHeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="boolean", options={"default"=0})
|
||||||
|
*/
|
||||||
|
private $quickShowVideo = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity=Comment::class, mappedBy="post", orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity=Comment::class, mappedBy="post", orphanRemoval=true)
|
||||||
*/
|
*/
|
||||||
|
@ -446,4 +451,16 @@ class Post implements EntityInterface
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getQuickShowVideo(): ?bool
|
||||||
|
{
|
||||||
|
return $this->quickShowVideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setQuickShowVideo(bool $quickShowVideo): self
|
||||||
|
{
|
||||||
|
$this->quickShowVideo = $quickShowVideo;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,6 +223,19 @@ class PostType extends AbstractType
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$builder->add(
|
||||||
|
'quickShowVideo',
|
||||||
|
CheckboxType::class,
|
||||||
|
[
|
||||||
|
'label' => 'Afficher la vidéo',
|
||||||
|
'required' => false,
|
||||||
|
'attr' => [
|
||||||
|
],
|
||||||
|
'constraints' => [
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$builder->add(
|
$builder->add(
|
||||||
'quickVideoWidth',
|
'quickVideoWidth',
|
||||||
NumberType::class,
|
NumberType::class,
|
||||||
|
|
|
@ -76,6 +76,12 @@
|
||||||
{{ form_row(form[item]) }}
|
{{ form_row(form[item]) }}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for item in ['quickShowVideo'] %}
|
||||||
|
<div class="col-md-12">
|
||||||
|
{{ form_row(form[item]) }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane p-3" id="form-post-notebook">
|
<div class="tab-pane p-3" id="form-post-notebook">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
{% set title = post.title %}
|
{% set title = post.title %}
|
||||||
{% set content = post.content|murph_url %}
|
{% set content = post.content|murph_url %}
|
||||||
|
|
||||||
{% if false and post.quickVideo and post.quickVideoHeight and post.quickVideoWidth %}
|
{% if post.quickVideo and post.quickShowVideo and post.quickVideoHeight and post.quickVideoWidth %}
|
||||||
<div class="quick-video">
|
<div class="quick-video">
|
||||||
<div class="video-ratio" data-ratio="{{ post.quickVideoHeight * 100 / post.quickVideoWidth }}%">
|
<div class="video-ratio" data-ratio="{{ post.quickVideoHeight * 100 / post.quickVideoWidth }}%">
|
||||||
<iframe src="{{ post.quickVideo }}" allowfullscreen></iframe>
|
<iframe src="{{ post.quickVideo }}" allowfullscreen></iframe>
|
||||||
|
|
Loading…
Reference in a new issue