Merge pull request 'PostController' (#26) from PostController into master
Reviewed-on: #26pull/28/head^2
commit
27676cab6b
@ -0,0 +1,31 @@
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 70%;
|
||||
background-color: #f2f2f7;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
border-radius: 1rem;
|
||||
margin-top: 5vh;
|
||||
border: 3px solid black;
|
||||
gap: 1rem;
|
||||
|
||||
.form-container {
|
||||
#simple_search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
justify-content: space-between;
|
||||
|
||||
:first-child {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#simple_search_search {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class SimpleSearchType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('search', TextType::class, [
|
||||
'label' => false
|
||||
])
|
||||
->add('submit', SubmitType::class, [
|
||||
'label' => 'Search'
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('css/components/form.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/components/post_mini.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('css/components/search.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="wrapper">
|
||||
<div class="form-container">
|
||||
{{ form(form) }}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{% if posts is defined %}
|
||||
{% for post in posts %}
|
||||
{% include 'post/post_mini.html.twig' with { 'post': post} %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
Binary file not shown.
Loading…
Reference in new issue