sonata_doctrine_orm_admin:
    templates:
        types:
            show: # or "list"
                json: '@kohinos/bundles/SonataAdminBundle/show_json.html.twig'

sonata_admin:
    persist_filters: true
    security:
        # handler: sonata.admin.security.handler.role
        handler: app.security.handler.role
        role_admin: ROLE_ADMIN
        role_super_admin: ROLE_SUPER_ADMIN
    title: 'Admin'
    title_logo: /images/logo.png
    # Pour modifier l'image par défaut sur la vue "Mosaique" de l'administration
    # options:
    #     mosaic_background: '/path/to/image.png' # or use base64
    templates:
        layout:                         '@kohinos/bundles/SonataAdminBundle/standard_layout.html.twig'
        #outer_list_rows_mosaic:          '@kohinos/bundles/SonataAdminBundle/list_outer_rows_mosaic.html.twig'
        # ajax:                           '@kohinos/bundles/SonataAdminBundle/ajax_layout.html.twig'
        list:                           '@kohinos/bundles/SonataAdminBundle/CRUD/list.html.twig'
        # show:                           '@kohinos/bundles/SonataAdminBundle/CRUD/show.html.twig'
        # show_compare:                   '@kohinos/bundles/SonataAdminBundle/CRUD/show_compare.html.twig'
        # edit:                           '@kohinos/bundles/SonataAdminBundle/CRUD/edit.html.twig'
        # history:                        '@kohinos/bundles/SonataAdminBundle/CRUD/history.html.twig'
        # preview:                        '@kohinos/bundles/SonataAdminBundle/CRUD/preview.html.twig'
        # delete:                         '@kohinos/bundles/SonataAdminBundle/CRUD/delete.html.twig'
        # batch:                          '@kohinos/bundles/SonataAdminBundle/CRUD/list__batch.html.twig'
        # acl:                            '@kohinos/bundles/SonataAdminBundle/CRUD/acl.html.twig'
        # action:                         '@kohinos/bundles/SonataAdminBundle/CRUD/action.html.twig'
        # select:                         '@kohinos/bundles/SonataAdminBundle/CRUD/list__select.html.twig'
        # filter:                         '@kohinos/bundles/SonataAdminBundle/Form/filter_admin_fields.html.twig'
        dashboard:                      '@kohinos/bundles/SonataAdminBundle/dashboard.html.twig'
        # search:                         '@kohinos/bundles/SonataAdminBundle/Core/search.html.twig'
        # batch_confirmation:             '@kohinos/bundles/SonataAdminBundle/CRUD/batch_confirmation.html.twig'
        # inner_list_row:                 '@kohinos/bundles/SonataAdminBundle/CRUD/list_inner_row.html.twig'
        # base_list_field:                '@kohinos/bundles/SonataAdminBundle/CRUD/base_list_field.html.twig'
        list_block:                     '@kohinos/bundles/SonataAdminBundle/Block/block_admin_list.html.twig'
        user_block:                     '@kohinos/bundles/SonataUserBundle/Core/user_block.html.twig'
        # add_block:                      '@kohinos/bundles/SonataAdminBundle/Core/add_block.html.twig'
        # pager_links:                    '@kohinos/bundles/SonataAdminBundle/Pager/links.html.twig'
        # pager_results:                  '@kohinos/bundles/SonataAdminBundle/Pager/results.html.twig'
        # tab_menu_template:              '@kohinos/bundles/SonataAdminBundle/Core/tab_menu_template.html.twig'
        # history_revision_timestamp:     '@kohinos/bundles/SonataAdminBundle/CRUD/history_revision_timestamp.html.twig'
        # short_object_description:       '@kohinos/bundles/SonataAdminBundle/Helper/short-object-description.html.twig'
        # search_result_block:            '@kohinos/bundles/SonataAdminBundle/Block/block_search_result.html.twig'
        # action_create:                  '@kohinos/bundles/SonataAdminBundle/CRUD/dashboard__action_create.html.twig'
        # button_acl:                     '@kohinos/bundles/SonataAdminBundle/Button/acl_button.html.twig'
        # button_create:                  '@kohinos/bundles/SonataAdminBundle/Button/create_button.html.twig'
        # button_edit:                    '@kohinos/bundles/SonataAdminBundle/Button/edit_button.html.twig'
        # button_history:                 '@kohinos/bundles/SonataAdminBundle/Button/history_button.html.twig'
        # button_list:                    '@kohinos/bundles/SonataAdminBundle/Button/list_button.html.twig'
        # button_show:                    '@kohinos/bundles/SonataAdminBundle/Button/show_button.html.twig'
    assets:
        stylesheets:
            # The default stylesheet list:
            # - build/app.css
            - bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css
            - bundles/sonatacore/vendor/components-font-awesome/css/font-awesome.min.css
            # - fontawesome/css/fontawesome.min.css
            # - fontawesome/css/solid.css
            # - fontawesome/css/brands.css
            # - public/fontawesome/css/v4-shims.css
            - bundles/sonatacore/vendor/ionicons/css/ionicons.min.css
            # Suppression de la référence à AdminLTE.min.css pour éviter les requêtes Google Fonts
            - bundles/sonataadmin/vendor/admin-lte/dist/css/skins/skin-black.min.css
            - bundles/sonataadmin/vendor/iCheck/skins/square/blue.css
            - bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css
            - bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css
            - bundles/sonatacore/vendor/select2/select2.css
            - bundles/sonatacore/vendor/select2-bootstrap-css/select2-bootstrap.min.css
            - bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css
            - bundles/sonataadmin/css/styles.css
            - bundles/sonataadmin/css/layout.css
            - bundles/sonataadmin/css/tree.css
            - bundles/sonataadmin/css/colors.css

        extra_stylesheets:
            - css/source-sans-pro-local.css
            - css/adminlte-no-google-fonts.css
            - build/admin.css
        # javascript paths to add to the page in addition to the list above
        extra_javascripts:
            # - fontawesome/js/all.js
            # - public/fontawesome/js/v4-shims.js
    dashboard:
        # DASHBOARD de l'admin
        #
        # Layout :
        #
        # TOP     TOP     TOP

        #  LEFT CENTER RIGHT
        #  LEFT CENTER RIGHT
        #  LEFT CENTER RIGHT

        # BOTTOM BOTTOM BOTTOM
        blocks:
            -
                type: admin.block.dashboard
                position: top
                class:    col-xs-12 col-md-12
            -
                type: admin.block.charts
                position: center
            # DO NOT SHOW THE BASIC ADMIN LIST
            # -
            #     class:    col-xs-12 col-md-12
            #     position: bottom
            #     type: sonata.admin.block.admin_list
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', ROLE_ADMIN_ADHERENT_GERER_ALL', 'ROLE_ADMIN_ADHERENT_GERER_LIST', 'ROLE_ADMIN_ADHERENT_GERER_CREATE']
                settings:
                    code: admin.adherent.gerer
                    icon: fas fa-user
                    text: Adherents
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
                        # _per_page: { value: 32 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_PRESTATAIRE_GERER_ALL', 'ROLE_ADMIN_PRESTATAIRE_GERER_LIST', 'ROLE_ADMIN_PRESTATAIRE_GERER_CREATE']
                settings:
                    code: admin.prestataire.gerer
                    icon: fas fa-shopping-basket
                    text: Prestataires
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_GROUPE_GERER_ALL', 'ROLE_ADMIN_GROUPE_GERER_LIST', 'ROLE_ADMIN_GROUPE_GERER_CREATE']
                settings:
                    code: admin.groupe.gerer
                    icon: fa fa-object-group
                    text: Groupes
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_COMPTOIR_GERER_ALL', 'ROLE_ADMIN_COMPTOIR_GERER_LIST', 'ROLE_ADMIN_COMPTOIR_GERER_CREATE']
                settings:
                    code: admin.comptoir.gerer
                    icon: fa fa-home
                    text: Comptoirs
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_NEWS_GERER_ALL', 'ROLE_ADMIN_NEWS_GERER_LIST', 'ROLE_ADMIN_NEWS_GERER_CREATE']
                settings:
                    code: admin.news.gerer
                    icon: fa fa-newspaper-o
                    text: Actualités
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_PAGE_GERER_ALL', 'ROLE_ADMIN_PAGE_GERER_LIST', 'ROLE_ADMIN_PAGE_GERER_CREATE']
                settings:
                    code: admin.page.gerer
                    icon: fa fa-file-image-o
                    text: Pages
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_FAQ_GERER_ALL', 'ROLE_ADMIN_FAQ_GERER_LIST', 'ROLE_ADMIN_FAQ_GERER_CREATE']
                settings:
                    code: admin.faq.gerer
                    icon: fa fa-question
                    text: FAQ
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            -
                type:     sonata.admin.block.stats
                position: top
                class:    col-xs-6 col-md-3
                roles:    ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_DOCUMENT_GERER_ALL', 'ROLE_ADMIN_DOCUMENT_GERER_LIST', 'ROLE_ADMIN_DOCUMENT_GERER_CREATE']
                settings:
                    code: admin.document.gerer
                    icon: fa fa-file
                    text: Documents
                    color: bg-info
                    filters:
                        enabled: { value: 1 }
            # -
            #   type: sonata.block.service.text
            #   position: right
            #   settings:
            #         content: >
            #             <h2>Bienvenue sur l'administration de votre Monnaie Locale Complémentaire !</h2>
            #             :
             # Exemple de block de stats
             # -
             #    type:     sonata.admin.block.stats   # block id
             #    position: top                        # zone in the dashboard
             #    class:    col-lg-3 col-xs-6          # twitter bootstrap responsive code
             #    settings:
             #        code:  sonata.page.admin.page    # admin code - service id
             #        icon:  fa-magic                  # font awesome icon
             #        text:  Edited Pages
             #        color: bg-yellow                 # colors: bg-green, bg-red and bg-aqua
             #        filters:                         # filter values
             #            edited: { value: 1 }         # filtre on admin (settings:code)

        groups:
            sonata.admin.group.users:
                keep_open:       false
                label:           "Utilisateurs"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-users"></i>'
                items:
                    - sonata.user.admin.user
                    - sonata.user.admin.group
            # sonata.admin.group.media:
            #     keep_open:       false
            #     label:           Média
            #     label_catalogue: SonataAdminBundle
            #     icon:            '<i class="fa fa-image"></i>'
            #     items:
            #         - sonata.media.admin.media
            #         - sonata.media.admin.gallery
            sonata.admin.group.adherent:
                keep_open:       false
                label:           "Adhérents"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-address-card"></i>'
                items:
                    - route:        adherent_create
                      label:        Ajouter
                      roles:        ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_ADHERENT_GERER_ALL', 'ROLE_ADMIN_ADHERENT_GERER_CREATE']
                    - admin.adherent.gerer
                    - admin.adherent.cotisations
            sonata.admin.group.prestataire:
                keep_open:       false
                label:           "Prestataires"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-shopping-basket"></i>'
                items:
                    - route:        prestataire_create
                      label:        Ajouter
                      roles:        ['ROLE_SUPER_ADMIN', 'ROLE_ADMIN_PRESTATAIRE_GERER_ALL', 'ROLE_ADMIN_PRESTATAIRE_GERER_CREATE']
                    - admin.prestataire.gerer
                    - admin.prestataire.cotisations
                    - admin.groupepresta.gerer
                    - admin.etatpresta.gerer
                    - admin.rubrique.gerer
            sonata.admin.group.groupe:
                on_top:          true
                label:           "Groupes locaux"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-object-group"></i>'
                items:
                    - admin.groupe.gerer
            sonata.admin.group.comptoir:
                on_top:          true
                label:           "Comptoirs"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-home"></i>'
                items:
                    - admin.comptoir.gerer
            sonata.admin.group.operation:
                keep_open:       false
                label:           "Trésorerie"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-euro"></i>'
                items:
                    # - admin.operation.gerer
                    - admin.operation.adherent.gerer
                    - admin.operation.prestataire.gerer
                    - admin.operation.groupe.gerer
                    - admin.operation.comptoir.gerer
                    - admin.operation.siege.gerer
            sonata.admin.group.achat:
                on_top:          true
                label:           "Achats à valider"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-shopping-cart"></i>'
                items:
                    - admin.all.demande.achatsmonnaie
            sonata.admin.group.flux:
                keep_open:       false
                label:           "Flux / Actions"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-bank"></i>'
                items:
                    - admin.flux.gerer
                    - admin.flux.ssa
                    - admin.flux.euros
                    - admin.all.cotisations
                    - admin.all.achatsmonnaie
                    - admin.dons
                    - admin.transfert.gerer
                    - admin.transaction.gerer
                    - admin.reconversion.gerer
            sonata.admin.group.sepa:
                keep_open:       false
                label:           "Prélèvements SEPA"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-credit-card"></i>'
                items:
                    - admin.sepa.mandate
                    - admin.sepa.mlc_subscription
                    - admin.sepa.ssa_subscription
                    - admin.sepa.purchase
            sonata.admin.group.contenu:
                keep_open:       false
                on_top:          false
                label:           "Contenu"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-newspaper-o"></i>'
                items:
                    - admin.news.gerer
                    - admin.document.gerer
                    - admin.page.gerer
                    - admin.faq.gerer
                    - admin.traduction.gerer
            sonata.admin.group.menu_builder:
                keep_open:       false
                label:           "Menus"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-magic"></i>'
                items:
                    - App\MenuBundle\Admin\MenuAdmin
                    - App\MenuBundle\Admin\MenuItemAdmin
            sonata.admin.group.import:
                keep_open:       false
                on_top:          true
                label:           "Import"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-upload"></i>'
                items:
                    - admin.import
            sonata.admin.group.email:
                keep_open:       false
                label:           "Emails"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-envelope"></i>'
                roles:           ['ROLE_SUPER_ADMIN', 'ROLE_TRESORIER']
                items:
                    - admin.email.log
                    - route: admin_email_template_list
                      label: "Templates d'emails"
            sonata.admin.group.rgpd:
                keep_open:       false
                label:           "RGPD"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-shield"></i>'
                roles:           ['ROLE_SUPER_ADMIN']
                items:
                    - admin.audit.log
                    - admin.gdpr.request
                    - admin.gdpr.consent
            sonata.admin.group.globalparameter:
                keep_open:       false
                on_top:          false
                label:           "Configuration"
                label_catalogue: SonataAdminBundle
                icon:            '<i class="fa fa-cogs"></i>'
                items:
                    - admin.globalparameter.gerer
                    - route: admin_branding_index
                      label: "Logo, Favicon"
                roles:           ['ROLE_SUPER_ADMIN']

        # Gérer l'affichage du menu de l'admin en fonction des roles
        # groups:
        #     app.admin.group.content:
        #         label: app.admin.group.content
        #         label_catalogue: App
        #         items:
        #             - app.admin.post
        #         roles: [ ROLE_ONE, ROLE_TWO ]
    options:
        legacy_twig_text_extension: false
        use_select2: true

sonata_block:
    blocks:
        sonata.admin.block.admin_list:
            contexts: [admin]
