From 81b078a04d0555de9658898d4da73e0ac83bd31c Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Tue, 7 May 2019 22:29:51 +0300 Subject: First working example of categories --- exampleSite/config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 74d30b4..8b45b9b 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -99,6 +99,8 @@ baseURL: https://cstate.mnts.lt ############################################################ params: + enableCategories: false + # These are your systems. Change them to # change the amount of components. # @@ -106,10 +108,21 @@ params: # https://github.com/cstate/cstate/wiki/Customization systems: - name: Gateway + category: North Coast - name: API description: The guts of the application. + category: Uncategorized - name: Media Proxy description: This is the service responsible for serving images, audio, and video. It is reliant on our CDN. + category: Uncategorized + + categories: + - name: North Coast + description: The worst one. Or the best one. + closed: true + - name: Uncategorized + untitled: true + # What date format to use? # -- cgit v1.2.3-70-g09d2 From f8b0da97d84c043576418b9d28f5d75d94d611aa Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Wed, 8 May 2019 22:16:24 +0300 Subject: Categories working except for the arrow --- exampleSite/config.yml | 6 +++++- layouts/partials/index/components.html | 8 +++++--- layouts/partials/index/summary.html | 2 +- layouts/partials/meta.html | 26 +++++++++++++++++++------- 4 files changed, 30 insertions(+), 12 deletions(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 8b45b9b..a45d06d 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -109,6 +109,8 @@ params: systems: - name: Gateway category: North Coast + - name: Backup Gateway + category: East Coast - name: API description: The guts of the application. category: Uncategorized @@ -119,10 +121,12 @@ params: categories: - name: North Coast description: The worst one. Or the best one. - closed: true + closed: true + - name: East Coast - name: Uncategorized untitled: true + # What date format to use? # diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index 392acb7..47da96c 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -13,8 +13,10 @@ {{ range $categories }}
{{ if not .untitled }} -
- {{ if .closed }}⯈{{ else }}⯆{{ end }} +
+ + {{ if .closed }}⯈{{ else }}⯆{{ end }} + {{ .name }} @@ -35,7 +37,7 @@ {{ $categorySystems := where $systems "category" "=" .name }} -
+
{{ range $categorySystems }} {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} diff --git a/layouts/partials/index/summary.html b/layouts/partials/index/summary.html index d8e3108..de6bceb 100644 --- a/layouts/partials/index/summary.html +++ b/layouts/partials/index/summary.html @@ -20,5 +20,5 @@ {{ end }}{{ end }}{{ end }} - +
\ No newline at end of file diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index ad4655a..9acc554 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -20,6 +20,8 @@ var themeNoticeColor = '#{{ .Site.Params.notice }}'; var themeDisruptedColor = '#{{ .Site.Params.disrupted }}'; var themeDownColor = '#{{ .Site.Params.down }}'; + + {{ if .Site.Params.enableCustomHTML }} {{ partial "custom/meta" . }} -- cgit v1.2.3-70-g09d2 From d04adae5f8ac3e8296b2efc1c455abdafc37eb60 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sun, 15 Dec 2019 12:37:26 +0200 Subject: Fix #83 - hex colors now need hash --- exampleSite/config.yml | 24 +++++++++++++----------- layouts/partials/meta.html | 42 +++++++++++++++++++++--------------------- static/admin/config.yml | 20 ++++++++++---------- 3 files changed, 44 insertions(+), 42 deletions(-) (limited to 'exampleSite') diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 98f95c0..3e474b1 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -237,20 +237,22 @@ params: incidentPostsPerPage: 10 # Colors throughout cState - # HEX codes without the # + # + # We recommend using HEX + # (with the # symbol). # # Defaults: # - # brand: "0a0c0f" - # ok: "008000" - # disrupted: "cc4400" - # down: "e60000" - # notice: "24478f" - brand: "0a0c0f" - ok: "008000" - disrupted: "cc4400" - down: "e60000" - notice: "24478f" + # brand: "#0a0c0f" + # ok: "#008000" + # disrupted: "#cc4400" + # down: "#e60000" + # notice: "#24478f" + brand: "#0a0c0f" + ok: "#008000" + disrupted: "#cc4400" + down: "#e60000" + notice: "#24478f" # If the status page shows that # there are disruptions or outages diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index bcd3967..d953331 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -13,13 +13,13 @@ {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - + @@ -95,9 +95,9 @@ .clean { margin: 0; } - .ok { color: #{{ .Site.Params.ok }}; } - .warning { color: #{{ .Site.Params.disrupted }}; } - .error { color: #{{ .Site.Params.down }}; } + .ok { color: {{ .Site.Params.ok }}; } + .warning { color: {{ .Site.Params.disrupted }}; } + .error { color: {{ .Site.Params.down }}; } .contain { max-width: 640px; @@ -157,7 +157,7 @@ .header { padding: 8px 0; - background: #{{ .Site.Params.brand }}; + background: {{ .Site.Params.brand }}; } .header a { @@ -295,18 +295,18 @@ * Specific to the status */ - .status-ok .summary { background: #{{ .Site.Params.ok }}; } - .status-disrupted .summary, .change-header-color.status-disrupted .header { background: #{{ .Site.Params.disrupted }}; } - .status-down .summary, .change-header-color.status-down .header { background: #{{ .Site.Params.down }}; } - .status-notice .summary, .change-header-color.status-notice .header { background: #{{ .Site.Params.notice }}; } + .status-ok .summary { background: {{ .Site.Params.ok }}; } + .status-disrupted .summary, .change-header-color.status-disrupted .header { background: {{ .Site.Params.disrupted }}; } + .status-down .summary, .change-header-color.status-down .header { background: {{ .Site.Params.down }}; } + .status-notice .summary, .change-header-color.status-notice .header { background: {{ .Site.Params.notice }}; } .announcement-box .padding { padding: 16px; } - .status-disrupted .announcement-box { border: 2px solid #{{ .Site.Params.disrupted }}; } - .status-down .announcement-box { border: 2px solid #{{ .Site.Params.down }}; } - .status-notice .announcement-box { border: 2px solid #{{ .Site.Params.notice }}; } + .status-disrupted .announcement-box { border: 2px solid {{ .Site.Params.disrupted }}; } + .status-down .announcement-box { border: 2px solid {{ .Site.Params.down }}; } + .status-notice .announcement-box { border: 2px solid {{ .Site.Params.notice }}; } .status-disrupted .announcement-box, .status-down .announcement-box, .status-notice .announcement-box { border-top: 0; } @@ -316,10 +316,10 @@ */ .component-status { float: right; } - .component[data-status="ok"] .component-status { color: #{{ .Site.Params.ok }}; } - .component[data-status="disrupted"] .component-status { color: #{{ .Site.Params.disrupted }}; } - .component[data-status="down"] .component-status { color: #{{ .Site.Params.down }}; } - .component[data-status="notice"] .component-status { color: #{{ .Site.Params.notice }}; } + .component[data-status="ok"] .component-status { color: {{ .Site.Params.ok }}; } + .component[data-status="disrupted"] .component-status { color: {{ .Site.Params.disrupted }}; } + .component[data-status="down"] .component-status { color: {{ .Site.Params.down }}; } + .component[data-status="notice"] .component-status { color: {{ .Site.Params.notice }}; } /** * Responsiveness diff --git a/static/admin/config.yml b/static/admin/config.yml index 1b64060..0827f66 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -201,30 +201,30 @@ collections: default: true # Colors - label: 'Site HEX color: Brand' - hint: 'Should not have # mark. Default: 181818' + hint: 'Use any color type, even rgb() works. We recommend HEX: #123456. Default: #0a0c0f' name: 'brand' widget: 'string' - default: '181818' + default: '#0a0c0f' - label: 'Site HEX color: Operational / OK' - hint: 'Should not have # mark. Default: 228B22' + hint: 'Use any color type, even rgb() works. We recommend HEX: #123456. Default: #008000' name: 'ok' widget: 'string' - default: '228B22' + default: '#008000' - label: 'Site HEX color: Disrupted' - hint: 'Should not have # mark. Default: FF8C00' + hint: 'Use any color type, even rgb() works. We recommend HEX: #123456. Default: #cc4400' name: 'disrupted' widget: 'string' - default: 'FF8C00' + default: '#cc4400' - label: 'Site HEX color: Down / Offline / Major' - hint: 'Should not have # mark. Default: DC143C' + hint: 'Use any color type, even rgb() works. We recommend HEX: #123456. Default: #e60000' name: 'down' widget: 'string' - default: 'DC143C' + default: '#e60000' - label: 'Site HEX color: Notice' - hint: 'Should not have # mark. Default: 708090' + hint: 'Use any color type, even rgb() works. We recommend HEX: #123456. Default: #24478f' name: 'notice' widget: 'string' - default: '708090' + default: '#24478f' # Google Analytics - label: 'Google Analytics tracking code' hint: 'By default, cState does not use Google Analytics. If you choose to use it, you may change the placeholder code below to your own and thereby enable the tracking service. If you set the value back to UA-00000000-1, the code will once again be removed.' -- cgit v1.2.3-70-g09d2