Skip to content

Commit

Permalink
Merge pull request #298 from gerMdz/agregando_types_block
Browse files Browse the repository at this point in the history
Corrigendo modelsTemplates
  • Loading branch information
gerMdz authored Jul 30, 2024
2 parents d8dada6 + 6307d5e commit ee8a349
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/Controller/SectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
Expand Down Expand Up @@ -186,6 +186,7 @@ public function mostrarSection(Section $section, EntradaRepository $entradaRepos
$entradas = $entradaRepository->findAllEntradasBySeccion($section->getId());

$twig = $section->getModelTemplate().'.html.twig';

$response_api = null;
$apiSource = null;

Expand Down
10 changes: 6 additions & 4 deletions templates/models/entradas/card-img-round.html.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div class="col-md-4 mb-sm-4">
<div class="{{ entrada.cssClass|default('col-md-4 mb-sm-4') }} ">
<div class="pasos h-100">
<div class="card card-plain bg-white h-100">
<div class="col-sm-4 mx-auto text-center img-20">
<img src="{{ entrada.imagePath|imagine_filter('squared_thumbnail_medium') }}"
alt="{{ entrada.titulo }}"
class="img-raised rounded-circle img-fluid ">
{% if (entrada.imageFilename is not null) %}
<img src="{{ entrada.imagePath|imagine_filter('squared_thumbnail_medium') }}"
alt="{{ entrada.titulo }}"
class="img-raised rounded-circle img-fluid ">
{% endif %}
</div>
{% if (entrada.linkRoute or entrada.linkPosting ) %}
<a
Expand Down
14 changes: 8 additions & 6 deletions templates/models/entradas/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="{{ entrada.imagePath|imagine_filter('squared_thumbnail_medium') }}"
class="card-img-top img-modal"
data-bs-toggle="modal" data-bs-target="#modal-02"
alt="{{ base.lema }}">
alt="{{ base.lema|default('AlamedaCMS') }}">
</div>
<div class="card-body position-relative mt-n6 mx-2 bg-white text-center rounded border border-light u-box-shadow-lg">
<h5 class="card-title text-uppercase">
Expand All @@ -26,13 +26,15 @@
<span class="text-alameda btn-icon ">Notas</span><br/>
</a>
{% endfor %}
<a href="{{ entrada.linkPosting }}" class="card-link text-center"
target="_blank">
<i class="far fa-hand-point-right fa-fw mr-1"></i>
<span class="text-alameda btn-icon mr-5 ">
{% if entrada.linkPosting %}
<a href="{{ entrada.linkPosting }}" class="card-link text-center"
target="_blank">
<i class="far fa-hand-point-right fa-fw mr-1"></i>
<span class="text-alameda btn-icon mr-5 ">
{{ entrada.footer | default('Video') }}
</span><br/>
</a>
</a>
{% endif %}
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions templates/models/principal/plataforma.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
{% block sections %}
<main role="main" class="{{ principal.cssClass | default('bg-white') }}">
{% for section in secciones %}

{{ render(controller(
'App\\Controller\\SectionController::mostrarSection', {id: section.id}
)) }}
Expand Down
2 changes: 1 addition & 1 deletion templates/models/sections/avanza.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col-md-1 mx-auto "></div>
<div class="col-md-10 mx-auto ">
<div class="row justify-content-center main-60"
style="background-image: url({{ assets('images/avanza/fondo-camino-index.jpg') }}); background-repeat: no-repeat; background-size:cover">
style="background-image: url({{ asset('images/avanza/fondo-camino-index.jpg') }}); background-repeat: no-repeat; background-size:cover">
<div class="col-sm-11">
<div class="container text-center p-5">
<h4>
Expand Down
7 changes: 6 additions & 1 deletion templates/models/sections/card-section.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

{% for entrada in entradas %}
{# include 'modelEntrada/'~entrada.modelTemplate~'.html.twig' ignore missing with { 'section':entrada } #}
{% include 'models/entradas/'~entrada.modelTemplate~'.html.twig' ignore missing with { 'entrada':entrada } %}
{% if(entrada.modelTemplate) %}
{% set model = entrada.modelTemplate %}
{% else %}
{% set model = 'default' %}
{% endif %}
{% include 'models/entradas/'~model~'.html.twig' ignore missing with { 'entrada':entrada } %}
{% endfor %}

</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/models/sections/contenido-img-embed.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div class="col-lg-6 order-first order-lg-last mb-4 mb-lg-0">
<!-- Mockup Browser -->
<figure>
<figure class="img-fluid">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
viewBox="0 0 857 40" style="enable-background:new 0 0 857 40;" xml:space="preserve">
<g>
Expand Down Expand Up @@ -70,7 +70,7 @@

{% if (entrada.imageFilename) %}
<img alt="{{ entrada.linkRoute }}"
src="{{ entrada.imagePath|imagine_filter('squared_thumbnail_medium') }}"
src="{{ entrada.imagePath|imagine_filter('squared_thumbnail_large') }}"
class="img-fluid" />
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions templates/models/sections/image-centro.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ seccion: true
#}
<section class="{{ section.cssClass|default('pt-5') }}" id="{{ section.identificador }}">
<div class="row">
<div class="col-lg-8">
<div class="col-lg-8 mx-auto">
<div class="text-center mb-5">
{{ section.title | striptags | raw }}
{{ section.contenido | replace({'<p>':'', '</p>':'<br/>'}) | raw }}
Expand Down Expand Up @@ -52,6 +52,6 @@ seccion: true
{% endfor %}
</div>

{% endfor %}

</div>
</section>

0 comments on commit ee8a349

Please sign in to comment.