1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 07:34:22 +00:00
nginx-sso/frontend/index.html
Knut Ahlers 42db8e247d
Implement oAuth2 provider: Google
fixes #15
refs #35

Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-22 06:42:44 +02:00

106 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>{{ login.Title }}</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css"
integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
<style>
html, body, .container, .row { height: 100%; }
.vertical-align { display: flex; flex-direction: column; justify-content: center; }
.modal-content { background-color: darkcyan; }
.modal-heading h2 { color: white; }
.nav-tabs>li>a { color: white; }
.nav-tabs>li.active>a, .nav-tabs>li>a:hover { color: #333; }
.tab-pane { padding-top: 10px; color: white; }
</style>
</head>
<body>
<div class="container">
<div class="row vertical-align">
<div class="col-md-offset-2 col-md-8">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-heading">
<h2 class="text-center">{{ login.Title }}</h2>
</div>
<hr>
<div class="modal-body">
<!-- Nav tabs -->
{% if active_methods | length > 1 %}
<ul class="nav nav-tabs" role="tablist">
{% for method in active_methods sorted %}
<li role="presentation" class="{% if method == login.DefaultMethod %}active{% endif %}">
{% for name, desc in login.Names %}{% if method == name %}
<a href="#{{ method }}" aria-controls="{{ method }}" role="tab" data-toggle="tab">{{ desc }}</a>
{% endif %}{% endfor %}
</li>
{% endfor %}
</ul>
{% endif %}
<!-- Tab panes -->
<div class="tab-content">
{% for method, fields in active_methods sorted %}
<div role="tabpanel" class="tab-pane {% if method == login.DefaultMethod %}active{% endif %}" id="{{ method }}">
<form action="/login" method="post">
{% for field in fields %}
<div class="form-group">
<label for="{{ method }}-{{ field.Name }}">{{ field.Label }}</label>
<input
class="form-control"
id="{{ method }}-{{ field.Name }}"
name="{{ method }}-{{ field.Name }}"
{% if field.Action %}onclick="{{ field.Action }}"{% endif %}
{% if field.Type == "button" %}
value="{{ field.Placeholder }}"
{% else %}
placeholder="{{ field.Placeholder }}"
{% endif %}
type="{{ field.Type }}"
/>
</div>
{% endfor %}
<div class="form-group text-center">
<button type="submit" class="btn btn-success btn-lg">Login</button>
<input type="hidden" name="go" value="{{ go }}">
</div>
</form>
</div>
{% endfor %}
</div>
</div> <!-- /.panel-body -->
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.col-md-8 -->
</div> <!-- /.row -->
</div> <!-- /.container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.0/dist/jquery.min.js"
integrity="sha256-BJeo0qm959uMBGb65z40ejJYGSgR7REI4+CW1fNKwOg=" crossorigin="anonymous"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"
integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script>
<script>
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
$(e.target.hash).find('input:first').focus();
})
</script>
</body>
</html>