Skip to content

Commit f8a1bca

Browse files
committed
Ajout d'une thématisation des events
1 parent 711c758 commit f8a1bca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1009
-105
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ jobs:
139139
composer-options: "--no-scripts"
140140

141141
- name: Rector
142-
run: make rector
142+
run: make rector

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test-functional: data config htdocs/uploads tmp
9797
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher
9898
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) up -d dbtest apachephptest mailcatcher
9999
make clean-test-deprecated-log
100-
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm -u localUser apachephp ./bin/behat
100+
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm -u localUser apachephp ./bin/behat --colors
101101
make var/logs/test.deprecations_grouped.log
102102
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher
103103

app/config/config.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/config/config.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
imports:
2-
- { resource: config.php }
32
- { resource: security.yml }
43
- { resource: services.yml }
54
- { resource: packages/http_client.yaml }
@@ -160,6 +159,14 @@ parameters:
160159
forum_sessions:
161160
nom: 'Conférences'
162161
niveau: 'ROLE_FORUM'
162+
admin_event_themes_list:
163+
nom: 'Thèmes'
164+
niveau: 'ROLE_FORUM'
165+
url: '/admin/event/themes'
166+
extra_routes:
167+
- admin_event_themes_list
168+
- admin_event_themes_add
169+
- admin_event_themes_edit
163170
forum_vote_github:
164171
nom: 'Votes visiteurs'
165172
niveau: 'ROLE_FORUM'
@@ -315,7 +322,7 @@ framework:
315322
fallbacks: ["%locale%"]
316323
enabled: true
317324
default_path: "%kernel.project_dir%/../translations"
318-
secret: "%secret%"
325+
secret: "%env(SECRET)%"
319326
router:
320327
resource: "%kernel.project_dir%/config/routing.yml"
321328
strict_requirements: ~
@@ -351,7 +358,7 @@ twig:
351358
strict_variables: "%kernel.debug%"
352359
globals:
353360
photo_storage: '@AppBundle\CFP\PhotoStorage'
354-
global_menu_event_label: '%afup_global_menu_event_label%'
361+
global_menu_event_label: '%env(AFUP_GLOBAL_MENU_EVENT_LABEL)%'
355362
form_themes: ['form_theme.html.twig']
356363
exception_controller: null
357364
default_path: "%kernel.project_dir%/../templates"
@@ -363,9 +370,9 @@ ting:
363370
charset: utf8mb4
364371
master:
365372
host: "%database_host%"
366-
port: "%database_port%"
367-
user: "%database_user%"
368-
password: "%database_password%"
373+
port: "%env(int:DATABASE_PORT)%"
374+
user: "%env(DATABASE_USER)%"
375+
password: "%env(DATABASE_PASSWORD)%"
369376

370377
repositories:
371378
event:
@@ -374,50 +381,50 @@ ting:
374381
options:
375382
default:
376383
connection: main
377-
database: '%database_name%'
384+
database: '%env(DATABASE_NAME)%'
378385
site:
379386
namespace : AppBundle\Site\Model\Repository
380387
directory : "@AppBundle/Site/Model/Repository"
381388
options:
382389
default:
383390
connection: main
384-
database: '%database_name%'
391+
database: '%env(DATABASE_NAME)%'
385392

386393
association:
387394
namespace : AppBundle\Association\Model\Repository
388395
directory : "@AppBundle/Association/Model/Repository"
389396
options:
390397
default:
391398
connection: main
392-
database: '%database_name%'
399+
database: '%env(DATABASE_NAME)%'
393400
throttling:
394401
namespace : AppBundle\Security\ActionThrottling
395402
directory : "@AppBundle/Security/ActionThrottling"
396403
options:
397404
default:
398405
connection: main
399-
database: '%database_name%'
406+
database: '%env(DATABASE_NAME)%'
400407
techletter:
401408
namespace: AppBundle\TechLetter\Model\Repository
402409
directory: "@AppBundle/TechLetter/Model/Repository"
403410
options:
404411
default:
405412
connection: main
406-
database: "%database_name%"
413+
database: "%env(DATABASE_NAME)%"
407414

408415
knpu_oauth2_client:
409416
clients:
410417
# will create a service: knpu.oauth2.client.facebook_main
411418
github_main:
412419
type: github
413-
client_id: "%github_client_id%"
414-
client_secret: "%github_client_secret%"
420+
client_id: "%env(GITHUB_CLIENT_ID)%"
421+
client_secret: "%env(GITHUB_CLIENT_SECRET)%"
415422
# see below
416423
redirect_route: connection_github_check
417424

