Created actual *templates*

Moved templates out of static directory
pull/24/head
Jordan Wright 2013-12-03 14:05:11 -06:00
parent 90b1384d9e
commit f32989b4c5
9 changed files with 152 additions and 112 deletions

View File

@ -60,11 +60,11 @@ func Register(w http.ResponseWriter, r *http.Request) {
func Base(w http.ResponseWriter, r *http.Request) {
//w.Header().Set("Content-Type", "application/json")
renderTemplate(w, "index")
renderTemplate(w, "dashboard")
}
func Base_Campaigns(w http.ResponseWriter, r *http.Request) {
renderTemplate(w, "index")
renderTemplate(w, "dashboard")
}
func Login(w http.ResponseWriter, r *http.Request) {
@ -72,6 +72,6 @@ func Login(w http.ResponseWriter, r *http.Request) {
}
func renderTemplate(w http.ResponseWriter, tmpl string) {
t, _ := template.ParseFiles("static/templates/" + tmpl + ".html")
t.Execute(w, "T")
t := template.Must(template.New("template").ParseFiles("templates/base.html", "templates/nav.html", "templates/"+tmpl+".html"))
t.ExecuteTemplate(w, "base", "T")
}

View File

@ -4798,6 +4798,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
.navbar-inverse {
background-color: #201e1c;
border-color: #080808;
box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1)
}
.navbar-inverse .navbar-brand {

View File

@ -2,3 +2,62 @@
margin: 4px 0px;
float: left;
}
#navbar-login {
padding-top:8px;
padding-bottom:0px;
}
.sans {
font-family: 'Open Sans', sans-serif;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin-heading {
text-align:center;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
font-family: 'Open Sans', sans-serif;
position: relative;
font-size: 16px;
height: auto;
padding: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="text"] {
margin-bottom: -1px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
#logo {
display: block;
margin-left: auto;
margin-right: auto;
}
footer > p {
color:#444444;
font-family: 'Open Sans', sans-serif;
}

View File

@ -1,73 +0,0 @@
<!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.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
<title>Gophish - Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/main.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img class="navbar-logo" src="/images/logo_inv_small.png"/>
<a class="navbar-brand" href="/">&nbsp;gophish</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="/login">Login</a></li>
</ul>
</div><!--/.navbar-collapse -->
</div>
</div>
<div class="jumbotron">
<div class="container" style="text-align:center;">
<h1>
Dashboard
</h1>
</div>
</div>
<div class="container">
<div style="text-align:center;" class="row">
<div class="col-lg-12">
<br/>
<h3>Coming soon...</h3>
</div>
</div>
<hr>
<footer>
<p>&copy; Jordan (jordan-wright) 2013</p>
</footer>
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>

View File

@ -1,34 +0,0 @@
<!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.0">
<meta name="description" content="">
<meta name="author" content="Jordan">
<link rel="shortcut icon" href="/images/favicon.png">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
<title>Gophish - Login</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/signin.css" rel="stylesheet">
</head>
<body>
<div class="container">
<form class="form-signin">
<img id="logo" src="/images/logo.png"/>
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" placeholder="Username" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
<label class="checkbox">
<input type="checkbox" value="remember-me"> Remember me
</label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
</body>
</html>

34
templates/base.html Normal file
View File

@ -0,0 +1,34 @@
{{define "base"}}
<!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.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
<title>Gophish - Dashboard</title>
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/main.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
</head>
<body>
{{template "content"}}
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>
{{end}}

15
templates/dashboard.html Normal file
View File

@ -0,0 +1,15 @@
{{define "content"}} {{template "nav"}}
<div class="jumbotron">
<div class="container" style="text-align:center;">
<h1>
Dashboard
</h1>
</div>
</div>
<div class="container">
<hr>
<footer>
<p>&copy; Jordan (jordan-wright) 2013</p>
</footer>
</div>
{{end}}

14
templates/login.html Normal file
View File

@ -0,0 +1,14 @@
{{define "content"}}
<div class="container">
<form class="form-signin">
<img id="logo" src="/images/logo.png" />
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" placeholder="Username" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
<label class="checkbox">
<input type="checkbox" value="remember-me">Remember me
</label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div>
{{end}}

24
templates/nav.html Normal file
View File

@ -0,0 +1,24 @@
{{define "nav"}}
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img class="navbar-logo" src="/images/logo_inv_small.png" />
<a class="navbar-brand" href="/">&nbsp;gophish</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a id="navbar-login" href="/login">
<button type="button" class="btn btn-primary">Login</button>
</a>
</li>
</ul>
</div>
</div>
</div>
{{end}}