9func loadTemplates(dir string) *template.Template {
13 log.Printf("using custom template directory %q", dir)
14 t, err := template.New("").ParseFiles(path.Join(dir, "sign_in.html"), path.Join(dir, "error.html"))
16 log.Fatalf("failed parsing template %s", err)
21func getTemplates() *template.Template {
22 t, err := template.New("foo").Parse(`{{define "sign_in.html"}}
24<html lang="en" charset="utf-8">
26 <title>Sign In</title>
27 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
30 font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
32 line-height: 1.42857143;
41 border:1px solid #ccc;
50 background-color: #428bca;
51 border: 1px solid #357ebd;
52 -webkit-border-radius: 4;
53 -moz-border-radius: 4;
57 text-decoration: none;
62 background-color: #3071a9;
63 border-color: #285e8e;
67 display: inline-block;
78 line-height: 1.42857143;
80 background-color: #fff;
81 background-image: none;
82 border: 1px solid #ccc;
84 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
85 box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
86 -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
87 -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
88 transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
90 box-sizing: border-box;
100 display:inline-block;
104 text-decoration:underline;
112 <div class="signin center">
113 <form method="GET" action="{{.ProxyPrefix}}/start">
114 <input type="hidden" name="rd" value="{{.Redirect}}">
115 {{ if .SignInMessage }}
116 <p>{{.SignInMessage}}</p>
118 <button type="submit" class="btn">Sign in with a {{.ProviderName}} Account</button><br/>
122 {{ if .CustomLogin }}
124 <form method="POST" action="{{.ProxyPrefix}}/sign_in">
125 <input type="hidden" name="rd" value="{{.Redirect}}">
126 <label for="username">Username:</label><input type="text" name="username" id="username" size="10"><br/>
127 <label for="password">Password:</label><input type="password" name="password" id="password" size="10"><br/>
128 <button type="submit" class="btn">Sign In</button>
133 if (window.location.hash) {
135 var inputs = document.getElementsByName('rd');
136 for (var i = 0; i < inputs.length; i++) {
137 inputs[i].value += window.location.hash;
143 {{ if eq .Footer "-" }}
144 {{ else if eq .Footer ""}}
145 Secured with <a href="https://github.com/bitly/oauth2_proxy#oauth2_proxy">OAuth2 Proxy</a> version {{.Version}}
154 log.Fatalf("failed parsing template %s", err)
157 t, err = t.Parse(`{{define "error.html"}}
159<html lang="en" charset="utf-8">
161 <title>{{.Title}}</title>
162 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
168 <p><a href="{{.ProxyPrefix}}/sign_in">Sign In</a></p>
172 log.Fatalf("failed parsing template %s", err)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list