1 {% extends "admin/base_site_login.html" %}
2 {% load i18n admin_static %}
4 {% block extrastyle %}{{ block.super }}
5 <link rel="stylesheet" type="text/css" href="/static/suit/bootstrap/css/bootstrap.min.css" media="all"/>
6 <link rel="stylesheet" type="text/css" href="{% static "planetstack.css" %}" />
7 <script src="{% static 'suit/js/jquery-1.9.1.min.js' %}"></script>
8 <script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
12 {% block bodyclass %}login{% endblock %}
14 {% block nav-global %}{% endblock %}
16 {% block content_title %}{% endblock %}
18 {% block breadcrumbs %}{% endblock %}
21 {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}
23 {% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
27 {% if form.non_field_errors or form.this_is_the_login_form.errors %}
28 {% for error in form.non_field_errors|add:form.this_is_the_login_form.errors %}
35 <div id="content-main">
36 <h1><i class="icon-lock icon-white"></i> OpenCloud</h1>
37 <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
38 <div class="form-row">
39 {% if not form.this_is_the_login_form.errors %}{{ form.username.errors }}{% endif %}
42 <div class="form-row">
43 {% if not form.this_is_the_login_form.errors %}{{ form.password.errors }}{% endif %}
45 <input type="hidden" name="this_is_the_login_form" value="1" />
46 <input type="hidden" name="next" value="{{ next }}" />
48 <div class="submit-row">
49 <input type="submit" class="btn btn-info" value="{% trans 'SIGN IN' %}" />
51 <div id="requestAccountLink">{% trans 'Request a new Account' %}</div>
54 <div id="request-account-form" title="Request an Account" style="display: none;">
57 <div class="request-form-row">
58 <label for="request-first-name">First Name</label>
59 <input type="text" name="request-first-name" id="request-first-name">
61 <div class="request-form-row">
62 <label for="request-last-name">Last Name</label>
63 <input type="text" name="request-last-name" id="request-last-name">
65 <div class="request-form-row">
66 <label for="request-email">Email</label>
67 <input type="text" name="request-email" id="request-email">
69 <div class="request-form-row">
70 <label for="request-site-name">Site</label><br>
71 <select id="request-site-name" name="request-site-name">
72 <option>---------</option>
73 {% for site in sites %}
74 {% if site.allowNewUsers %}
75 <option>{{ site.name }}</option>
80 <div class="submit-row">
81 <input id ="request-signup" class="btn btn-info" value="SIGN UP">
90 <script type="text/javascript">
94 function initRequest(){
98 success: function (data) {
99 var sites = data['sitesToBeRequested'];
102 $("#request-site-name").append("<option>" + site + "</option>");
107 $("#requestAccountLink").unbind().click(function(){
108 $("#request-account-form").dialog({
111 dialogClass: "requestDialog",
113 $("#request-account-form").dialog("open");
115 $("#request-signup").unbind().click(function(){
117 url: '/requestaccess/',
120 email: $("#request-email").val(),
121 firstname: $("#request-first-name").val(),
122 lastname: $("#request-last-name").val(),
123 site: $("#request-site-name").val(),
124 csrfmiddlewaretoken: "{{ csrf_token }}", // < here
129 success: function () {
130 $("#request-account-form").dialog("close");
131 alert("Your request has been submitted");
133 error:function (xhr, textStatus, thrownError){
134 alert("Error:", textStatus + " " + xhr.responseText);
138 document.getElementById('id_username').focus()