Skip to content

Commit

Permalink
Flashs & Selectize
Browse files Browse the repository at this point in the history
Add Selectize CSS
Move flash translation to flash.fr.xlf
add flash to putAction
  • Loading branch information
flecomte committed Aug 11, 2016
1 parent cbafe34 commit 9418a15
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Controller/ControllerAbstract.php
Expand Up @@ -282,6 +282,8 @@ protected function putEntityAction(Request $request, EntityInterface $entity, $r
$this->get('fos_elastica.index_manager')->getIndex('app')->refresh();
}

$this->addFlash('success', $className.'.flash.put.success');

if ($redirectRoute === null && $request->get('redirect') != null) {
$view->setLocation($request->get('redirect', $this->createRoute($entity, 'get', true)));
} else {
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -53,3 +53,11 @@ twig:
form_themes:
- 'FLECrudBundle::Form/fields.html.twig'
```


Usage
-----

```twig
{% extends 'FLECrudBundle::base.html.twig' %}
```
15 changes: 15 additions & 0 deletions Resources/public/less/selectize.less
@@ -0,0 +1,15 @@
/* Selectize */
.search form.navbar-form {
.selectize-control {
margin-right: 5px;
}
.selectize-input {
vertical-align: middle;
}
}
.selectize-control.single .selectize-input:after {
right: 8px;
}
.selectize-input {
padding-right: 25px;
}
13 changes: 12 additions & 1 deletion Resources/views/base.html.twig
Expand Up @@ -8,6 +8,7 @@
'@FLECrudBundle/Resources/public/less/base.less'
'@FLECrudBundle/Resources/public/less/search.less'
'@FLECrudBundle/Resources/public/less/select2.less'
'@FLECrudBundle/Resources/public/less/selectize.less'
%}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}
Expand Down Expand Up @@ -67,14 +68,24 @@
{% endif %}
{% endmacro %}

{% from 'MopaBootstrapBundle::flash.html.twig' import session_flash %}
{% block flashes %}
<div class="row flashs">
<div class="col-sm-12">
{% if app.session.flashbag.peekAll|length > 0 %}
{{ session_flash(null, null, null, 'flash') }}
{% endif %}
</div>
</div>
{% endblock flashes %}

{% block content_row %}
{% from _self import filter %}

<div class="row search">
{% block search %}
{% if filter is defined and filter is not null and filter.search is defined %}
{% form_theme filter '@FLECrudBundle/Resources/views/Form/filter.html.twig' %}
{% form_theme filter 'FLECrudBundle::Form/filter.html.twig' %}
{% if limit is not defined %}
{% set limit = true %}
{% endif %}
Expand Down

0 comments on commit 9418a15

Please sign in to comment.