Skip to content

Commit

Permalink
Agregando artefact para site
Browse files Browse the repository at this point in the history
  • Loading branch information
gerMdz committed Aug 21, 2022
1 parent 89363ff commit 9c5b31c
Show file tree
Hide file tree
Showing 18 changed files with 679 additions and 168 deletions.
80 changes: 0 additions & 80 deletions .github/workflows/ci.yaml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/lint.yaml

This file was deleted.

35 changes: 35 additions & 0 deletions src/Form/AddressType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace App\Form;

use App\Entity\Address;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class AddressType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('address_text')
->add('address2')
->add('address3')
->add('district')
->add('location')
->add('state')
->add('country')
->add('city')
->add('postal_code')
->add('createdAt')
->add('updatedAt')
;
}

public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Address::class,
]);
}
}
32 changes: 32 additions & 0 deletions src/Form/SiteParamsType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Form;

use App\Entity\SiteParams;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class SiteParamsType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('url')
->add('name')
->add('email_contact')
->add('title')
->add('description')
->add('image')
->add('type')
->add('author')
;
}

public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => SiteParams::class,
]);
}
}
4 changes: 4 additions & 0 deletions templates/address/_delete_form.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_address_delete', {'id': address.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ address.id) }}">
<button class="btn">Delete</button>
</form>
4 changes: 4 additions & 0 deletions templates/address/_form.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
13 changes: 13 additions & 0 deletions templates/address/edit.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}

{% block title %}Edit Address{% endblock %}

{% block body %}
<h1>Edit Address</h1>

{{ include('address/_form.html.twig', {'button_label': 'Update'}) }}

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

{{ include('address/_delete_form.html.twig') }}
{% endblock %}
55 changes: 55 additions & 0 deletions templates/address/index.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% extends 'base.html.twig' %}

{% block title %}Address index{% endblock %}

{% block body %}
<h1>Address index</h1>

<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Address_text</th>
<th>Address2</th>
<th>Address3</th>
<th>District</th>
<th>Location</th>
<th>State</th>
<th>Country</th>
<th>City</th>
<th>Postal_code</th>
<th>CreatedAt</th>
<th>UpdatedAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for address in addresses %}
<tr>
<td>{{ address.id }}</td>
<td>{{ address.addressText }}</td>
<td>{{ address.address2 }}</td>
<td>{{ address.address3 }}</td>
<td>{{ address.district }}</td>
<td>{{ address.location }}</td>
<td>{{ address.state }}</td>
<td>{{ address.country }}</td>
<td>{{ address.city }}</td>
<td>{{ address.postalCode }}</td>
<td>{{ address.createdAt ? address.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ address.updatedAt ? address.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>
<a href="{{ path('app_address_show', {'id': address.id}) }}">show</a>
<a href="{{ path('app_address_edit', {'id': address.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="13">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>

<a href="{{ path('app_address_new') }}">Create new</a>
{% endblock %}
11 changes: 11 additions & 0 deletions templates/address/new.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}

{% block title %}New Address{% endblock %}

{% block body %}
<h1>Create new Address</h1>

{{ include('address/_form.html.twig') }}

<a href="{{ path('app_address_index') }}">back to list</a>
{% endblock %}
66 changes: 66 additions & 0 deletions templates/address/show.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{% extends 'base.html.twig' %}

{% block title %}Address{% endblock %}

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

<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ address.id }}</td>
</tr>
<tr>
<th>Address_text</th>
<td>{{ address.addressText }}</td>
</tr>
<tr>
<th>Address2</th>
<td>{{ address.address2 }}</td>
</tr>
<tr>
<th>Address3</th>
<td>{{ address.address3 }}</td>
</tr>
<tr>
<th>District</th>
<td>{{ address.district }}</td>
</tr>
<tr>
<th>Location</th>
<td>{{ address.location }}</td>
</tr>
<tr>
<th>State</th>
<td>{{ address.state }}</td>
</tr>
<tr>
<th>Country</th>
<td>{{ address.country }}</td>
</tr>
<tr>
<th>City</th>
<td>{{ address.city }}</td>
</tr>
<tr>
<th>Postal_code</th>
<td>{{ address.postalCode }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ address.createdAt ? address.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>UpdatedAt</th>
<td>{{ address.updatedAt ? address.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
</tbody>
</table>

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

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

{{ include('address/_delete_form.html.twig') }}
{% endblock %}
Loading

0 comments on commit 9c5b31c

Please sign in to comment.