Skip to content

Commit

Permalink
Merge pull request #26 from gerMdz/25-wizard-block
Browse files Browse the repository at this point in the history
Primer commit 25-wizard-block
  • Loading branch information
gerMdz authored Jun 24, 2021
2 parents 4fd7210 + 9beabbb commit 8be01c4
Show file tree
Hide file tree
Showing 26 changed files with 131 additions and 70 deletions.
33 changes: 29 additions & 4 deletions src/Form/TypeBlockType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use App\Entity\TypeBlock;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -12,10 +14,33 @@ class TypeBlockType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('description')
->add('identifier')
->add('isActive')
->add('name', TextType::class, [
'label' => 'Que nombre tendrá el nuevo TypeBlock?',
'attr' =>[
'class' => 'form-control'
],
])
->add('description', TextType::class, [
'label' => 'Agregue una descripción para el nuevo TypeBlock',
'attr' =>[
'class' => 'form-control'
],
])
->add('identifier', TextType::class, [
'label' => 'Agregue un identificador único para el nuevo TypeBlock',
'help' => 'En minúsculas y sin espacios, puede usar guiones medios "-"',
'attr' =>[
'class' => 'form-control'
],
])
->add('isActive', CheckboxType::class, [
'required' => false,
'label' => 'Activa el TypeBlock?',
'label_attr' => ['class' => 'form-check-label'],
'attr' => [
'class' => 'form-check-input text-dark',
],
])
;
}

Expand Down
2 changes: 1 addition & 1 deletion templates/base_admin_board.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>{% block title %} Bienvenido! {% endblock %} - {{ base.siteName }}</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<link rel="shortcut icon" href="{{ asset('/images/institucional/indice.png') }}" type="image/x-icon">
<link rel="shortcut icon" href="{{ asset('images/institucional/indice.png') }}" type="image/x-icon">
<!-- Fonts and icons -->
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('fonts/awesome/web-fonts-with-css/css/all.min.css') }}">
Expand Down
4 changes: 2 additions & 2 deletions templates/bases/_volver.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<button class="btn btn-sm btn-primary btn-round btn--pill">
<button class="btn btn-sm btn-secondary btn-round btn--pill">
<i class="fas fa-step-backward"></i>
{{ button_label | default('Volver al listado') }}
<small>{{ button_label | default('Volver al listado') }}</small>
</button>

2 changes: 1 addition & 1 deletion templates/button_link/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/channel_feed/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/comentario/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/contacto/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/derivada/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/enlace_corto/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/group_celebration/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/index_alameda/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/invitado/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/item_feed/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/meta_base/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/ministerio/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/model_template/_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 btn-primary">{{ button_label|default('Save') }}</button>
<button class="btn btn-primary">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/page_index/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/relacion_section_entrada/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/reservante/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/roles/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/tipo_contacto/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
2 changes: 1 addition & 1 deletion templates/type_block/_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 mx-auto">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}
4 changes: 2 additions & 2 deletions templates/type_block/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% extends 'base.html.twig' %}
{% extends 'base_admin_board.html.twig' %}

{% block title %}Edit TypeBlock{% endblock %}

{% block body %}
{% block content %}
<h1>Edit TypeBlock</h1>

{{ include('type_block/_form.html.twig', {'button_label': 'Update'}) }}
Expand Down
90 changes: 55 additions & 35 deletions templates/type_block/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
{% extends 'base.html.twig' %}
{% extends 'base_admin_board.html.twig' %}

{% block title %}TypeBlock index{% endblock %}

{% block body %}
<h1>TypeBlock index</h1>
{% block content %}
<div class="col-md-12">
<div class="card">
<div class="card-header card-header-primary">
<h4 class="card-title ">TypeBLock (Bloques Principales de AlamedaCMS)</h4>
<p class="card-category"> Listado </p>
</div>
<div class="card-body">
<div class="table-responsive">
<a href="{{ path('type_block_new') }}">
{{ include('bases/_crear_nuevo.html.twig') }}
</a>

<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
<th>Identifier</th>
<th>IsActive</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for type_block in type_blocks %}
<tr>
<td>{{ type_block.id }}</td>
<td>{{ type_block.name }}</td>
<td>{{ type_block.description }}</td>
<td>{{ type_block.identifier }}</td>
<td>{{ type_block.isActive ? 'Yes' : 'No' }}</td>
<td>
<a href="{{ path('type_block_show', {'id': type_block.id}) }}">show</a>
<a href="{{ path('type_block_edit', {'id': type_block.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<table class="table">
<thead class=" text-primary">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Descripción</th>
<th>Identificador</th>
<th class="text-center">Está Activo?</th>
<th><i class="fa fa-cogs"></i></th>
</tr>
</thead>
<tbody>
{% for type_block in type_blocks %}
<tr>
<td>{{ type_block.id }}</td>
<td>{{ type_block.name }}</td>
<td>{{ type_block.description }}</td>
<td>{{ type_block.identifier }}</td>
<td class="text-center text-primary">{{ type_block.isActive ? '<i class="fas fa-check-square"> </i>': '<i class="far fa-square"></i>' }}</td>
<td>
<a href="{{ path('type_block_show', {'id': type_block.id}) }}">
{% include 'bases/_ver.html.twig' %}
</a>
<a href="{{ path('type_block_edit', {'id': type_block.id}) }}">
{% include 'bases/_editar.html.twig' %}
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">No se encontraron Bloques</td>
</tr>
{% endfor %}
</tbody>
</table>

<a href="{{ path('type_block_new') }}">Create new</a>
<a href="{{ path('type_block_new') }}">
{% include 'bases/_crear_nuevo.html.twig' %}
</a>
</div>
</div>
</div>
</div>
{% endblock %}
28 changes: 22 additions & 6 deletions templates/type_block/new.html.twig
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{% extends 'base.html.twig' %}
{% extends 'base_admin_board.html.twig' %}

{% block title %}New TypeBlock{% endblock %}
{% block stylesheets %}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="{{ asset('bt5-softui-dash/css/soft-ui-dashboard.min.css') }}" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('fonts/awesome/web-fonts-with-css/css/all.min.css') }}">
{% endblock %}

{% block body %}
<h1>Create new TypeBlock</h1>
{% block title %}Nuevo TypeBlock{% endblock %}

{{ include('type_block/_form.html.twig') }}
{% block content %}
<div class="col-md-12">
<div class="card">
<div class="card-header card-header-primary py-1">
<h4 class="card-title ">TypeBLock (Bloques Principales de AlamedaCMS)</h4>
<p class="card-category"> Nuevo TypeBLock </p>
</div>
<div class="card-body">

<a href="{{ path('type_block_index') }}">back to list</a>
{{ include('type_block/_form.html.twig') }}
<a href="{{ path('type_block_index') }}" class="inline-block">
{% include 'bases/_volver.html.twig' %}
</a>
</div>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/user/_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">{{ button_label|default('Guardar') }}</button>
{{ form_end(form) }}

0 comments on commit 8be01c4

Please sign in to comment.