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' %} {% extends 'bootstrap3/bootstrap3.html' %}
{% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %} {% block bootstrap3_title %}{% block title %}{% endblock %}{% endblock %}
{% load url from future %} {% load staticfiles %}
{% load bootstrap3 %} {% 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 bootstrap3 %}
{% load staticfiles %} {% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block bootstrap3_extra_head %} {% block content %}
<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 %}
<div class="alert alert-success" role="alert">{% trans "Logged" %}</div> <div class="alert alert-success" role="alert">{% trans "Logged" %}</div>
{% bootstrap_button _('Logout') size='lg' button_class="btn-danger btn-block" href="logout" %} {% bootstrap_button _('Logout') size='lg' button_class="btn-danger btn-block" href="logout" %}
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %} {% endblock %}

View File

@ -2,24 +2,12 @@
{% load bootstrap3 %} {% load bootstrap3 %}
{% load staticfiles %} {% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block bootstrap3_extra_head %} {% block content %}
<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 %}
<form class="form-signin" method="post"> <form class="form-signin" method="post">
<h2 class="form-signin-heading">{% trans "Please loggin" %}</h2> <h2 class="form-signin-heading">{% trans "Please loggin" %}</h2>
{% csrf_token %} {% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
{% bootstrap_button _('Login') size='lg' button_type="submit" button_class="btn-primary btn-block"%} {% bootstrap_button _('Login') size='lg' button_type="submit" button_class="btn-primary btn-block"%}
</form> </form>
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %} {% endblock %}

View File

@ -2,19 +2,7 @@
{% load bootstrap3 %} {% load bootstrap3 %}
{% load staticfiles %} {% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block bootstrap3_extra_head %} {% block content %}
<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 %}
<div class="alert alert-success" role="alert">{% trans "Successfully logout" %}</div> <div class="alert alert-success" role="alert">{% trans "Successfully logout" %}</div>
</div>
<div class="col-md-3"></div>
</div>
</div> <!-- /container -->
{% endblock %} {% endblock %}

View File

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