summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorHorus_Arch2015-02-24 18:58:08 +0100
committerHorus_Arch2015-02-24 18:58:08 +0100
commit9e1d8d0fb2b57903b1c6c0c2765b7808655c74a0 (patch)
treea3f8546269eec6edb84fa740bc485c37542498bc /views
parent8763022c77f0ad8edf6578962a524715d99e8d39 (diff)
downloadstatuspage-9e1d8d0fb2b57903b1c6c0c2765b7808655c74a0.tar.gz
Struct with flash and error messages to differentiate in template.
Diffstat (limited to 'views')
-rw-r--r--views/jobs.html10
-rw-r--r--views/jobs_error.html52
2 files changed, 7 insertions, 55 deletions
diff --git a/views/jobs.html b/views/jobs.html
index df54994..510339d 100644
--- a/views/jobs.html
+++ b/views/jobs.html
@@ -2,14 +2,18 @@
{{template "navbar.html"}}
<div class="container">
<div class="row">
-{{range .}}
+{{range .Error}}
+<h4 class="col-md-4 col-md-offset-4 alert alert-danger alert-dismissible" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
+ {{.}}
+</h4>
+{{end}}
+{{range .Success}}
<h4 class="col-md-4 col-md-offset-4 alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
{{.}}
</h4>
{{end}}
- <div class="text-center">
- </div>
</div>
</div>
<div class="container">
diff --git a/views/jobs_error.html b/views/jobs_error.html
deleted file mode 100644
index c13cbd8..0000000
--- a/views/jobs_error.html
+++ /dev/null
@@ -1,52 +0,0 @@
-{{template "header.html"}}
-{{template "navbar.html"}}
-<div class="container">
- <div class="row">
-{{range .}}
-<h4 class="col-md-4 col-md-offset-4 alert alert-danger alert-dismissible" role="alert">
- <button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">&times;</span></button>
- {{.}}
-</h4>
-{{end}}
- <div class="text-center">
- </div>
- </div>
-</div>
-<div class="container">
- <div class="row">
-<form class="form-horizontal" method='post' action='/new'>
- <fieldset>
-
- <!-- Form Name -->
- <div class="text-center">
- <legend>Add new job!</legend>
- </div>
-
- <!-- Text input-->
- <div class="form-group">
- <label class="col-md-4 control-label" for="Url">Job Url:</label>
- <div class="col-md-4">
- <div class="input-group">
- <input id="Url" name="Url" placeholder="Url to monitor." class="form-control input-md" required="" type="text">
- <span class="input-group-addon">
- <input name="Private" type="checkbox">
- </span>
- </div>
- <span class="help-block">Check to mark this host as private.</span>
- </div>
- </div>
-
- <!-- Button -->
- <div class="form-group">
- <label class="col-md-4 control-label" for="submit"></label>
- <div class="col-md-4">
- <button class="btn btn-primary">Submit</button>
- </div>
- </div>
-
- </fieldset>
-</form>
-
- </div>
-</div>
-{{template "footer.html"}}