1 |
{% extends "layout.html" %} |
2 |
{% block body %} |
3 |
<h4> Register a new app with the <i>swt web</i> platform </h4> |
4 |
<p class="text-muted"> Please fill in the details below and click Register button </p> |
5 |
|
6 |
<form role="form" method="POST" action="{{ url_for('app.register') }}"> |
7 |
<div class="form-group"> |
8 |
<label for="name">Name </label> |
9 |
<input type="text" class="form-control" name="name" id="name" placeholder="Name of the application"> |
10 |
</div> |
11 |
<div class="form-group"> |
12 |
<label for="desc">Description</label> |
13 |
<p class="help-block"> Brief description of your application. (Optional)</p> |
14 |
<textarea class="form-control" rows="4" id="desc" name="desc"> |
15 |
</textarea> |
16 |
</div> |
17 |
<div class="form-group"> |
18 |
<label for="host_url">Host URL</label> |
19 |
<p class="help-block">URL where your app is deployed</p> |
20 |
<input type="text" class="form-control" name="host_url" id="host_url" placeholder="host URL"> |
21 |
</div> |
22 |
<div class="form-group"> |
23 |
<label for="redirect_uris">Redirect URLs</label> |
24 |
<p class="help-block">Your app URL where it should be redirected once the user is authorized.</p> |
25 |
<input type="text" class="form-control" name="redirect_uris" id="redirect_uris" placeholder="redirect URLs"> |
26 |
</div> |
27 |
<div class="form-group"> |
28 |
<label for="scopes">Scopes</label> |
29 |
<input type="text" class="form-control" name="scopes" id="scopes" value="email"> |
30 |
</div> |
31 |
<button type="submit" class="btn btn-primary">Register</button> |
32 |
</form> |
33 |
{% endblock %} |
34 |
{% block scripts %} |
35 |
<script> |
36 |
// form validation |
37 |
/*$('form').on('submit', function(event) { |
38 |
console.log('here..'); |
39 |
if(!$('#name').val()) { |
40 |
event.preventDefault(); |
41 |
$('#name').parent().addClass('has-feedback'); |
42 |
$('#name').parent().addClass('has-error'); |
43 |
return false; |
44 |
} |
45 |
if(!$('#host_url').val()) { |
46 |
event.preventDefault(); |
47 |
$('#host_url').parent().addClass('has-feedback'); |
48 |
$('#name').parent().addClass('has-error'); |
49 |
return false; |
50 |
} |
51 |
if(!$('#redirect_uris').val()) { |
52 |
event.preventDefault(); |
53 |
$('#redirect_uris').parent().addClass('has-feedback'); |
54 |
$('#name').parent().addClass('has-error'); |
55 |
return false; |
56 |
} |
57 |
if(!$('#scopes').val()) { |
58 |
event.preventDefault(); |
59 |
$('#scopes').parent().addClass('has-feedback'); |
60 |
$('#name').parent().addClass('has-error'); |
61 |
return false; |
62 |
} |
63 |
});*/ |
64 |
</script> |
65 |
{% endblock %} |