Skip to content

Commit

Permalink
Merge pull request #163 from gerMdz/bug-blocsfixes
Browse files Browse the repository at this point in the history
🔐 Actualizando el layout de blocs_fix
  • Loading branch information
gerMdz authored Jun 9, 2023
2 parents 08bede4 + 058a241 commit 88637ce
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 113 deletions.
59 changes: 1 addition & 58 deletions src/Entity/IndexAlameda.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,10 @@ class IndexAlameda
*/
private ?string $lemaSinEspacio;

/**
* @ORM\Column(type="string", length=5, nullable=true)
*/
private ?string $horario1;

/**
* @ORM\Column(type="string", length=5, nullable=true)
*/
private ?string $horario2;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $textoVersiculo;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $versiculo;


/**
* @ORM\Column(type="string", length=255)
Expand Down Expand Up @@ -155,53 +140,11 @@ public function setLemaSinEspacio(string $lemaSinEspacio): self
return $this;
}

public function getHorario1(): ?string
{
return $this->horario1;
}

public function setHorario1(?string $horario1): self
{
$this->horario1 = $horario1;

return $this;
}

public function getHorario2(): ?string
{
return $this->horario2;
}

public function setHorario2(?string $horario2): self
{
$this->horario2 = $horario2;

return $this;
}

public function getTextoVersiculo(): ?string
{
return $this->textoVersiculo;
}

public function setTextoVersiculo(?string $textoVersiculo): self
{
$this->textoVersiculo = $textoVersiculo;

return $this;
}

public function getVersiculo(): ?string
{
return $this->versiculo;
}

public function setVersiculo(?string $versiculo): self
{
$this->versiculo = $versiculo;

return $this;
}

public function getMetaDescripcion(): ?string
{
Expand Down
19 changes: 17 additions & 2 deletions src/Form/BlocsFixesType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
namespace App\Form;

use App\Entity\BlocsFixes;
use App\Entity\Principal;
use App\Entity\Section;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
Expand All @@ -16,8 +19,20 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
->add('cssClass')
->add('imageFilename')
->add('identificador')
->add('page')
->add('section')
->add('page', EntityType::class, [
'class' => Principal::class,
'multiple' => true,
'attr' => [
'class' => 'select2-enable'
]
])
->add('section', EntityType::class, [
'class' => Section::class,
'multiple' => true,
'attr' => [
'class' => 'select2-enable'
]
])
->add('indexAlameda')
->add('fixes_type')
;
Expand Down
6 changes: 4 additions & 2 deletions templates/admin/blocs_fixes/_delete_form.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<form method="post" action="{{ path('app_blocs_fixes_delete', {'id': blocs_fix.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<form method="post" action="{{ path('app_blocs_fixes_delete', {'id': blocs_fix.id}) }}"
onsubmit="return confirm('¿Está seguro de borrar este bloque fijo?');"
>
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ blocs_fix.id) }}">
<button class="btn">Delete</button>
<button class="btn btn-danger col-12">Borrar</button>
</form>
2 changes: 1 addition & 1 deletion templates/admin/blocs_fixes/_form.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
<button class="btn btn-primary btn--pill col-4">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
64 changes: 57 additions & 7 deletions templates/admin/blocs_fixes/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,63 @@
{% extends 'base.html.twig' %}
{% extends 'base_coreui.html.twig' %}

{% block title %}Editar BlocsFixes{% endblock %}
{% block breadcrumb %}
{{ parent() }}
<li class="breadcrumb-item ">
<span>
<a href="{{ path('app_blocs_fixes_index') }}">
Bloques fijos (BlocsFixes)
</a>
</span>
</li>
<li class="breadcrumb-item active ">
<span>
Edición
</span>
</li>
{% endblock %}

{% block content %}
<div class="container">
{% for message in app.flashes('error') %}
<div class="alert alert-danger">
{{ message }}
</div>
{% endfor %}
</div>
<div class="container">


{{ include('admin/blocs_fixes/_form.html.twig', {'button_label': 'Actualizar'}) }}
<div class="d-flex gap-1 mb-3">
<a href="{{ path('app_blocs_fixes_index') }}" class="btn btn-info col-4">Volver al listado</a>
<div class="col-4">
{{ include('admin/blocs_fixes/_delete_form.html.twig') }}
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}

{% block title %}Edit BlocsFixes{% endblock %}

{% block body %}
<h1>Edit BlocsFixes</h1>
<script>
$('.custom-file-input').on('change', function (event) {
const inputFile = event.currentTarget;
$(inputFile).parent()
.find('.custom-file-label')
.html(inputFile.files[0].name);
});
{{ include('admin/blocs_fixes/_form.html.twig', {'button_label': 'Update'}) }}
</script>

<a href="{{ path('app_blocs_fixes_index') }}">back to list</a>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.1/min/dropzone.min.js"
integrity="sha256-v7sFPKIh3GHvV9MMFBXcSBLG/BDUC7h1fpfDC5tp1FM=" crossorigin="anonymous"></script>

{{ include('admin/blocs_fixes/_delete_form.html.twig') }}
{{ encore_entry_script_tags('app') }}

{% endblock %}
{% block jslocal %}
{# {{ encore_entry_script_tags('summernote') }} #}
{{ encore_entry_script_tags('select2-parent') }}
{% endblock %}
112 changes: 69 additions & 43 deletions templates/admin/blocs_fixes/show.html.twig
Original file line number Diff line number Diff line change
@@ -1,46 +1,72 @@
{% extends 'base.html.twig' %}
{% extends 'base_coreui.html.twig' %}

{% block title %}BlocsFixes{% endblock %}

{% block body %}
<h1>BlocsFixes</h1>

<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ blocs_fix.id }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ blocs_fix.description }}</td>
</tr>
<tr>
<th>CssClass</th>
<td>{{ blocs_fix.cssClass }}</td>
</tr>
<tr>
<th>ImageFilename</th>
<td>{{ blocs_fix.imageFilename }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ blocs_fix.createdAt ? blocs_fix.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>UpdatedAt</th>
<td>{{ blocs_fix.updatedAt ? blocs_fix.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Identificador</th>
<td>{{ blocs_fix.identificador }}</td>
</tr>
</tbody>
</table>

<a href="{{ path('app_blocs_fixes_index') }}">back to list</a>

<a href="{{ path('app_blocs_fixes_edit', {'id': blocs_fix.id}) }}">edit</a>

{{ include('admin/blocs_fixes/_delete_form.html.twig') }}
{% block breadcrumb %}
<li class="breadcrumb-item">
<span><a href="{{ path('admin') }}">Panel</a></span>
</li>
<li class="breadcrumb-item ">
<span>
<a href="{{ path('app_blocs_fixes_index') }}">
Bloques fijos (BlocsFixes)
</a>
</span>
</li>
<li class="breadcrumb-item active"><span>Detalle</span></li>
{% endblock %}


{% block content %}
<div class="container">
<div class="row">
<div class="col-sm-12 show-article-container ">
<h4>Identificador: <strong class="ml-5"> {{ blocs_fix.identificador }} </strong></h4>
<small>
<a href="{{ path('app_blocs_fixes_edit', {'id': blocs_fix.id}) }}">
Editar </a>
</small>
</div>
<hr class="w-100"/>
<div class="col-sm-6">
Id: <h6>{{ blocs_fix.id }}</h6>
</div>
<div class="col-sm-6">
Descripción: <h6>{{ blocs_fix.description }}</h6>
</div>
<div class="col-sm-6">
CssClass: <h6>{{ blocs_fix.cssClass|default('No definida') }}</h6>
</div>
<div class="col-sm-6">
ImageFilename: {% if blocs_fix.imageFilename %}
<img class="show-article-img"
src="{{ blocs_fix.imagePath|imagine_filter('squared_thumbnail_small') }}"
alt="{{ base.siteName }}">
{% else %}
<h6> Sin imagen </h6>
{% endif %}

</div>
<div class="col-sm-6">
Creada: <h6>{{ blocs_fix.createdAt ? blocs_fix.createdAt|date('Y-m-d H:i:s') : '' }}</h6>
</div>
<div class="col-sm-6">
Actualizada: <h6>{{ blocs_fix.updatedAt ? blocs_fix.updatedAt|date('Y-m-d H:i:s') : '' }}</h6>
</div>

</div>

<div class="d-flex gap-1 mb-3">
<a href="{{ path('app_blocs_fixes_index') }}"
class="btn btn-info col-4"
>Volver al listado</a>

<a href="{{ path('app_blocs_fixes_edit', {'id': blocs_fix.id}) }}"
class="btn btn-warning col-4"
>Editar</a>
<div class="col-4">

{{ include('admin/blocs_fixes/_delete_form.html.twig') }}
</div>
</div>
</div>
{% endblock %}

0 comments on commit 88637ce

Please sign in to comment.