add notebook
This commit is contained in:
parent
b8eb2b52b7
commit
b716f4a2a7
|
@ -112,6 +112,11 @@ class Post implements EntityInterface
|
|||
*/
|
||||
private $comments;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
private $notebook;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->categories = new ArrayCollection();
|
||||
|
@ -400,4 +405,16 @@ class Post implements EntityInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNotebook(): ?string
|
||||
{
|
||||
return $this->notebook;
|
||||
}
|
||||
|
||||
public function setNotebook(?string $notebook): self
|
||||
{
|
||||
$this->notebook = $notebook;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ class CommentType extends AbstractType
|
|||
'label' => 'Commentaire',
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
'rows' => 20,
|
||||
],
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
|
|
|
@ -250,6 +250,21 @@ class PostType extends AbstractType
|
|||
],
|
||||
]
|
||||
);
|
||||
|
||||
$builder->add(
|
||||
'notebook',
|
||||
TextareaType::class,
|
||||
[
|
||||
'label' => 'Carnet de notes',
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'data-simplemde' => '',
|
||||
'rows' => 20,
|
||||
],
|
||||
'constraints' => [
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#form-post-quick">{{ 'Quick'|trans }}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#form-post-notebook">{{ 'Carnet de notes'|trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="col-12 tab-content">
|
||||
|
@ -75,6 +78,15 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane p-3" id="form-post-notebook">
|
||||
<div class="row">
|
||||
{% for item in ['notebook'] %}
|
||||
<div class="col-12">
|
||||
{{ form_row(form[item]) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -99,6 +99,14 @@
|
|||
{% else %}
|
||||
{{ entity.content|markdown('post') }}
|
||||
{% endif %}
|
||||
|
||||
{% if entity.notebook %}
|
||||
<hr>
|
||||
|
||||
<div class="font-weight-bold pb-2">Carnet de notes</div>
|
||||
|
||||
{{ entity.notebook|markdown('post') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-3 p-3">
|
||||
<ul class="list-group">
|
||||
|
|
Loading…
Reference in New Issue