update projects tpl
This commit is contained in:
parent
630359fc1b
commit
e41075c184
|
@ -11,6 +11,10 @@ liip_imagine:
|
|||
filters:
|
||||
downscale:
|
||||
max: [600, 600]
|
||||
project_preview_filter:
|
||||
filters:
|
||||
downscale:
|
||||
max: [600, 600]
|
||||
site_avatar:
|
||||
filters:
|
||||
downscale:
|
||||
|
|
|
@ -50,6 +50,11 @@ class Project implements EntityInterface
|
|||
*/
|
||||
private $links = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
private $image;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -114,4 +119,16 @@ class Project implements EntityInterface
|
|||
|
||||
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;
|
||||
|
||||
use App\Core\Form\FileManager\FilePickerType;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Entity\Project;
|
||||
use App\Form\Type\SimpleMdTextareaType;
|
||||
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\OptionsResolver\OptionsResolver;
|
||||
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
|
||||
{
|
||||
|
@ -59,6 +60,20 @@ class ProjectType extends AbstractType
|
|||
]
|
||||
);
|
||||
|
||||
$builder->add(
|
||||
'image',
|
||||
FilePickerType::class,
|
||||
[
|
||||
'label' => 'Image',
|
||||
'required' => false,
|
||||
'data_class' => null,
|
||||
'attr' => [
|
||||
],
|
||||
'constraints' => [
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$builder->add(
|
||||
'links',
|
||||
CollectionType::class,
|
||||
|
|
|
@ -9,26 +9,41 @@
|
|||
<div class="body">
|
||||
<div class="body-content">
|
||||
{{- _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 %}
|
||||
<hr>
|
||||
<div class="col-4 mesh-wrapper">
|
||||
<div class="mesh">
|
||||
{% 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') -}}
|
||||
|
||||
<h2>{{- project.label -}}</h2>
|
||||
|
||||
{{- project.description|murph_url|markdown('post') -}}
|
||||
|
||||
{% if project.links %}
|
||||
<ul class="list--inline">
|
||||
{% for link in project.links %}
|
||||
<li>
|
||||
<a class="button small" href="{{ link.url|murph_url }}" target="_blank">
|
||||
{{- link.label -}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if project.links %}
|
||||
<div class="mesh-file">
|
||||
<ul class="list--inline">
|
||||
{% for link in project.links %}
|
||||
<li>
|
||||
<a class="button small" href="{{ link.url|murph_url }}" target="_blank">
|
||||
{{- link.label -}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue