summaryrefslogtreecommitdiff
path: root/arduino_blog/static/admin/templates/user-register.html
blob: cfa38d94cf523ae5cb01e9fe752d552f9192d109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{% extends 'website/templates/base.html' %}
{% load widget_tweaks %}
{% load static %}
{% block title %}Register{% endblock %}
{% block cssblock %}
    <link rel="stylesheet" href="{% static 'website/css/login.css' %}" type="text/css" media="screen" charset="utf-8" />
{% endblock %}
{% block search %}
{% endblock %}
{% block content %}

<div class="form" style="margin: 50px auto 0px;">
<div class="headerlogin"><h2>Register</h2></div>
<div class="login">       
        <br>
        <p> The activation link of the account will be sent to the Email id provided.</p>
        <br>
        <form id="logForm" method="post" class="form-horizontal">{% csrf_token %}
            <div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
                        {% render_field form.username class+="form-control username" tabindex="1" placeholder="Desired Username" %}
                    </div>
                    {{ form.username.errors }}
                </div>  
            </div>
            <div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-envelope fa-fw"></i></span>
                        {% render_field form.email class+="form-control email" tabindex="1" placeholder="Your Email" %}
                    </div>
                    {{ form.email.errors }}
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
                        {% render_field form.password class+="form-control password" tabindex="1" placeholder="Enter password" %}
                    </div>
                    {{ form.password.errors }}
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
                        {% render_field form.password_confirm class+="form-control password_confirm" tabindex="1" placeholder="Retype Password" %}
                    </div>
                    {{ form.password_confirm.errors }}
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group captcha-group">
                    <script src='https://www.google.com/recaptcha/api.js'></script>
                    <div class="g-recaptcha" data-sitekey="{{ SITE_KEY }}" data-callback="enableBtn"></div>
                    </div>
                </div>
            </div>

           <script>
            function enableBtn(){
    document.getElementById("regstr").disabled = false;
   }
           </script>
             <div class="col-sm-5 submitWrap">
                    <button type="submit" class="btn btn-primary btn-sm " id="regstr" disabled>Register</button>
                </div>

              
            </div>
             </br>    </br>    </br>
                            <div class="sign">
<div class="need">Already Registered? </div>
<div> <a href="/accounts/login/" class="btn  btn-sm btn-success">Login </a></div>
</div>
            
        </form>
    </div>
    </div>
    </div>
{% endblock %}
{% block uncompressjsblock %}
    <script>
    $(function() {
    // Add refresh button after field (this can be done in the template as well)

        // Click-handler for the refresh-link
        $('.captcha-refresh').click(function(){
            var $form = $(this).parents('form');
            var url = location.protocol + "//" + window.location.hostname + ":"+ location.port + "/captcha/refresh/";

            // Make the AJAX-call
            $.getJSON(url, {}, function(json) {
                $form.find('input[name="captcha_0"]').val(json.key);
                $form.find('img.captcha').attr('src', json.image_url);
            });

            return false;
        });
    });
    </script>
{% endblock %}