Template factorisation

This commit is contained in:
Valentin Samir 2015-11-20 16:00:26 +01:00
parent 9df1cd2e31
commit 7beefa537f
6 changed files with 25 additions and 54 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -1,6 +1,24 @@
{% extends 'bootstrap3/bootstrap3.html' %}
{% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %}
{% load url from future %}
{% load staticfiles %}
{% load bootstrap3 %}
{% block bootstrap3_extra_head %}
<link rel="shortcut icon" href="/static/cas_server/favicon.ico?v=1" />
<link href="{% static "cas_server/login.css" %}" rel="stylesheet">
{% endblock %}
{% block bootstrap3_content %}
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
{% bootstrap_messages %}
{% block content %}
{% endblock %}
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %}

View File

@ -2,20 +2,8 @@
{% load bootstrap3 %}
{% load staticfiles %}
{% load i18n %}
{% block bootstrap3_extra_head %}
<link href="{% static "cas_server/login.css" %}" rel="stylesheet">
{% endblock %}
{% block bootstrap3_content %}
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
{% bootstrap_messages %}
{% block content %}
<div class="alert alert-success" role="alert">{% trans "Logged" %}</div>
{% bootstrap_button _('Logout') size='lg' button_class="btn-danger btn-block" href="logout" %}
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %}

View File

@ -2,24 +2,12 @@
{% load bootstrap3 %}
{% load staticfiles %}
{% load i18n %}
{% block bootstrap3_extra_head %}
<link href="{% static "cas_server/login.css" %}" rel="stylesheet">
{% endblock %}
{% block bootstrap3_content %}
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
{% bootstrap_messages %}
{% block content %}
<form class="form-signin" method="post">
<h2 class="form-signin-heading">{% trans "Please loggin" %}</h2>
{% csrf_token %}
{% bootstrap_form form %}
{% bootstrap_button _('Login') size='lg' button_type="submit" button_class="btn-primary btn-block"%}
</form>
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %}

View File

@ -2,19 +2,7 @@
{% load bootstrap3 %}
{% load staticfiles %}
{% load i18n %}
{% block bootstrap3_extra_head %}
<link href="{% static "cas_server/login.css" %}" rel="stylesheet">
{% endblock %}
{% block bootstrap3_content %}
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
{% bootstrap_messages %}
{% block content %}
<div class="alert alert-success" role="alert">{% trans "Successfully logout" %}</div>
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %}

View File

@ -2,19 +2,8 @@
{% load bootstrap3 %}
{% load staticfiles %}
{% load i18n %}
{% block bootstrap3_extra_head %}
<link href="{% static "cas_server/login.css" %}" rel="stylesheet">
{% endblock %}
{% block bootstrap3_content %}
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
{% bootstrap_messages %}
{% block content %}
{% bootstrap_button _('Connect to the service') size='lg' button_class="btn-primary btn-block" href=service_ticket_url %}
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %}