Event CRUD generated

This commit is contained in:
Marc Ducobu
2016-03-22 17:16:19 +01:00
parent acd25fc57b
commit 4d02314770
9 changed files with 466 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
chill_event_event:
resource: "@ChillEventBundle/Resources/config/routing/event.yml"
prefix: /event
chill_event_fr_admin_event_status:
resource: "@ChillEventBundle/Resources/config/routing/status.yml"
prefix: /{_locale}/admin/event/status

View File

@@ -0,0 +1,30 @@
event:
path: /
defaults: { _controller: "ChillEventBundle:Event:index" }
event_show:
path: /{id}/show
defaults: { _controller: "ChillEventBundle:Event:show" }
event_new:
path: /new
defaults: { _controller: "ChillEventBundle:Event:new" }
event_create:
path: /create
defaults: { _controller: "ChillEventBundle:Event:create" }
methods: POST
event_edit:
path: /{id}/edit
defaults: { _controller: "ChillEventBundle:Event:edit" }
event_update:
path: /{id}/update
defaults: { _controller: "ChillEventBundle:Event:update" }
methods: [POST, PUT]
event_delete:
path: /{id}/delete
defaults: { _controller: "ChillEventBundle:Event:delete" }
methods: [POST, DELETE]

View File

@@ -0,0 +1,16 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Event edit</h1>
{{ form(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('event') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,43 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Event list</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('event_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td>
<td>{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}</td>
<td>
<ul>
<li>
<a href="{{ path('event_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('event_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<li>
<a href="{{ path('event_new') }}">
Create a new entry
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,15 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Event creation</h1>
{{ form(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('event') }}">
Back to the list
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Event</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Label</th>
<td>{{ entity.label }}</td>
</tr>
<tr>
<th>Date</th>
<td>{{ entity.date|date('Y-m-d H:i:s') }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('event') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('event_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}