Skip to content

Commit

Permalink
Merge pull request #46 from gerMdz/17-wizard-section
Browse files Browse the repository at this point in the history
17 wizard section
  • Loading branch information
gerMdz authored Oct 9, 2021
2 parents 393b231 + c2b7d40 commit 77ffba8
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 31 deletions.
4 changes: 3 additions & 1 deletion docs/bitacora.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
### v1.4.2


#### Mejoras

- Cambio en section edit
- Bug de nueva section, no indicaba que principal era obligatoria

#### Nuevas Funciones

12 changes: 2 additions & 10 deletions src/Form/Step/Section/StepOneType.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace App\Form\Step\Section;


use App\Entity\Section;
use Doctrine\Common\Persistence\ManagerRegistry;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
Expand All @@ -26,7 +24,6 @@ public function __construct(ManagerRegistry $registry)
$this->registry = $registry;
}


public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
Expand Down Expand Up @@ -61,20 +58,16 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'label' => 'Página?',
'choice_label' => 'linkRoute',
'placeholder' => 'Seleccione la página donde se insertará la sección',
'required' => false,
'help' => 'En qué página estará esta sección?',
'required' => true,
'help' => '¿En qué página estará esta sección?',
'attr' => [
'class' => 'select2-enable',
],

]
)
; // Fin del builder


}


public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
Expand All @@ -83,5 +76,4 @@ public function configureOptions(OptionsResolver $resolver)
]
);
}

}
23 changes: 20 additions & 3 deletions templates/principal/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,27 @@
{{ parent() }}
{{ encore_entry_link_tags('select2') }}
<style>
.custom-file-input ~ .custom-file-label::after {
background-color: #9c27b0;
color: white;
.custom-file-input ~ .custom-file-label.custom-file-label::after {
content: "Elegir imagen";
color: #fff;
background-color: #9c27b0;
top: 10px;
box-shadow: 0 2px 2px 0 rgba(156, 39, 176, 0.14), 0 3px 1px -2px rgba(156, 39, 176, 0.2), 0 1px 5px 0 rgba(156, 39, 176, 0.12);
position: absolute;
/*padding: 3px 9px;*/
/*margin: auto 1px;*/
font-size: .75rem;
font-weight: 400;
/*line-height: 1.428571;*/
text-decoration: none;
text-transform: uppercase;
letter-spacing: 0;
cursor: pointer;
border: 0 currentcolor;
border-radius: 0.2rem;
outline: 0;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
will-change: box-shadow, transform;
}
</style>

Expand Down
24 changes: 20 additions & 4 deletions templates/principal/new.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,27 @@
{{ parent() }}
{{ encore_entry_link_tags('select2-parent') }}
<style>
.custom-file-input ~ .custom-file-label::after {
background-color: #999999;
color: white;
.custom-file-input ~ .custom-file-label.custom-file-label::after {
content: "Elegir imagen";
color: #fff;
background-color: #9c27b0;
top: 10px;
box-shadow: 0 2px 2px 0 rgba(156, 39, 176, 0.14), 0 3px 1px -2px rgba(156, 39, 176, 0.2), 0 1px 5px 0 rgba(156, 39, 176, 0.12);
position: absolute;
/*padding: 3px 9px;*/
/*margin: auto 1px;*/
font-size: .75rem;
font-weight: 400;
/*line-height: 1.428571;*/
text-decoration: none;
text-transform: uppercase;
letter-spacing: 0;
cursor: pointer;
border: 0 currentcolor;
border-radius: 0.2rem;
outline: 0;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
will-change: box-shadow, transform;
}
</style>

Expand Down
29 changes: 17 additions & 12 deletions templates/section_admin/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@
</div>
<div class="row">
<div class="col-sm-6 mx-auto">
{{ form_row(sectionForm.title) }}
{{ form_label(sectionForm.title) }}
{{ form_widget(sectionForm.title) }}
{{ form_errors(sectionForm.title) }}
</div>
<div class="col-sm-6 mx-auto">
<div class="col-sm-4 mx-auto">
{{ form_row(sectionForm.description) }}
</div>
</div>
<div class="row">
<div class="col-sm-12">
{{ form_row(sectionForm.contenido) }}
<div class="col-sm-11 mx-auto">
{{ form_label(sectionForm.contenido) }}
{{ form_widget(sectionForm.contenido) }}
{{ form_errors(sectionForm.contenido) }}
</div>
</div>
<div class="row">
<div class="row mt-3">
<div class="col-sm-4 mx-auto">
{{ form_row(sectionForm.linkRoute) }}
</div>
Expand All @@ -41,7 +45,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-9 mx-auto">
<div class="col-sm-7 mx-auto">
{{ form_row(sectionForm.imageFile, {
attr: {
'placeholder': 'Seleccione una imagen para la sección'
Expand All @@ -52,27 +56,27 @@
{% if sectionForm.vars.data.imageFilename | default %}
<a href="{{ uploaded_asset(sectionForm.vars.data.imagePath) }}" target="_blank">
<img src="{{ sectionForm.vars.data.imagePath|imagine_filter('squared_thumbnail_small') }}" height="100"
alt="Imagen">
alt="{{ base.siteName }}">
</a>
{% endif %}
</div>
</div>
<div class="row">
<div class="row mt-3">
<div class="col-sm-4 mx-auto">
{{ form_row(sectionForm.cssClass) }}
</div>
<div class="col-sm-4 mx-auto">
{{ form_row(sectionForm.columns) }}
</div>
<div class="col-sm-4 mx-auto">
<div class="col-sm-2 mx-auto">
{{ form_row(sectionForm.orden) }}
</div>
</div>
<div class="row">
<div class="col-sm-4 mx-auto">
<div class="row mt-3">
<div class="col-sm-3 mx-auto">
{{ form_row(sectionForm.disponibleAt) }}
</div>
<div class="col-sm-4 mx-auto">
<div class="col-sm-3 mx-auto">
{{ form_row(sectionForm.disponibleHastaAt) }}
</div>
<div class="col-sm-4 mx-auto">
Expand All @@ -84,5 +88,6 @@
{{ form_widget(sectionForm._token) }}

<button class="btn btn-primary btn--pill">{{ button_label|default('Guardar') }}</button>
<a class="btn btn-info btn--pill" href="{{ path('admin_section_list') }}">Cancelar</a>
{{ form_end(sectionForm, {'render_rest': true}) }}
{# {{ form_end(sectionForm) }} #}
26 changes: 25 additions & 1 deletion templates/section_admin/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
{% extends 'base_admin.html.twig' %}
{% extends 'base_admin_board.html.twig' %}
{% block title %}Secciones {{ base.siteName }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
{{ encore_entry_link_tags('select2') }}
<style>
.custom-file-input ~ .custom-file-label.custom-file-label::after {
content: "Elegir imagen";
color: #fff;
background-color: #9c27b0;
top: 10px;
box-shadow: 0 2px 2px 0 rgba(156, 39, 176, 0.14), 0 3px 1px -2px rgba(156, 39, 176, 0.2), 0 1px 5px 0 rgba(156, 39, 176, 0.12);
position: absolute;
/*padding: 3px 9px;*/
/*margin: auto 1px;*/
font-size: .75rem;
font-weight: 400;
/*line-height: 1.428571;*/
text-decoration: none;
text-transform: uppercase;
letter-spacing: 0;
cursor: pointer;
border: 0 currentcolor;
border-radius: 0.2rem;
outline: 0;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
will-change: box-shadow, transform;
}
</style>
{% endblock %}
{% block javascripts %}
{{ parent() }}
Expand Down

0 comments on commit 77ffba8

Please sign in to comment.