update projects tpl
This commit is contained in:
parent
630359fc1b
commit
e41075c184
|
@ -11,6 +11,10 @@ liip_imagine:
|
||||||
filters:
|
filters:
|
||||||
downscale:
|
downscale:
|
||||||
max: [600, 600]
|
max: [600, 600]
|
||||||
|
project_preview_filter:
|
||||||
|
filters:
|
||||||
|
downscale:
|
||||||
|
max: [600, 600]
|
||||||
site_avatar:
|
site_avatar:
|
||||||
filters:
|
filters:
|
||||||
downscale:
|
downscale:
|
||||||
|
|
|
@ -50,6 +50,11 @@ class Project implements EntityInterface
|
||||||
*/
|
*/
|
||||||
private $links = [];
|
private $links = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=255)
|
||||||
|
*/
|
||||||
|
private $image;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -114,4 +119,16 @@ class Project implements EntityInterface
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getImage(): ?string
|
||||||
|
{
|
||||||
|
return $this->image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setImage(string $image): self
|
||||||
|
{
|
||||||
|
$this->image = $image;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,16 @@
|
||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Core\Form\FileManager\FilePickerType;
|
||||||
|
use App\Core\Form\Type\CollectionType;
|
||||||
use App\Entity\Project;
|
use App\Entity\Project;
|
||||||
|
use App\Form\Type\SimpleMdTextareaType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use App\Form\Type\SimpleMdTextareaType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use App\Core\Form\Type\CollectionType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
||||||
|
|
||||||
class ProjectType extends AbstractType
|
class ProjectType extends AbstractType
|
||||||
{
|
{
|
||||||
|
@ -59,6 +60,20 @@ class ProjectType extends AbstractType
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$builder->add(
|
||||||
|
'image',
|
||||||
|
FilePickerType::class,
|
||||||
|
[
|
||||||
|
'label' => 'Image',
|
||||||
|
'required' => false,
|
||||||
|
'data_class' => null,
|
||||||
|
'attr' => [
|
||||||
|
],
|
||||||
|
'constraints' => [
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$builder->add(
|
$builder->add(
|
||||||
'links',
|
'links',
|
||||||
CollectionType::class,
|
CollectionType::class,
|
||||||
|
|
|
@ -9,16 +9,27 @@
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div class="body-content">
|
<div class="body-content">
|
||||||
{{- _page.content.value|murph_url|markdown('post') -}}
|
{{- _page.content.value|murph_url|markdown('post') -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 meshes">
|
||||||
|
<div class="row">
|
||||||
{% for project in projects %}
|
{% for project in projects %}
|
||||||
<hr>
|
<div class="col-4 mesh-wrapper">
|
||||||
|
<div class="mesh">
|
||||||
<h2>{{- project.label -}}</h2>
|
{% if project.image %}
|
||||||
|
<div class="mesh-preview">
|
||||||
|
<img src="{{ asset(project.image)|imagine_filter('project_preview_filter') }}" alt="{{ project.label }}">
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<h2 class="mesh-title">{{- project.label -}}</h2>
|
||||||
|
<div class="mesh-description">
|
||||||
{{- project.description|murph_url|markdown('post') -}}
|
{{- project.description|murph_url|markdown('post') -}}
|
||||||
|
|
||||||
{% if project.links %}
|
{% if project.links %}
|
||||||
|
<div class="mesh-file">
|
||||||
<ul class="list--inline">
|
<ul class="list--inline">
|
||||||
{% for link in project.links %}
|
{% for link in project.links %}
|
||||||
<li>
|
<li>
|
||||||
|
@ -28,7 +39,11 @@
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue