From 290aa0df0204038b8c7b23c28d716755e468f169 Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Fri, 25 Jan 2019 16:53:51 +0200 Subject: fix #42, #51; v4-dev1 begins --- i18n/en.yaml | 11 +- i18n/lt.yaml | 8 +- layouts/affected/404.html | 21 ++++ layouts/index.html | 185 +++--------------------------- layouts/partials/index/announcements.html | 14 +++ layouts/partials/index/autorefresh.html | 8 ++ layouts/partials/index/components.html | 53 +++++++++ layouts/partials/index/incidents.html | 61 ++++++++++ layouts/partials/index/noscript.html | 4 + layouts/partials/index/summary.html | 24 ++++ layouts/partials/index/tabs.html | 20 ++++ 11 files changed, 240 insertions(+), 169 deletions(-) create mode 100644 layouts/affected/404.html create mode 100644 layouts/partials/index/announcements.html create mode 100644 layouts/partials/index/autorefresh.html create mode 100644 layouts/partials/index/components.html create mode 100644 layouts/partials/index/incidents.html create mode 100644 layouts/partials/index/noscript.html create mode 100644 layouts/partials/index/summary.html create mode 100644 layouts/partials/index/tabs.html diff --git a/i18n/en.yaml b/i18n/en.yaml index 3eafd19..6e3a60a 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -113,7 +113,7 @@ - id: notFound translation: There is nothing here. - id: notFoundText - translation: This could be a problem on our part. Perhaps we moved a certain resource and now it is gone. It is also possible that the resource you are trying to view is empty (for example, if a system has never been down, we have nothing to show). But do you also mind to double check the link? + translation: This could be a problem on our part. Perhaps we moved a certain resource and now it is gone. It is also possible that the resource you are trying to view is empty. But do you also mind to double check the link? - id: rss translation: Subscribe via RSS @@ -131,3 +131,12 @@ translation: entries - id: newestToOldest translation: newest to oldest + +## +## v4 +## +## +## v4 +## +- id: notFoundAffected + translation: It looks like this system either does not exist or has never had any recorded downtime. \ No newline at end of file diff --git a/i18n/lt.yaml b/i18n/lt.yaml index 6721e8e..bee5e28 100644 --- a/i18n/lt.yaml +++ b/i18n/lt.yaml @@ -113,7 +113,7 @@ - id: notFound translation: Čia nieko nėra. - id: notFoundText - translation: Tai gali būti mūsų problema — galbūt puslapis, kurį bandote peržiūrėti, buvo kitur perkeltas arba buvo ištrintas. Taip pat yra galimybė, jog puslapis yra tuščias (pvz. jeigu vienas komponentas mūsų sistemoje nėra turėjęs problemų, nėra ko rodyti). Rekomenduoje dar kartą patikrinti, ar nuoroda, kurią naudojate, nėra neteisinga. + translation: Tai gali būti mūsų problema — galbūt puslapis, kurį bandote peržiūrėti, buvo kitur perkeltas arba buvo ištrintas. Rekomenduoje dar kartą patikrinti, ar nuoroda, kurią naudojate, nėra neteisinga. - id: rss translation: Gaukite atnaujinimus naudojant RSS @@ -131,3 +131,9 @@ translation: įrašai - id: newestToOldest translation: naujiausi rodomi pirmi + +## +## v4 +## +- id: notFoundAffected + translation: Ši sistema neturi nė vieno įrašo. Arba neegzistuoja, arba nė vieną kartą nebuvo sutrukdyta jos veikla. \ No newline at end of file diff --git a/layouts/affected/404.html b/layouts/affected/404.html new file mode 100644 index 0000000..527c280 --- /dev/null +++ b/layouts/affected/404.html @@ -0,0 +1,21 @@ +{{ partial "meta" . }} + +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ $isNotice := where $active "Params.severity" "=" "notice" }} +{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} +{{ $isDown := where $active "Params.severity" "=" "down" }} + + + {{ partial "header" . }} + +
+

{{ T "notFoundAffected" }}

+

{{ T "notFoundText" }}

+
+ + {{ partial "js" . }} + {{ partial "footer" . }} + + diff --git a/layouts/index.html b/layouts/index.html index 2802ce1..be887c8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -12,185 +12,36 @@
- + + {{ partial "index/noscript" . }} - -
- - {{ if $isDown }} - {{ T "isDown" }} - {{ else }} - {{ if $isDisrupted }} - {{ T "isDisrupted" }} - {{ else }} - {{ if $isNotice }} - {{ T "isNotice" }} - {{ else }} - {{ T "isOk" }} - {{ end }}{{ end }}{{ end }} - + + {{ partial "index/summary" . }} - -
+ + {{ partial "index/announcements" . }} - {{ if $active }} -
- {{ range $active }} -
-

