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="/oauth2/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 Google Account</button><br/>
122 {{ if .CustomLogin }}
124 <form method="POST" action="/oauth2/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 Secured with <a href="https://github.com/bitly/google_auth_proxy#google_auth_proxy">Google Auth Proxy</a> version {{.Version}}
139 log.Fatalf("failed parsing template %s", err)
142 t, err = t.Parse(`{{define "error.html"}}
144<html lang="en" charset="utf-8">
146 <title>{{.Title}}</title>
147 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
153 <p><a href="/oauth2/sign_in">Sign In</a></p>
157 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