-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add maintenance flag to sulu community bundle * update pull request template * fix styleci * restructure community manager compiler pass
- Loading branch information
1 parent
0faec9a
commit 92359dc
Showing
9 changed files
with
164 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ disabled: | |
- blankline_after_open_tag | ||
- function_declaration | ||
- single_line_class_definition | ||
- const_separation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Maintenance | ||
|
||
You can temporarily change the community bundle into a maintenace mode | ||
this will disable all form renderings. | ||
|
||
## Config | ||
|
||
```yml | ||
# app/config/config.yml | ||
|
||
sulu_community: | ||
webspaces: | ||
<webspace_key>: | ||
maintenance: | ||
enabled: false | ||
template: AppBundle:template:community/Maintenance/maintenance.html.twig | ||
``` | ||
The configured maintenance template will be rendered instead of configured | ||
login, registration, completion, password forget, password reset, ... template. | ||
## Disable login embed | ||
In the `login-embed.html.twig` a variable `maintenanceMode` is available so you can render | ||
in the login embed another text instead. | ||
|
||
```twig | ||
{% if maintenanceMode %} | ||
Maintenace mode active | ||
{% else %} | ||
{# ... #} | ||
{% endif %} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
{% if app.user %} | ||
{% set media = null %} | ||
{% if app.user.contact.avatar is not null %} | ||
{% set media = sulu_resolve_media(app.user.contact.avatar, request.locale) %} | ||
{% endif %} | ||
|
||
<a href="{{ path('sulu_community.profile') }}"> | ||
{% if media is not null %} | ||
<img src="{{ media.thumbnails['50x50'] }}"/> | ||
{{% if maintenanceMode %} | ||
{# Show nothing in maintenance mode #} | ||
{% else %} | ||
{% if app.user %} | ||
{% set media = null %} | ||
{% if app.user.contact.avatar is not null %} | ||
{% set media = sulu_resolve_media(app.user.contact.avatar, request.locale) %} | ||
{% endif %} | ||
|
||
{{ app.user.username|default('No username'|trans) }} | ||
</a> | ||
<a href="{{ path('sulu_community.profile') }}"> | ||
{% if media is not null %} | ||
<img src="{{ media.thumbnails['50x50'] }}"/> | ||
{% endif %} | ||
|
||
<a href="{{ path('sulu_community.logout') }}"> | ||
{{ 'Logout'|trans }} | ||
</a> | ||
{% else %} | ||
<a href="{{ path('sulu_community.login') }}"> | ||
{{ 'Login'|trans }} | ||
</a> | ||
{{ app.user.username|default('No username'|trans) }} | ||
</a> | ||
|
||
<a href="{{ path('sulu_community.logout') }}"> | ||
{{ 'Logout'|trans }} | ||
</a> | ||
{% else %} | ||
<a href="{{ path('sulu_community.login') }}"> | ||
{{ 'Login'|trans }} | ||
</a> | ||
{% endif %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "SuluCommunityBundle::master.html.twig" %} | ||
|
||
{% block content %} | ||
<h1>{{ 'Maintenance'|trans }}</h1> | ||
|
||
<p> | ||
{{ 'maintenance_message'|trans }} | ||
</p> | ||
{% endblock %} |