Handle guest access

This commit is contained in:
Nicolas Le Goff
2013-03-05 17:20:53 +01:00
committed by Romain Neutron
parent d455af5767
commit c04df2c481
2 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
{% if guest_allowed %}
<div class="well-large sidebar-block {% if last_item|default(false) %}last-child{% endif %}">
<div class="row-fluid">
<div class="span12 text-center">
<a class="btn btn-info btn-trigger" href="{{ path("login_register", {"nolog" : "1"}) }}">{% trans "Guest access" %}</a>
</div>
</div>
</div>
{% endif %}

View File

@@ -2,6 +2,7 @@
variable "feed" to get public feeds variable "feed" to get public feeds
variable "recaptcha_display" should be setted Tell whether the recaptch should be displayed variable "recaptcha_display" should be setted Tell whether the recaptch should be displayed
variable "recaptacha" should be setted The recaptcha object variable "recaptacha" should be setted The recaptcha object
variable "guest_allowed" phrasea::guest_allowed($app)
#} #}
{% extends "login/layout/sidebar-layout.html.twig" %} {% extends "login/layout/sidebar-layout.html.twig" %}
@@ -85,7 +86,7 @@
</div> </div>
</div> </div>
</div><!-- /sidebar block --> </div><!-- /sidebar block -->
<div class="well-large sidebar-block {% if not login.register_enabled(app) %}last-child{% endif %}"> <div class="well-large sidebar-block {% if not login.register_enabled(app) and not guest_allowed %}last-child{% endif %}">
<div class="row-fluid"> <div class="row-fluid">
<div class="span12 text-center"> <div class="span12 text-center">
{% trans "Or login with" %} {% trans "Or login with" %}
@@ -98,7 +99,8 @@
</div> </div>
</div><!-- /sidebar block --> </div><!-- /sidebar block -->
{% include "login/include/register-link-block.html.twig" with {"login" : login, "last_item" : login.register_enabled(app)} %} {% include "login/include/register-link-block.html.twig" with {"login" : login, "last_item" : login.register_enabled(app) and not guest_allowed} %}
{% include "login/include/guest-access-block.html.twig" with {"guest_allowed" : guest_allowed, "last_item" : guest_allowed} %}
{% endblock %} {% endblock %}
{% block left_content %} {% block left_content %}