aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-03-31 10:25:34 +0000
committerFelix Hanley <felix@userspace.com.au>2020-03-31 10:25:34 +0000
commitec84e5226503f4c1a4ec8658f9db52abf9674c99 (patch)
treed42f5c3224e26342fa05b5c38d976f9c1d0e7d8a
parent7a5dc7b8b58d869fe7f0fb57c1c7b8462afb4e81 (diff)
downloadsws-ec84e5226503f4c1a4ec8658f9db52abf9674c99.tar.gz
sws-ec84e5226503f4c1a4ec8658f9db52abf9674c99.tar.bz2
Filter style updates
-rw-r--r--.gitignore1
-rw-r--r--sass/main.scss25
-rw-r--r--tmpl/filter.tmpl22
-rw-r--r--tmpl/hitView.tmpl10
-rw-r--r--tmpl/site.tmpl21
5 files changed, 40 insertions, 39 deletions
diff --git a/.gitignore b/.gitignore
index 0c40485..4bcecdd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ dist/
node_modules/
# Generated content
+static/default.css
counter/sws.min.js
cmd/server/migrations.go
cmd/server/counter.go
diff --git a/sass/main.scss b/sass/main.scss
index bbcf415..8774d86 100644
--- a/sass/main.scss
+++ b/sass/main.scss
@@ -4,7 +4,9 @@
$family-sans-serif: "Helvetica", "Arial", sans-serif;
$black: #120c13;
+$card-header-padding: 0.75rem 1rem 0;
$card-header-shadow: 0;
+$card-shadow: 0;
//@import "../node_modules/bulma/bulma";
@import "../node_modules/bulma/sass/utilities/_all";
@@ -24,6 +26,9 @@ $card-header-shadow: 0;
$gutter: 1rem;
$header-height: 3.25rem;
+body {
+ background-color: #fcfcfc;
+}
.navbar {
position: fixed;
@@ -35,29 +40,29 @@ $header-height: 3.25rem;
justify-content: space-between;
margin-left: $gutter;
margin-right: $gutter;
+ margin-top: $gutter;
}
.page--sites {
flex-direction: column;
}
.page--site {
flex-direction: row;
- padding-top: $navbar-height + $header-height + $gutter;
}
.header--site {
display: flex;
- position: fixed;
- top: $header-height;
- left: $gutter;
- right: $gutter;
- z-index: 100;
- background-color: white;
- padding: .5em;
}
.header__title {
flex: 1;
}
.filter {
- flex: 1;
+ background-color: #66666680;
+ border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+ padding: $gutter;
+ position: fixed;
+ right: 1em;
+ top: $header-height;
+ z-index: 100;
}
.site__summary {
width: 100%;
@@ -93,7 +98,7 @@ $header-height: 3.25rem;
.figure svg {
max-width: 100%;
- max-height: 400px;
+ max-height: 290px;
}
.chart {
diff --git a/tmpl/filter.tmpl b/tmpl/filter.tmpl
index e039281..750d1b3 100644
--- a/tmpl/filter.tmpl
+++ b/tmpl/filter.tmpl
@@ -1,6 +1,6 @@
{{ define "filter" }}
<div class="filter tags field is-grouped">
- <span>Filters:</span>
+ <span class="control">Filter:</span>
{{ if .QuerySetContains "bots" }}
{{ $bots := .Query.Get "bots" }}
{{ if eq $bots "0" }}
@@ -22,14 +22,14 @@
{{ else }}
<div class="control">
<span class="tags has-addons">
- <a class="tag is-info" href="?{{ .QuerySetEncode "bots" "0" }}">bots</a>
- <a class="tag is-light" href="?{{ .QuerySetEncode "bots" "0" }}">without</a>
+ <a class="tag is-info" href="?{{ .QuerySetEncode "bots" "0" }}">no</a>
+ <a class="tag is-light" href="?{{ .QuerySetEncode "bots" "0" }}">bots</a>
</span>
</div>
<div class="control">
<span class="tags has-addons">
- <a class="tag is-info" href="?{{ .QuerySetEncode "bots" "1" }}">bots</a>
- <a class="tag is-light" href="?{{ .QuerySetEncode "bots" "1" }}">only</a>
+ <a class="tag is-info" href="?{{ .QuerySetEncode "bots" "1" }}">only</a>
+ <a class="tag is-light" href="?{{ .QuerySetEncode "bots" "1" }}">bots</a>
</span>
</div>
{{ end }}
@@ -75,20 +75,20 @@
{{ else }}
<div class="control">
<span class="tags has-addons">
- <a class="tag is-info" href="?{{ datetimeRelative "-24h" | .QuerySetEncode "begin" }}">days</a>
- <a class="tag is-light" href="?{{ datetimeRelative "-24h" | .QuerySetEncode "begin" }}">1</a>
+ <a class="tag is-info" href="?{{ datetimeRelative "-24h" | .QuerySetEncode "begin" }}">1</a>
+ <a class="tag is-light" href="?{{ datetimeRelative "-24h" | .QuerySetEncode "begin" }}">day</a>
</span>
</div>
<div class="control">
<span class="tags has-addons">
- <a class="tag is-info" href="?{{ datetimeRelative "-168h" | .QuerySetEncode "begin" }}">days</a>
- <a class="tag is-light" href="?{{ datetimeRelative "-168h" | .QuerySetEncode "begin" }}">7</a>
+ <a class="tag is-info" href="?{{ datetimeRelative "-168h" | .QuerySetEncode "begin" }}">7</a>
+ <a class="tag is-light" href="?{{ datetimeRelative "-168h" | .QuerySetEncode "begin" }}">days</a>
</span>
</div>
<div class="control">
<span class="tags has-addons">
- <a class="tag is-info" href="?{{ datetimeRelative "-720h" | .QuerySetEncode "begin" }}">days</a>
- <a class="tag is-light" href="?{{ datetimeRelative "-720h" | .QuerySetEncode "begin" }}">30</a>
+ <a class="tag is-info" href="?{{ datetimeRelative "-720h" | .QuerySetEncode "begin" }}">30</a>
+ <a class="tag is-light" href="?{{ datetimeRelative "-720h" | .QuerySetEncode "begin" }}">days</a>
</span>
</div>
{{ end }}
diff --git a/tmpl/hitView.tmpl b/tmpl/hitView.tmpl
index f7d4dcb..6e7b5c8 100644
--- a/tmpl/hitView.tmpl
+++ b/tmpl/hitView.tmpl
@@ -11,7 +11,7 @@
{{ template "timeBarChart" .Hits }}
</figure>
{{ else }}
- <p>No hits yet</p>
+ <p>No hits</p>
{{ end }}
</div>
</section>
@@ -41,7 +41,7 @@
{{ end }}
</table>
{{ else }}
- <p>No page views yet</p>
+ <p>No page views</p>
{{ end }}
</div>
</section>
@@ -68,7 +68,7 @@
{{ end }}
</table>
{{ else }}
- <p>No page views yet</p>
+ <p>No page views</p>
{{ end }}
</div>
</section>
@@ -92,7 +92,7 @@
{{ end }}
</table>
{{ else }}
- <p>No referrers yet</p>
+ <p>No referrers</p>
{{ end }}
</div>
</section>
@@ -118,7 +118,7 @@
</tr>
{{ end }}
</table>
- {{ else }} <p>No browsers visits yet</p>
+ {{ else }} <p>No browsers visits</p>
{{ end }}
</div>
</section>
diff --git a/tmpl/site.tmpl b/tmpl/site.tmpl
index c44f8f0..d4deeb1 100644
--- a/tmpl/site.tmpl
+++ b/tmpl/site.tmpl
@@ -1,19 +1,14 @@
{{ define "content" }}
{{ if .Site.ID }}
- <header class="header header--site">
- <div class="header__title">
- {{ with .Site }}
- <h1 class="title title--site">{{ .Name }}</h1>
- {{ end }}
- </div>
- {{ if .Site.ID }}
- {{ template "filter" . }}
- {{ end }}
- </header>
+ {{ with .Site }}
+ <h1 class="title title--site">{{ .Name }}</h1>
+ {{ end }}
{{ else }}
- <header class="header header--site">
- <h1 class="title--site">New Site</h1>
- </header>
+ <h1 class="title title--newsite">New Site</h1>
+ {{ end }}
+
+ {{ if .Site.ID }}
+ {{ template "filter" . }}
{{ end }}
{{ template "siteSummary" . }}