/
register.html
153 lines (128 loc) · 3.97 KB
/
register.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<html>
<head>
<title>{{ title }}</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
{% load static %}
<link rel="icon" href="{% static 'favicon.ico' %}" ><link rel="stylesheet" href="{% static 'css/bulma.css' %}">
<link rel="stylesheet" href="{% static 'css/default.css' %}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<section class="hero is-medium is-primary is-bold">
<div class="hero-head">
<nav class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item">
<h3>{{ title }}</h3>
</a>
<span class="navbar-burger burger" data-target="navbarMenuHeroB">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div id="navbarMenuHeroB" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item is-active" href="/">
Home
</a>
{% block index %}
<span class="navbar-item">
<a class="button is-info is-inverted" href="{% url 'index:register' %}">
<span class="icon">
<i class="fa fa-sign-in"></i>
</span>
<span>SignUp</span>
</a>
</span>
<span class="navbar-item">
<a class="button is-info is-inverted" href="{% url 'index:login' %}">
<span class="icon">
<i class="fa fa-sign-in"></i>
</span>
<span>SignIn</span>
</a>
</span>
{% endblock %}
</div>
</div>
</div>
</nav>
</div>
<div class="hero-body">
<div class="container">
<h1 class="title">
{{ title }}
</h1>
<p class="subtitle">
Register pages for <strong>{{ title }}</strong>!
</p>
<div class="back box is-half is-offset-one-fifth">
<form id="reg" method="post" class="form-signin" action="{% url 'index:register' %}">
{% csrf_token %}
<div class="field">
<label class="label">Username</label>
<div class="control">
<input id="user" class="input" type="text" placeholder="name" name="username" autofocus>
</div>
</div>
<div class="field">
<label class="label">Password</label>
<div class="control">
<input id="pass" class="input" type="password" placeholder="password" name="password1" value="">
</div>
</div>
<div class="field">
<label class="label">Password confirmation</label>
<div class="control">
<input id="pass" class="input" type="password" placeholder="password" name="password2" value="">
</div>
</div>
<div class="field">
<label class="label">Email</label>
<div class="control">
<input id="email" class="input" type="email" placeholder="email" name="email" value="">
</div>
</div>
<div class="field">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="notification is-danger is-{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="field is-grouped columns">
<div class="control column">
<button id="reg-btn" class="button is-link">Submit</button>
</div>
<div class="control column">
<button id="cancel-btn" class="button is-text">Cancel</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
<script>
document.getElementById("reg-btn").addEventListener("click", function(e){
e.preventDefault();
e.stopPropagation();
document.getElementById("reg").submit();
return false;
});
document.getElementById("cancel-btn").addEventListener("click", function(e){
e.preventDefault();
e.stopPropagation();
location.href = '{% url 'index:index' %}';
return false;
});
</script>
<script src="{% static 'js/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
</body>
</html>