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 %}
33 {% for error in form.this_is_the_login_form.errors %}
40 <div id="content-main">
41 <h1><i class="icon-lock icon-white"></i> OpenCloud</h1>
42 <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
43 <div class="form-row">
44 {% if not form.this_is_the_login_form.errors %}{{ form.username.errors }}{% endif %}
47 <div class="form-row">
48 {% if not form.this_is_the_login_form.errors %}{{ form.password.errors }}{% endif %}
50 <input type="hidden" name="this_is_the_login_form" value="1" />
51 <input type="hidden" name="next" value="{{ next }}" />
53 <div class="submit-row">
54 <input type="submit" class="btn btn-info" value="{% trans 'SIGN IN' %}" />
56 <div id="requestAccountLink">{% trans 'Request a new Account' %}</div>
59 <div id="request-account-form" title="Request an Account" style="display: none;">
62 <div class="request-form-row">
63 <label for="request-first-name">First Name</label>
64 <input type="text" name="request-first-name" id="request-first-name">
66 <div class="request-form-row">
67 <label for="request-last-name">Last Name</label>
68 <input type="text" name="request-last-name" id="request-last-name">
70 <div class="request-form-row">
71 <label for="request-email">Email</label>
72 <input type="text" name="request-email" id="request-email">
74 <div class="request-form-row">
75 <label for="request-site-name">Site</label><br>
76 <select id="request-site-name" name="request-site-name">
77 <option>---------</option>
78 {% for site in sites %}
79 {% if site.allowNewUsers %}
80 <option>{{ site.name }}</option>
85 <div class="submit-row">
86 <input id ="request-signup" class="btn btn-info" value="SIGN UP">
95 <script type="text/javascript">
99 function initRequest(){
103 success: function (data) {
104 var sites = data['sitesToBeRequested'];
107 $("#request-site-name").append("<option>" + site + "</option>");
112 $("#requestAccountLink").unbind().click(function(){
113 $("#request-account-form").dialog({
116 dialogClass: "requestDialog",
118 $("#request-account-form").dialog("open");
120 $("#request-signup").unbind().click(function(){
122 url: '/requestaccess/',
125 email: $("#request-email").val(),
126 firstname: $("#request-first-name").val(),
127 lastname: $("#request-last-name").val(),
128 site: $("#request-site-name").val(),
129 csrfmiddlewaretoken: "{{ csrf_token }}", // < here
134 success: function (response) {
135 if (response && response.error) {
136 if (response.error == "already_approved") {
137 alert("Your request has already been proccessed and approved. We are sending you another email with a new temporary password");
139 } else if (response.error == "already_pending") {
140 alert("Your request is already pending and awaiting approval");
144 $("#request-account-form").dialog("close");
145 alert("Your request has been submitted");
147 error:function (xhr, textStatus, thrownError){
148 alert("Error:", textStatus + " " + xhr.responseText);
152 document.getElementById('id_username').focus()