|
| 1 | +package main |
| 2 | + |
| 3 | +var base = ` |
| 4 | + |
| 5 | +<!DOCTYPE html> |
| 6 | +<html lang="en"> |
| 7 | + <head> |
| 8 | + <meta charset="utf-8"> |
| 9 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
| 10 | + <title>GoBlog</title> |
| 11 | + <!-- Latest compiled and minified CSS --> |
| 12 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> |
| 13 | + |
| 14 | + <!-- Optional theme --> |
| 15 | + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous"> |
| 16 | + |
| 17 | + <!-- Latest compiled and minified JavaScript --> |
| 18 | + <script src="https://code.jquery.com/jquery-2.2.0.min.js"></script> |
| 19 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> |
| 20 | + </head> |
| 21 | + <body> |
| 22 | + <body> |
| 23 | +
|
| 24 | +<nav class="navbar navbar-default"> |
| 25 | + <div class="container-fluid"> |
| 26 | + <!-- Brand and toggle get grouped for better mobile display --> |
| 27 | + <div class="navbar-header"> |
| 28 | + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> |
| 29 | + <span class="sr-only">Toggle navigation</span> |
| 30 | + <span class="icon-bar"></span> |
| 31 | + <span class="icon-bar"></span> |
| 32 | + <span class="icon-bar"></span> |
| 33 | + </button> |
| 34 | + <a class="navbar-brand" href="/">GoBlog</a> |
| 35 | + </div> |
| 36 | +
|
| 37 | + <!-- Collect the nav links, forms, and other content for toggling --> |
| 38 | + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| 39 | + <ul class="nav navbar-nav"> |
| 40 | + <li {{if eq .PageName "admin" }}class="active"{{end}}><a href="/admin">Admin</a></li> |
| 41 | + </ul> |
| 42 | + <form class="navbar-form navbar-left" role="search"> |
| 43 | + <div class="form-group"> |
| 44 | + <input type="text" class="form-control" placeholder="Search"> |
| 45 | + </div> |
| 46 | + <button type="submit" class="btn btn-default">Submit</button> |
| 47 | + </form> |
| 48 | + <ul class="nav navbar-nav navbar-right"> |
| 49 | + <li {{if eq .PageName "login" }}class="active"{{end}}><a href="/login">Login</a></li> |
| 50 | + <li {{if eq .PageName "signup" }}class="active"{{end}}><a href="/signup">Sign Up</a></li> |
| 51 | + </ul> |
| 52 | + </div><!-- /.navbar-collapse --> |
| 53 | + </div><!-- /.container-fluid --> |
| 54 | +</nav> |
| 55 | +
|
| 56 | + {{ template "content" }} |
| 57 | + </body> |
| 58 | +</html> |
| 59 | + |
| 60 | +` |
| 61 | + |
| 62 | +var login = ` |
| 63 | +{{ define "content" }} |
| 64 | + <div class="container-fluid"> |
| 65 | + <div class="page-header"> |
| 66 | + <h1>Login</h1> |
| 67 | + </div> |
| 68 | + <form class="form-horizontal" action="/login/" method="POST"> |
| 69 | + <div class="form-group"> |
| 70 | + <label for="name" class="col-sm-2 control-label">User name</label> |
| 71 | + <div class="col-sm-4"> |
| 72 | + <input type="text" class="form-control" id="name" name="name" required> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + <div class="form-group"> |
| 76 | + <label for="password" class="col-sm-2 control-label">Password</label> |
| 77 | + <div class="col-sm-4"> |
| 78 | + <input type="password" class="form-control" id="password" name="password" required> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | + <div class="col-sm-6"> |
| 82 | + <button type="submit" class="btn btn-primary pull-right">Login</button> |
| 83 | + </div> |
| 84 | + </form> |
| 85 | + </div> |
| 86 | +{{ end }} |
| 87 | +
|
| 88 | +` |
| 89 | + |
| 90 | +var admin = ` |
| 91 | +{{define "content"}} |
| 92 | +Admin |
| 93 | +{{end}} |
| 94 | +` |
| 95 | + |
| 96 | +var signup = ` |
| 97 | +{{define "content"}} |
| 98 | +Signup |
| 99 | +{{end}} |
| 100 | +` |
| 101 | + |
| 102 | +var mainPage = ` |
| 103 | +{{define "content"}} |
| 104 | +Main |
| 105 | +{{end}} |
| 106 | +` |
0 commit comments