418425
ewz_recaptcha:
419-
public_key: '%recaptcha_public_key%'
420-
private_key: '%recaptcha_private_key%'
426+
public_key: '%env(RECAPTCHA_PUBLIC_KEY)%'
427+
private_key: '%env(RECAPTCHA_PRIVATE_KEY)%'
421428

422429

423430
ekino_new_relic:

app/config/config_dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ monolog:
3333

3434
parameters:
3535
paybox_ips: [127.0.0.1, 192.168.42.1]
36+
database_host: "db"
3637

3738
#swiftmailer:
3839
# delivery_address: me@example.com

app/config/config_prod.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
imports:
22
- { resource: config.yml }
33

4+
parameters:
5+
database_host: "%env(DATABASE_HOST)%"
6+
47
#doctrine:
58
# orm:
69
# metadata_cache_driver: apc

app/config/routing/admin_event.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,22 @@ admin_event_restore:
105105
admin_event_votes:
106106
path: /votes
107107
defaults: {_controller: AppBundle\Controller\Admin\Event\VotesListeAction}
108+
109+
admin_event_themes_add:
110+
path: /themes/add
111+
defaults:
112+
_controller: AppBundle\Controller\Admin\Event\EventThemeAddEditAction
113+
id: null
114+
115+
admin_event_themes_edit:
116+
path: /themes/edit/{id}
117+
defaults: {_controller: AppBundle\Controller\Admin\Event\EventThemeAddEditAction}
118+
requirements:
119+
id: \d+
120+
121+
admin_event_themes_list:
122+
path: /themes/
123+
requirements:
124+
id: \d+
125+
defaults:
126+
_controller: AppBundle\Controller\Admin\Event\EventThemeAction

app/config/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ security:
6666
- { path: ^/admin/(members/reporting|association/relances|talk|slackmembers/check|healthcheck), roles: ROLE_ADMIN}
6767
- { path: ^/member, roles: [ROLE_USER, ROLE_MEMBER_EXPIRED]}
6868
- { path: ^/admin/, roles: ROLE_MEMBER_EXPIRED }
69-
- { path: ^/blog, allow_if: "request.getClientIp() in ['217.70.189.71', '127.0.0.1', '192.168.42.1'] or request.server.get('ALLOW_BLOG_FROM_ALL') == 1 or request.headers.get('x-afup-blog-api-key') == '%blog_api_key%'" }
69+
- { path: ^/blog, allow_if: "request.getClientIp() in ['217.70.189.71', '127.0.0.1', '192.168.42.1'] or request.server.get('ALLOW_BLOG_FROM_ALL') == 1 or request.headers.get('x-afup-blog-api-key') == '%env(BLOG_API_KEY)%'" }
7070
- { path: ^/blog, roles: ROLE_NO_ACCESS }
7171
- { path: ^/(event/\w+/tickets|association)paybox-callback, roles: PUBLIC_ACCESS, ips: "%paybox_ips%" }
7272
- { path: ^/(event/\w+/tickets|association)paybox-callback, roles: ROLE_SUPER_ADMIN }

app/config/services.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ parameters:
44
app.badge_dir: "%kernel.project_dir%/../htdocs/uploads/badges"
55
app.members_logo_dir: "%kernel.project_dir%/../htdocs/uploads/members_logo"
66
app.general_meetings_dir: "%kernel.project_dir%/../htdocs/uploads/general_meetings_reports"
7-
bluesky.api.identifier: "%bluesky_api_identifier%"
8-
bluesky.api.app_password: "%bluesky_api_app_password%"
7+
bluesky.api.identifier: "%env(BLUESKY_API_IDENTIFIER)%"
8+
bluesky.api.app_password: "%env(BLUESKY_API_APP_PASSWORD)%"
9+
database_name: "%env(DATABASE_NAME)%"
10+
database_user: "%env(DATABASE_USER)%"
11+
database_password: "%env(DATABASE_PASSWORD)%"
12+
database_port: "%env(DATABASE_PORT)%"
913

1014
services:
1115
# service_name:
@@ -25,9 +29,9 @@ services:
2529
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
2630
public: false
2731
arguments:
28-
- 'mysql:host=%database_host%;port=%database_port%;dbname=%database_name%'
29-
- db_username: '%database_user%'
30-
db_password: '%database_password%'
32+
- 'mysql:host=%database_host%;port=%env(int:DATABASE_PORT)%;dbname=%env(DATABASE_NAME)%'
33+
- db_username: '%env(DATABASE_USER)%'
34+
db_password: '%env(DATABASE_PASSWORD)%'
3135
lock_mode: !php/const Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::LOCK_NONE
3236

3337
AppBundle\:
@@ -78,19 +82,19 @@ services:
7882

