add supporters template

This commit is contained in:
Shawn Smith
2019-09-09 18:29:07 +09:00
parent 6acb1d20cc
commit c93b8dd9e1
6 changed files with 92 additions and 0 deletions

14
handlers/supporters.go Normal file
View File

@@ -0,0 +1,14 @@
package handlers
import (
"net/http"
"text/template"
)
// SupportersHandler handles the supporters page
func SupportersHandler(w http.ResponseWriter, r *http.Request) {
t := template.Must(template.New("supporters.html").Delims("[[", "]]").ParseFiles("templates/supporters.html", "templates/footer.html"))
t.Execute(w, map[string]interface{}{
"google_analytics_key": googleAnalyticsKey,
})
}

View File

@@ -132,6 +132,7 @@ func main() {
http.HandleFunc(m.instrument("/report/", makeHandler("report", handlers.ReportHandler)))
http.HandleFunc(m.instrument("/badge/", makeHandler("badge", handlers.BadgeHandler)))
http.HandleFunc(m.instrument("/high_scores/", handlers.HighScoresHandler))
http.HandleFunc(m.instrument("/supporters/", handlers.SupportersHandler))
http.HandleFunc(m.instrument("/about/", handlers.AboutHandler))
http.HandleFunc(m.instrument("/", handlers.HomeHandler))

View File

@@ -47,6 +47,9 @@
<span class="header-item">
<a href="https://github.com/gojp/goreportcard">GitHub</a>
</span>
<span class="header-item">
<a href="/supporters">Supporters</a>
</span>
<span class="header-item is-active">
<a href="/about">About</a>
</span>

View File

@@ -47,6 +47,9 @@
<span class="header-item">
<a href="https://github.com/gojp/goreportcard">GitHub</a>
</span>
<span class="header-item">
<a href="/supporters">Supporters</a>
</span>
<span class="header-item">
<a href="/about">About</a>
</span>

View File

@@ -45,6 +45,9 @@
<span class="header-item">
<a href="https://github.com/gojp/goreportcard">GitHub</a>
</span>
<span class="header-item">
<a href="/supporters"><b>Supporters</b></a>
</span>
<span class="header-item">
<a href="/about">About</a>
</span>

68
templates/supporters.html Normal file
View File

@@ -0,0 +1,68 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Go Report Card | Go project code quality report cards</title>
<link rel="stylesheet" href="/assets/bulma.0.0.23.min.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '[[ .google_analytics_key ]]', 'auto');
ga('send', 'pageview');
</script>
<style>
.header .is-active {
font-weight: bold;
}
</style>
</head>
<body>
<header class="header">
<div class="container">
<!-- Left side -->
<div class="header-left">
<a class="header-item" href="/">
<h3 class="title">Go Report Card</h3>
</a>
</div>
<!-- Hamburger menu (on mobile) -->
<span class="header-toggle">
<span></span>
<span></span>
<span></span>
</span>
<!-- Right side -->
<div class="header-right header-menu">
<span class="header-item">
<a href="/high_scores">High Scores</a>
</span>
<span class="header-item">
<a href="https://github.com/gojp/goreportcard">GitHub</a>
</span>
<span class="header-item is-active">
<a href="/supporters">Supporters</a>
</span>
<span class="header-item">
<a href="/about">About</a>
</span>
</div>
</div>
</header>
<section class="section">
<div class="container">
<h1 class="title">Supporters</h1>
<ul>
</ul>
</div>
</section>
[[ template "footer" . ]]
</body>
</html>