{{ .Title }}

- {{ .Content | safeHTML | truncate 500 "…" }} -

{{ T "continueReading" }}

-
- {{ else }}{{ end }} -
- {{ end }} - - {{ if .Site.Params.autoRefresh }} -
- {{ T "autoRefreshNotice" }} -
-
- {{ else }} -
- {{ end }} - - -
- {{ $systems := .Site.Params.systems }} - {{ range $systems }} - {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} - - {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} - {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} - {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} - -
- - {{ .name }} - - - {{ with .description }} - -   (?) + + {{ partial "index/autorefresh" . }} - - {{ . }} - - - {{ end }} + + {{ partial "index/components" . }} - - {{ if $thisIsDown }} - {{ T "thisIsDown" }} - {{ else }} - {{ if $thisIsDisrupted }} - {{ T "thisIsDisrupted" }} - {{ else }} - {{ if $thisIsNotice }} - {{ T "thisIsNotice" }} - {{ else }} - {{ T "thisIsOk" }} - {{ end }}{{ end }}{{ end }} - - - {{ with .partial }} -
- {{ partial . . }} -
- {{ end }} -
- {{ end }} -
- - {{ if .Site.Params.enableCustomHTML }} - {{ partial "custom/homepage-summary" . }} - {{ end }} - -
- - {{ if .Site.Params.customTabs }} -
-
- - {{ T "incidents" }} - - - {{ range .Site.Params.customTabs }} - - {{ .name }} - - {{ end }} + {{ if .Site.Params.enableCustomHTML }} + {{ partial "custom/homepage-summary" . }} + {{ end }} +
-
- {{ else }} -
-

{{ T "incidentHistory" }}

-
-
- {{ end }} + + {{ partial "index/tabs" . }} +
- {{ if not $incidents }} -
-

{{ T "calmBeforeTheStorm" }}

-

{{ T "noIncidentsDesc" }}

-
-
-
- {{ else }} - {{ $paginator := .Paginate $incidents .Site.Params.incidentPostsPerPage }} - {{ range $paginator.Pages }} - {{ .Render "small" }} - {{ end }} - - - {{ if gt $paginator.TotalPages 1 }} -
- -
- {{ if $paginator.HasPrev }} - - ⭠   - {{ T "prev" }} - - {{ else }} - - ⭠   - {{ T "prev" }} - - {{ end }} - - -     - {{ $paginator.PageNumber }} - / - {{ $paginator.TotalPages }} -     - - - {{ if $paginator.HasNext }} - - {{ T "next" }}   - ⭢ - - {{ else }} - - {{ T "next" }}   - ⭢ - - {{ end }} -
- {{ end }} - {{ end }} + {{ partial "index/incidents" . }}
- - {{ partial "js" . }} {{ partial "footer" . }} diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html new file mode 100644 index 0000000..a02045e --- /dev/null +++ b/layouts/partials/index/announcements.html @@ -0,0 +1,14 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ if $active }} +
+ {{ range $active }} +
+

{{ .Title }}

+ {{ .Content | safeHTML | truncate 500 "…" }} +

{{ T "continueReading" }}

+
+ {{ else }}{{ end }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/index/autorefresh.html b/layouts/partials/index/autorefresh.html new file mode 100644 index 0000000..b419e2f --- /dev/null +++ b/layouts/partials/index/autorefresh.html @@ -0,0 +1,8 @@ +{{ if .Site.Params.autoRefresh }} +
+ {{ T "autoRefreshNotice" }} +
+
+ {{ else }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html new file mode 100644 index 0000000..9424cd0 --- /dev/null +++ b/layouts/partials/index/components.html @@ -0,0 +1,53 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ $isNotice := where $active "Params.severity" "=" "notice" }} +{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} +{{ $isDown := where $active "Params.severity" "=" "down" }} + +
+ {{ $systems := .Site.Params.systems }} + {{ range $systems }} + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }} + + {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }} + {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }} + {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }} + +
+ + {{ .name }} + + + {{ with .description }} + +   (?) + + + {{ . }} + + + {{ end }} + + + {{ if $thisIsDown }} + {{ T "thisIsDown" }} + {{ else }} + {{ if $thisIsDisrupted }} + {{ T "thisIsDisrupted" }} + {{ else }} + {{ if $thisIsNotice }} + {{ T "thisIsNotice" }} + {{ else }} + {{ T "thisIsOk" }} + {{ end }}{{ end }}{{ end }} + + + {{ with .partial }} +
+ {{ partial . . }} +
+ {{ end }} +
+ {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/index/incidents.html b/layouts/partials/index/incidents.html new file mode 100644 index 0000000..bf312e9 --- /dev/null +++ b/layouts/partials/index/incidents.html @@ -0,0 +1,61 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ $isNotice := where $active "Params.severity" "=" "notice" }} +{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} +{{ $isDown := where $active "Params.severity" "=" "down" }} + + + +{{ if not $incidents }} +
+

