adding a basic search page, which create event list

ref #10
ref #18
This commit is contained in:
2016-03-22 17:01:25 +01:00
parent b89ed5d534
commit 55a2c66793
10 changed files with 402 additions and 7 deletions

View File

@@ -1,4 +0,0 @@
services:
# chill_event.example:
# class: Chill\EventBundle\Example
# arguments: [@service_id, "plain_value", %parameter%]

View File

@@ -0,0 +1,8 @@
services:
chill_event.event_voter:
class: Chill\EventBundle\Security\Authorization\EventVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: chill.role }
- { name: security.voter }

View File

@@ -0,0 +1,6 @@
services:
chill_group.repository.event:
class: Doctrine\ORM\EntityRepository
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments:
- 'Chill\EventBundle\Entity\Event'

View File

@@ -0,0 +1,11 @@
services:
chill_event.search_events:
class: Chill\EventBundle\Search\EventSearch
arguments:
- "@security.token_storage"
- "@chill_group.repository.event"
- "@chill.main.security.authorization.helper"
- "@templating"
tags:
- { name: chill.search, alias: 'event_regular' }

View File

@@ -0,0 +1,11 @@
#events
Name: Nom
Date: Date
Event type : Type d'événement
See: Voir
#search
Event search: Recherche d'événements
'%total% events match the search %pattern%' : '{0} Aucun événement ne correspond aux termes de recherche "%pattern%" | {1} Un événement a été trouvé par la recherche "%pattern%" | ]1,Inf] %total% événements correspondent aux termes de recherche "%pattern%".'

View File

@@ -0,0 +1,43 @@
<h2>{{ 'Event search'|trans }}</h2>
<p>{% transchoice total with { '%pattern%' : pattern } %}%total% events match the search %pattern%{% endtranschoice %}</p>
{% if events|length > 0 %}
<table>
<thead>
<tr>
<th class="chill-red">{{ 'Name'|trans }}</th>
<th class="chill-green">{{ 'Date'|trans }}</th>
<th class="chill-orange">{{ 'Event type'|trans }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for event in events %}
<tr>
<td>{{ event.label }}</td>
<td>{{ event.date|localizeddate('long', 'none') }}</td>
<td>{{ event.type.label|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
{% if is_granted('CHILL_EVENT_SEE_DETAILS', event) %}
<a href="#" class="sc-button btn-action">
{{ 'See'|trans }}
</a>
{% endif %}
{% if is_granted('CHILL_EVENT_UPDATE', event) %}
<a href="#" class="sc-button btn-edit">
{{ 'Edit'|trans }}
</a>
{% endif %}
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}