Commit fa459852883caa5178e6132d232852efffe5ff5a
1 parent
eac6c16ba7
Exists in
feature/juan
utilizacion de html twig en plantillas
Showing
3 changed files
with
118 additions
and
18 deletions
Show diff stats
app/Resources/views/ambiente/index.html.twig
1 | 1 | {% extends 'base.html.twig' %} |
2 | 2 | |
3 | + | |
3 | 4 | {% block body %} |
5 | +{% for type, flashMessage in app.session.flashbag.all() %} | |
6 | +<div class="alert alert-{{ type }} fade in"> | |
7 | +<button class="close" data-dismiss="alert" type="button">×</button> | |
8 | +{% if flashMessage.title is defined %} | |
9 | +<strong>{{ flashMessage.title }}</strong> | |
10 | +{{ flashMessage.message }} | |
11 | +{% else %} | |
12 | +{{ type }} | |
13 | +{% endif %} | |
14 | +</div> | |
15 | +{% endfor %} | |
16 | + | |
17 | + | |
4 | 18 | <h1>Ambientes list</h1> |
5 | 19 | |
6 | - <table> | |
7 | - <thead> | |
20 | + <div class="table-responsive"> | |
21 | + <table class="table"> | |
22 | + <thead> | |
23 | + | |
8 | 24 | <tr> |
9 | - <th>Id</th> | |
10 | - <th>Descripcion</th> | |
11 | - <th>Codigo</th> | |
25 | + <th>Id</th> | |
26 | + <th>Descripcion</th> | |
27 | + <th>Codigo</th> | |
12 | 28 | <th>Direccion</th> |
13 | 29 | <th>Coordenadautmnorte</th> |
14 | 30 | <th>Coordenadautmoeste</th> |
15 | 31 | <th>Actions</th> |
16 | - </tr> | |
32 | + | |
17 | 33 | </thead> |
18 | 34 | <tbody> |
19 | 35 | {% for ambiente in ambientes %} |
... | ... | @@ -27,21 +43,26 @@ |
27 | 43 | <td> |
28 | 44 | <ul> |
29 | 45 | <li> |
30 | - <a href="{{ path('ambiente_show', { 'id': ambiente.id }) }}">show</a> | |
46 | + <a class="btn btn-default" href="{{ path('ambiente_show', { 'id': ambiente.id }) }}">show</a> | |
31 | 47 | </li> |
32 | 48 | <li> |
33 | - <a href="{{ path('ambiente_edit', { 'id': ambiente.id }) }}">edit</a> | |
49 | + <a class="btn btn-default" href="{{ path('ambiente_edit', { 'id': ambiente.id }) }}">edit</a> | |
34 | 50 | </li> |
35 | 51 | </ul> |
36 | 52 | </td> |
37 | 53 | </tr> |
38 | 54 | {% endfor %} |
39 | 55 | </tbody> |
40 | - </table> | |
41 | - | |
56 | + </table> | |
57 | +</div> | |
42 | 58 | <ul> |
43 | - <li> | |
44 | - <a href="{{ path('ambiente_new') }}">Create a new ambiente</a> | |
59 | + <br> | |
60 | + <br> | |
61 | + <br> | |
62 | + | |
63 | + <a class="btn btn-default" href="{{ path('ambiente_new') }}">Agregar</a> | |
64 | + <br> | |
65 | + <br> | |
45 | 66 | </li> |
46 | 67 | </ul> |
47 | 68 | {% endblock %} | ... | ... |
app/Resources/views/ambiente/new.html.twig
1 | 1 | {% extends 'base.html.twig' %} |
2 | 2 | |
3 | 3 | {% block body %} |
4 | - <h1>Ambiente creation</h1> | |
5 | 4 | |
6 | - {{ form_start(form) }} | |
5 | + <h1>Creacion del Ambiente</h1> | |
6 | + | |
7 | + {#{{ form_start(form) }} | |
7 | 8 | {{ form_widget(form) }} |
8 | 9 | <input type="submit" value="Create" /> |
9 | - {{ form_end(form) }} | |
10 | + {{ form_end(form) }}#} | |
11 | + | |
12 | + {{ form_start(form, {'attr': {'novalidate': 'novalidate'}, 'action': path('ambiente_new')}) }} | |
13 | + | |
14 | + <form class="form-inline"> | |
15 | + <div class="form-group"> | |
16 | + {{ form_label(form.descripcion) }} | |
17 | + {{ form_widget(form.descripcion) }} | |
18 | +</div> | |
19 | +</div class="form-group"> | |
20 | + | |
21 | +{% if form.descripcion.vars.errors[0].message is defined %} | |
22 | +<span class="help-block"> | |
23 | +{{ form.descripcion.vars.errors[0].message }} | |
24 | +</span> | |
25 | + | |
26 | +{% endif %} | |
27 | + | |
28 | + <form class="form-inline"> | |
29 | + <div class="form-group"> | |
30 | + {{ form_label(form.codigo) }} | |
31 | + {{ form_widget(form.codigo) }} | |
32 | +</div> | |
33 | + <div class="form-group"> | |
34 | +{% if form.codigo.vars.errors[0].message is defined %} | |
35 | +<span class="help-block"> | |
36 | +{{ form.codigo.vars.errors[0].message }} | |
37 | +</span> | |
38 | + | |
39 | +{% endif %} | |
40 | + | |
41 | +<form class="form-inline"> | |
42 | + <div class="form-group"> | |
43 | + {{ form_label(form.direccion) }} | |
44 | + {{ form_widget(form.direccion) }} | |
45 | +</div> | |
46 | + <div class="form-group"> | |
47 | + {% if form.direccion.vars.errors[0].message is defined %} | |
48 | +<span class="help-block"> | |
49 | +{{ form.direccion.vars.errors[0].message }} | |
50 | +</span> | |
51 | + | |
52 | + | |
53 | +{% endif %} | |
54 | +<form class="form-inline"> | |
55 | + <div class="form-group"> | |
56 | + {{ form_label(form.coordenadaUtmNorte) }} | |
57 | + {{ form_widget(form.coordenadaUtmNorte) }} | |
58 | +</div> | |
59 | + <div class="form-group"> | |
60 | +{% if form.coordenadaUtmNorte.vars.errors[0].message is defined %} | |
61 | +<span class="help-block"> | |
62 | +{{ form.coordenadaUtmNorte.vars.errors[0].message }} | |
63 | +</span> | |
10 | 64 | |
11 | - <ul> | |
12 | - <li> | |
13 | - <a href="{{ path('ambiente_index') }}">Back to the list</a> | |
65 | + | |
66 | +{% endif %} | |
67 | +<form class="form-inline"> | |
68 | + <div class="form-group"> | |
69 | + {{ form_label(form.coordenadaUtmOeste) }} | |
70 | + {{ form_widget(form.coordenadaUtmOeste) }} | |
71 | +</div> | |
72 | + <div class="form-group"> | |
73 | +{% if form.coordenadaUtmOeste.vars.errors[0].message is defined %} | |
74 | +<span class="help-block"> | |
75 | +{{ form.coordenadaUtmOeste.vars.errors[0].message }} | |
76 | +</span> | |
77 | + | |
78 | + | |
79 | +{% endif %} | |
80 | + | |
81 | + <u1> | |
82 | + <li> | |
83 | + | |
84 | + <input type="submit" value="Crear"/> | |
85 | + {{form_end(form)}} | |
86 | + | |
87 | + {#<a class="btn btn-default" href="{{ path('ambiente_index') }}">Crear</a>#} | |
88 | + <a class="btn btn-default" href="{{ path('ambiente_index') }}">Volver al Listado</a> | |
14 | 89 | </li> |
15 | 90 | </ul> |
16 | 91 | {% endblock %} |
92 | + | |
93 | + | |
94 | + | ... | ... |