1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 12:51:17 +00:00
nginx-sso/frontend/index.html

107 lines
4.5 KiB
HTML
Raw Normal View History

<!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>