diff --git a/common-theme/layouts/_default/backlog.html b/common-theme/layouts/_default/backlog.html index 558922bc6..1e202f742 100644 --- a/common-theme/layouts/_default/backlog.html +++ b/common-theme/layouts/_default/backlog.html @@ -1,9 +1,59 @@ {{ define "main" }} + {{ $backlog_filter := .Page.Params.backlog_filter }} + {{ $repos := .Page.Params.backlog }} + {{ if not (reflect.IsSlice $repos) }} + {{ $repos = slice $repos }} + {{ end }}
{{ partial "page-header.html" . }} {{ with .Content }}
{{ . }}
{{ end }} - {{ partial "issues.html" . }} + {{/* you can have multiple repos but probably for sanity let's just stick with one label filter + for each repo, grab the issues that match the filter + */}} + {{ range $repos }} + {{ $issueBlocks := partial "block/issues-list-as-blocks.html" (dict "backlog" . "backlog_filter" $backlog_filter) }} + {{ range $issueBlocks }} + +
+ + {{ .name }} + 🔗 + + Clone + + +
+ {{ partial "block/block.html" (dict "block" . "Page" + $.Page "Site" site ) + }} +
+
+ {{ with .labels.nodes }} + + {{ end }} + {{ end }} + {{ end }}
{{ end }} diff --git a/common-theme/layouts/partials/block/issue.html b/common-theme/layouts/partials/block/issue.html index adc20a5bf..dab0c23f2 100644 --- a/common-theme/layouts/partials/block/issue.html +++ b/common-theme/layouts/partials/block/issue.html @@ -21,20 +21,22 @@ {{ end }} {{ end }} {{ end }} + + {{/* extract objectives */}} + {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response.body }} + + {{ if gt (len $extractedObjectives) 0 }} +
+ +

Learning Objectives

+
+ {{ range $extractedObjectives }} + {{ . | markdownify }} + {{ end }} +
+ {{ end }} - {{/* extract objectives */}} - {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response.body }} - {{ if gt (len $extractedObjectives) 0 }} -
- -

Learning Objectives

-
- {{ range $extractedObjectives }} - {{ . | markdownify }} - {{ end }} -
- {{ end }}
{{ $response.body | markdownify }}
diff --git a/common-theme/layouts/partials/block/issues-list-as-blocks.html b/common-theme/layouts/partials/block/issues-list-as-blocks.html index 05c9b6fdc..0cf08a1d6 100644 --- a/common-theme/layouts/partials/block/issues-list-as-blocks.html +++ b/common-theme/layouts/partials/block/issues-list-as-blocks.html @@ -25,6 +25,20 @@ nodes { title url + number + labels( + first: 25 + orderBy: { + direction: DESC + field: NAME + } + ) { + nodes { + name + color + description + } + } } } } @@ -37,9 +51,9 @@ {{ $issueBlocks := slice }} {{ with resources.GetRemote "https://api.github.com/graphql" (merge $request (partial "github-auth.html" .)) }} {{ with .Content | unmarshal }} - {{ with .data.repository.issues }} - {{ range .nodes }} - {{ $issueBlocks = $issueBlocks | append (dict "name" .title "src" .url) }} + {{ with .data.repository.issues.nodes }} + {{ range sort . "title" "asc" }} + {{ $issueBlocks = $issueBlocks | append (dict "name" .title "src" .url "number" .number "labels" .labels) }} {{ end }} {{ end }} {{ end }} diff --git a/common-theme/layouts/partials/issues.html b/common-theme/layouts/partials/issues.html deleted file mode 100644 index 3c7b1bdf4..000000000 --- a/common-theme/layouts/partials/issues.html +++ /dev/null @@ -1,96 +0,0 @@ -{{/* This is a page, basically, not a block, so we don't go via blockData for now */}} -{{ $repo := .Params.backlog }} -{{ $issuesUrl := print site.Params.orgapi $repo "/issues?per_page=100&state=open&direction=asc" }} -{{ $filter := .Params.backlog_filter }} -{{ $currentPath := .Page.RelPermalink }} -{{ $headers := partial "github-auth.html" }} - -{{ with resources.GetRemote $issuesUrl $headers }} - {{ with .Err }} - {{ errorf "Failed %s on %s. Error: %s" $issuesUrl .Page.Title . }} - {{ end }} - - {{ with .Content }} - {{ if eq . "[]" }} - {{ warnf "No issues found at %s" $issuesUrl }} - {{ else }} - {{ $issues := . | unmarshal }} - {{/* */}} - {{ range (sort $issues "title" "asc") }} - - {{ $showIssue := true }} - {{/* */}} - {{ if $filter }} - {{ $showIssue = false }} - {{ range .labels }} - {{ if in .name - $filter - }} - {{ $showIssue = true }} - {{ end }} - {{ end }} - {{ end }} - - {{ if (isset . "pull_request") }} - {{ $showIssue = false }} - {{ end }} - - {{ if $showIssue }} - {{ if strings.Contains .body "_No response_" }} - {{ errorf "Issue %s contains _No response_ - please edit the issue to remove it." .html_url }} - {{ end }} - -
- - {{ .title }} - 🔗 - - Clone - - - -
- {{/* extract objectives */}} - {{ $extractedObjectives := partial "strings/extract-github-objectives.html" .body }} - - {{ if gt (len $extractedObjectives) 0 }} -
- -

Learning Objectives

-
- {{ range $extractedObjectives }} - {{ . | markdownify }} - {{ end }} -
- {{ end }} - {{ .body | markdownify }} -
-
- {{ with .labels }} - - {{ end }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} -{{ end }} diff --git a/common-theme/layouts/partials/page-header.html b/common-theme/layouts/partials/page-header.html index ddb484ffe..ea8e2a506 100644 --- a/common-theme/layouts/partials/page-header.html +++ b/common-theme/layouts/partials/page-header.html @@ -53,12 +53,18 @@

+ {{ $repos := .Page.Params.backlog | default ""}} + {{ if not (reflect.IsSlice $repos)}} + {{ $repos = slice .Page.Params.backlog}} + {{ end}} + {{ range $repos}} {{ .Page.Params.backlog }} - 🔗 + href="{{ site.Params.org }}/{{ . }}/issues" + > {{ . }} + 🔗   + {{ end}}

{{ else }} {{ with .Page.Description }}