diff --git a/app/Resources/translations/messages.fr.yml b/app/Resources/translations/messages.fr.yml index f0aa70291..12c75800a 100644 --- a/app/Resources/translations/messages.fr.yml +++ b/app/Resources/translations/messages.fr.yml @@ -151,6 +151,9 @@ role: ROLE_ARGENTIQUE_ADMIN: Voir la documentation pour ajouter des photos au site ROLE_ARGENTIQUE_READ: Voir les photos du site + ROLE_NEWS_ADMIN: Peut modérer les news + ROLE_NEWS_EDIT: Peut modifier les news d'une asso s'il est autorisé + ROLE_NEWS_READ: Peut lire les news d'une asso ROLE_ASSOS_MEMBERS: Voir la liste des membres d'une association diff --git a/app/config/modules.yml.dist b/app/config/modules.yml.dist index 20b21126e..46f706f63 100644 --- a/app/config/modules.yml.dist +++ b/app/config/modules.yml.dist @@ -14,3 +14,4 @@ modules: - Etu\Module\UploadBundle\EtuModuleUploadBundle - Etu\Module\SIABundle\EtuModuleSIABundle - Etu\Module\BadgesBundle\EtuModuleBadgesBundle + - Etu\Module\NewsBundle\EtuModuleNewsBundle diff --git a/app/config/security.yml b/app/config/security.yml index 765505212..b6c2ba9c5 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -12,6 +12,7 @@ security: - ROLE_EVENTS_INTERNAL # can read Private/internal calendar and events ROLE_USER: + - ROLE_NEWS_READ # Read orga's news ROLE_STUDENT: - ROLE_CORE_SUBSCRIBE # User can receive and use subscriptions @@ -30,6 +31,7 @@ security: - ROLE_COVOIT_EDIT # Can answer, post and set alerts on covoit bundle - ROLE_CUMUL # Can cumul timetables - ROLE_DAYMAIL_EDIT # Can edit daymail of his organization if authorized + - ROLE_NEWS_EDIT # Can edit news of his organization if authorized - ROLE_EVENTS_INTERNAL # can read Private/internal calendar and events - ROLE_EVENTS_ANSWER # Can see answer list - ROLE_EVENTS_ANSWER_POST # Can post an answer @@ -59,6 +61,7 @@ security: - ROLE_COVOIT_EDIT # Can answer, post and set alerts on covoit bundle - ROLE_CUMUL # Can cumul timetables - ROLE_DAYMAIL_EDIT # Can edit daymail of his organization if authorized + - ROLE_NEWS_EDIT # Can edit news of his organization if authorized - ROLE_EVENTS_INTERNAL # can read Private/internal calendar and events - ROLE_EVENTS_EDIT # Can edit event of his organization if authorized - ROLE_TROMBI # Can search on trombi @@ -79,6 +82,7 @@ security: - ROLE_COVOIT # Can read covoit bundle - ROLE_COVOIT_EDIT # Can answer, post and set alerts on covoit bundle - ROLE_DAYMAIL_EDIT # Can edit daymail of his organization if authorized + - ROLE_NEWS_EDIT # Can edit news of his organization if authorized - ROLE_EVENTS_INTERNAL # can read Private/internal calendar and events - ROLE_EVENTS_EDIT # Can edit event of his organization if authorized - ROLE_TROMBI # Can search on trombi @@ -104,6 +108,7 @@ security: - ROLE_UV_REVIEW_ADMIN # Can moderate and remove UV review and old exams - ROLE_BADGE_ADMIN # Can create and attribute badges - ROLE_WIKI_ADMIN # Can lock, read and write on every admin page on the wiki + - ROLE_NEWS_ADMIN # Edit news ROLE_SUPERADMIN: - ROLE_ADMIN @@ -120,6 +125,7 @@ security: - ROLE_CORE_ADMIN_HOME # Can see admin homepage - ROLE_FORUM_ADMIN # Can moderate forum - ROLE_UV_REVIEW_ADMIN # Can moderate and remove UV review and old exams + - ROLE_NEWS_ADMIN # Edit news blog ROLE_ARGENTIQUE: - ROLE_CORE_ADMIN_HOME # Can see admin homepage @@ -141,6 +147,7 @@ security: - ROLE_CORE_SCHEDULE_OWN # Can read his own schedule - ROLE_CORE_HOMEPAGE # Can see the private homepage - ROLE_ARGENTIQUE_READ # View pictures + - ROLE_NEWS_READ # View news - ROLE_ASSOS_MEMBERS # Read assos member list - ROLE_BUGS # read bugs list - ROLE_COVOIT # Can read covoit bundle diff --git a/doc/1. Introduction et installation/4. Bonnes pratiques et conventions.md b/doc/1. Introduction et installation/4. Bonnes pratiques et conventions.md index d72f0755b..3c75db8e4 100644 --- a/doc/1. Introduction et installation/4. Bonnes pratiques et conventions.md +++ b/doc/1. Introduction et installation/4. Bonnes pratiques et conventions.md @@ -61,7 +61,6 @@ pour cela, il faut suivre cette convention. - La configuration est stockée dans `Resources/config` - Les traductions sont stockées dans `Resources/translations` - Les extensions Twig sont stockées dans `Twig` et sont suffixées de `Extension` - - Les traductions sont stockées dans `Resources/translations` - Les commandes sont stockées dans `Command` - Les types de champs de formulaires sont stockés dans `Form` - Les classes outils (classes généralistes utiles partout) sont stockés dans `Util` diff --git a/src/Etu/Core/UserBundle/Resources/translations/messages.fr.yml b/src/Etu/Core/UserBundle/Resources/translations/messages.fr.yml index 566745129..2e9c91a3b 100644 --- a/src/Etu/Core/UserBundle/Resources/translations/messages.fr.yml +++ b/src/Etu/Core/UserBundle/Resources/translations/messages.fr.yml @@ -171,6 +171,7 @@ user: notifications: Notifications event: Evènements daymail: Daymail + news: News wiki: Wiki public: Page publique sia: Gestionnaire SIA diff --git a/src/Etu/Core/UserBundle/Resources/views/Memberships/layout.html.twig b/src/Etu/Core/UserBundle/Resources/views/Memberships/layout.html.twig index a0c5963a3..058ecb97b 100644 --- a/src/Etu/Core/UserBundle/Resources/views/Memberships/layout.html.twig +++ b/src/Etu/Core/UserBundle/Resources/views/Memberships/layout.html.twig @@ -74,6 +74,13 @@ {% endif %} + {% if membership.hasPermission('news') and etu.modules.isEnabled('news') %} +
{{ 'news.main.moderate.body'|trans }}
+ +Créé le {{ article.createdAt|date('d/m/Y H:i') }} par {{ article.author.fullname }}
+ {% else %} +Publié le {{ article.publishedAt|date('d/m/Y H:i') }} par {{ article.author.fullname }}
+ {% endif %} +