7983
AppBundle\Payment\PayboxFactory:
8084
autowire: true
81-
arguments: ["@router", "%paybox_domain_server%", "%paybox_secret_key%", "%paybox_site%", "%paybox_rang%", "%paybox_identifiant%"]
85+
arguments: ["@router", "%env(PAYBOX_DOMAIN_SERVER)%", "%env(PAYBOX_SECRET_KEY)%", "%env(PAYBOX_SITE)%", "%env(PAYBOX_RANG)%", "%env(PAYBOX_IDENTIFIANT)%"]
8286

8387
AppBundle\Slack\LegacyClient:
84-
arguments: ["%slack_members_legacy_token%"]
88+
arguments: ["%env(SLACK_MEMBERS_LEGACY_TOKEN)%"]
8589

8690
Algolia\AlgoliaSearch\SearchClient:
8791
factory: [ Algolia\AlgoliaSearch\SearchClient, create ]
88-
arguments: ["%algolia_app_id%", "%algolia_backend_api_key%"]
92+
arguments: ["%env(ALGOLIA_APP_ID)%", "%env(ALGOLIA_BACKEND_API_KEY)%"]
8993

9094
# API/Client Meetup techletter
9195
app.mailchimp_techletter_client:
9296
class: DrewM\MailChimp\MailChimp
93-
arguments: ["%mailchimp_techletter_api_key%"]
97+
arguments: ["%env(MAILCHIMP_TECHLETTER_API_KEY)%"]
9498
public: false
9599
app.mailchimp_techletter_api:
96100
class: AppBundle\Mailchimp\Mailchimp
@@ -100,7 +104,7 @@ services:
100104
# API/Client Meetup
101105
app.mailchimp_client:
102106
class: DrewM\MailChimp\MailChimp
103-
arguments: ["%mailchimp_api_key%"]
107+
arguments: ["%env(MAILCHIMP_API_KEY)%"]
104108
public: false
105109
app.mailchimp_api:
106110
class: AppBundle\Mailchimp\Mailchimp
@@ -111,13 +115,13 @@ services:
111115
autowire: true
112116
arguments:
113117
$mailchimp: '@app.mailchimp_techletter_api'
114-
$listId: "%mailchimp_techletter_list%"
118+
$listId: "%env(MAILCHIMP_TECHLETTER_LIST)%"
115119

116120
AppBundle\Mailchimp\MailchimpMembersAutoListSynchronizer:
117121
autowire: true
118122
arguments:
119123
$mailchimp: '@app.mailchimp_api'
120-
$listId: "%mailchimp_members_list%"
124+
$listId: "%env(MAILCHIMP_MEMBERS_LIST)%"
121125

122126
Afup\Site\Utils\Configuration:
123127
autowire: true
@@ -130,7 +134,7 @@ services:
130134
AppBundle\Mailchimp\EventEventSubscriber:
131135
arguments:
132136
- '@app.mailchimp_api'
133-
- "%mailchimp_members_list%"
137+
- "%env(MAILCHIMP_MEMBERS_LIST)%"
134138
tags:
135139
- { name: kernel.event_listener, event: user.disabled, method: onUserDisabled }
136140

@@ -140,7 +144,7 @@ services:
140144

141145
AppBundle\Event\Ticket\QrCodeGenerator:
142146
autowire: true
143-
arguments: ["%qr_code_salt%"]
147+
arguments: ["%env(QR_CODE_SALT)%"]
144148

145149
Afup\Site\Forum\AppelConferencier:
146150
class: Afup\Site\Forum\AppelConferencier
@@ -185,7 +189,7 @@ services:
185189

186190
geocoder_provider_google_maps:
187191
class: Geocoder\Provider\GoogleMaps\GoogleMaps
188-
arguments: ['@Psr\Http\Client\ClientInterface', null, "%google_maps_api_key%"]
192+
arguments: ['@Psr\Http\Client\ClientInterface', null, "%env(GOOGLE_MAPS_API_KEY)%"]
189193

190194
AppBundle\Offices\OfficeFinder:
191195
arguments: ['@geocoder']

bin/console

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use Symfony\Bundle\FrameworkBundle\Console\Application;
55
use Symfony\Component\Console\Input\ArgvInput;
6+
use Symfony\Component\Dotenv\Dotenv;
67

78
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
89
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
@@ -16,6 +17,7 @@ $loader = require __DIR__.'/../vendor/autoload.php';
1617
$input = new ArgvInput();
1718
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
1819
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
20+
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
1921

2022
$kernel = new AppKernel($env, $debug);
2123
$application = new Application($kernel);

0 commit comments

Comments
 (0)