{{ T "calmBeforeTheStorm" }}

+

{{ T "noIncidentsDesc" }}

+
+
+
+{{ else }} + {{ $paginator := .Paginate $incidents .Site.Params.incidentPostsPerPage }} + {{ range $paginator.Pages }} + {{ .Render "small" }} + {{ end }} + + + {{ if gt $paginator.TotalPages 1 }} +
+ +
+ {{ if $paginator.HasPrev }} + + ⭠   + {{ T "prev" }} + + {{ else }} + + ⭠   + {{ T "prev" }} + + {{ end }} + + +     + {{ $paginator.PageNumber }} + / + {{ $paginator.TotalPages }} +     + + + {{ if $paginator.HasNext }} + + {{ T "next" }}   + ⭢ + + {{ else }} + + {{ T "next" }}   + ⭢ + + {{ end }} +
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/index/noscript.html b/layouts/partials/index/noscript.html new file mode 100644 index 0000000..ebebe8c --- /dev/null +++ b/layouts/partials/index/noscript.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/layouts/partials/index/summary.html b/layouts/partials/index/summary.html new file mode 100644 index 0000000..d8e3108 --- /dev/null +++ b/layouts/partials/index/summary.html @@ -0,0 +1,24 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ $isNotice := where $active "Params.severity" "=" "notice" }} +{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }} +{{ $isDown := where $active "Params.severity" "=" "down" }} + +
+ + {{ if $isDown }} + {{ T "isDown" }} + {{ else }} + {{ if $isDisrupted }} + {{ T "isDisrupted" }} + {{ else }} + {{ if $isNotice }} + {{ T "isNotice" }} + {{ else }} + {{ T "isOk" }} + {{ end }}{{ end }}{{ end }} + + + +
\ No newline at end of file diff --git a/layouts/partials/index/tabs.html b/layouts/partials/index/tabs.html new file mode 100644 index 0000000..e1fc986 --- /dev/null +++ b/layouts/partials/index/tabs.html @@ -0,0 +1,20 @@ +{{ if .Site.Params.customTabs }} +
+
+ + {{ T "incidents" }} + + + {{ range .Site.Params.customTabs }} + + {{ .name }} + + {{ end }} +
+
+{{ else }} +
+

{{ T "incidentHistory" }}

+
+
+{{ end }} \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 5f364a5ef49c6ace597399442ba3556be2cfee89 Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Fri, 25 Jan 2019 18:14:35 +0200 Subject: Misc. changes --- exampleSite/config.yml | 4 ++-- exampleSite/netlify.toml | 5 ++++- layouts/partials/footer.html | 2 +- layouts/partials/js.html | 2 +- layouts/partials/meta.html | 18 ++++++++---------- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 85c5e26..5015890 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -83,14 +83,14 @@ defaultContentLanguage: en # What is the hostname or path to the root? # Where is the site hosted? # -# 💥 cState & Hugo don’t support / in +# 💥 cState & Hugo don’t support '/' in # production use. It will break RSS # feeds and breaks permalinks since # version 3. If you are just testing, # localhost should automatically work. # # Example: https://status.example.com/ -baseURL: https://status.example.com +baseURL: https://cstate.mnts.lt ############################################################ # +------------------------------------------------------+ # diff --git a/exampleSite/netlify.toml b/exampleSite/netlify.toml index e387e8c..d649777 100644 --- a/exampleSite/netlify.toml +++ b/exampleSite/netlify.toml @@ -11,4 +11,7 @@ NODE_ENV = "production" [context.deploy-preview] - command = "hugo" + command = "hugo -b $DEPLOY_PRIME_URL" + +[context.branch-deploy] + command = "hugo -b $DEPLOY_PRIME_URL" \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 2dcea70..6187f61 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -4,7 +4,7 @@