Skip to content

Commit

Permalink
feat(content): adds extra dashboard text field
Browse files Browse the repository at this point in the history
* adds extra dashboard text field

* test example: new "report coming soon" label in sysactors

* reverting example section audit field
  • Loading branch information
yiannisbot committed Oct 19, 2020
1 parent a50ad98 commit 048a425
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions assets/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
.text-wip {
color: var(--cl-yellow);
}
.text-coming {
color: var(--cl-yellow);
}
.text-reliable {
color: var(--cl-green);
}
Expand All @@ -34,6 +37,9 @@
.bg-wip {
background-color: var(--cl-yellow) !important;
}
.bg-coming {
background-color: var(--cl-yellow) !important;
}
.bg-done {
background-color: var(--cl-green) !important;
}
Expand Down
13 changes: 8 additions & 5 deletions layouts/shortcodes/dashboard-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@
{{ end }}

{{ define "stateToNumber" }}
{{- $num := 6 -}}
{{- $num := 7 -}}
{{- if eq . "done" -}}{{$num = 1}}{{end}}
{{- if eq . "stable" -}}{{$num = 1}}{{end}}
{{- if eq . "reliable" -}}{{$num = 2}}{{end}}
{{- if eq . "wip" -}}{{$num = 3}}{{end}}
{{- if eq . "incorrect" -}}{{$num = 4}}{{end}}
{{- if eq . "missing" -}}{{$num = 5}}{{end}}
{{- if eq . "coming" -}}{{$num = 6}}{{end}}
{{- $num -}}
{{end}}

{{ define "humanizeState" }}
{{- if eq . "wip" -}}
Draft/WIP
{{- else if eq . "coming" -}}
Report Coming Soon
{{- else if eq . "n/a" -}}
{{ else }}
{{ humanize . }}
Expand All @@ -46,16 +49,16 @@
<td class="Dashboard-section">
{{.number}} <a href="#{{.id}}">{{.text}}</a>
</td>

<!-- State -->
<td data-sort="{{template "stateToNumber" .dashboardState}}" class="text-black bg-na bg-{{.dashboardState}}">
{{ template "humanizeState" .dashboardState }}
</td>

<!-- Audit -->
<td data-sort="{{template "stateToNumber" .dashboardAudit}}" class="text-black bg-{{.dashboardAudit}}">
{{- if eq .dashboardAuditURL "" -}}
{{ template "humanizeState" .dashboardAudit }}
{{ template "humanizeState" .dashboardAudit }}
{{ else }}
<a href="{{ .dashboardAuditURL }}" title="Read the audit report" target="_blank" rel="noopener noreferrer" class="text-black">{{.dashboardAuditDate}}<i class="gg-external gg-s-half"></i></a>
{{ end }}
Expand All @@ -66,4 +69,4 @@
{{- template "dashboard-spec-tr" . -}}
{{ end }}
{{ end }}
{{- end -}}
{{- end -}}

0 comments on commit 048a425

Please sign in to comment.