8 <div class="modal fade" id="site_login_dialog" name="site_login_dialog" tabindex="-1" role="dialog" aria-labelledby="site_login_dialog_title">
9 <div class="modal-dialog modal-sm" role="document">
10 <div class="modal-content">
11 <div class="modal-header" style="text-align:center">
12 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
13 <h3 class="modal-title" id="site_login_dialog_title">Login</h3>
15 <div class="modal-body">
16 <form id="login_form" name="login_form">
17 <div class="container-fluid">
19 % if ($c->config->{default_login_janedoe}) {
20 <input class="form-control" style="width:240px" id="username" name="username" placeholder="Username" type="text" value="janedoe"/>
22 <input class="form-control" style="width:240px" id="password" name="password" placeholder="Password" type="password" value="secretpw"/>
24 <input class="form-control" style="width:240px" id="username" name="username" placeholder="Username" type="text" />
26 <input class="form-control" style="width:240px" id="password" name="password" placeholder="Password" type="password" />
29 <div style="margin-bottom:40px">
30 <a href="/user/reset_password" style="float:left">Forgot password?</a>
31 <a href="/user/new" style="float:right">New User</a>
34 <input type="hidden" value="<% $goto_url %>" id="goto_url" name="goto_url" />
37 <button class="btn btn-secondary" id="cancel_login" type="reset" style="float:left" >Reset</button>
38 <button class="btn btn-primary" id="submit_password" name="submit_password" type="submit" style="float:right">Login</button>
43 <div class="modal-footer">
44 <button id="close_site_login_dialog_button" type="button" class="btn btn-default" data-dismiss="modal" style="float:left">Close</button>
51 jQuery(document).ready( function() {
52 jQuery('#login_form').submit( function(event) {
53 event.preventDefault();
54 var form_data = jQuery('#login_form').serialize();
55 if (!jQuery('#username').val() || !jQuery('#password').val()) {
56 alert('Please enter a username and password');
60 url: '/ajax/user/login',
62 error: function(r) { alert('An error occurred! Sorry!'); },
63 success: function(r) {
69 location.href=r.goto_url;
81 <!-- End login dialog -->