diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/templates/categories/categoryheader.tmpl | 1 | ||||
-rw-r--r-- | web/templates/categories/components/pullrequests.tmpl | 64 | ||||
-rw-r--r-- | web/templates/categories/show.tmpl | 2 |
3 files changed, 67 insertions, 0 deletions
diff --git a/web/templates/categories/categoryheader.tmpl b/web/templates/categories/categoryheader.tmpl index 8c2dfb5..2d540b2 100644 --- a/web/templates/categories/categoryheader.tmpl +++ b/web/templates/categories/categoryheader.tmpl @@ -21,6 +21,7 @@ <nav class="nav kk-package-nav"> <a class="nav-link {{if eq .PageName "packages"}}active{{end}}" href="/categories/{{.Category.Name}}"><i class="fa fa-list-ul mr-1" aria-hidden="true"></i> Packages <span class="ml-1 badge badge-pill kk-misc-badge">{{len .Category.Packages}}</span></a> <a class="nav-link {{if eq .PageName "outdated"}}active{{end}}" href="/categories/{{.Category.Name}}/outdated"><i class="fa fa-tag mr-1" aria-hidden="true"></i> Outdated <span class="ml-1 badge badge-pill kk-misc-badge">{{.Category.PackagesInformation.Outdated}}</span></a> + <a class="nav-link {{if eq .PageName "pull-requests"}}active{{end}}" href="/categories/{{.Category.Name}}/pull-requests"><span class="octicon octicon-git-pull-request opticon-resource-icon ml-1"></span> Pull requests <span class="ml-1 badge badge-pill kk-misc-badge">{{.Category.PackagesInformation.PullRequests}}</span></a> </nav> </div> </div> diff --git a/web/templates/categories/components/pullrequests.tmpl b/web/templates/categories/components/pullrequests.tmpl new file mode 100644 index 0000000..90785ef --- /dev/null +++ b/web/templates/categories/components/pullrequests.tmpl @@ -0,0 +1,64 @@ +{{define "pull-requests"}} + <div class="row"> + <div class="col-md-9"> + {{- if gt .Category.PackagesInformation.PullRequests 0}} + <h3 class="mb-4">Pull Requests</h3> + <ul class="list-group"> + {{- range .PullRequests }} + <li class="list-group-item"> + <div class="row"> + <div class="col-md-11"> + <span class="octicon octicon-git-pull-request opticon-resource-icon ml-1" style="color:SeaGreen;"></span> + <a href="https://github.com/gentoo/gentoo/pull/{{.Id}}" class="text-dark"><b>{{.Title}}</b></a> + {{- if eq .CiState "SUCCESS" -}} + <a href="{{.CiStateLink}}"><i class="fa fa-check mx-1" aria-hidden="true" style="color: SeaGreen;"></i></a> + {{- else -}} + <a href="{{.CiStateLink}}"><i class="fa fa-times mx-1" aria-hidden="true" style="color: #b60205;"></i></a> + {{- end -}} + {{- range .Labels }} + <span class="badge badge-pill badge-light p-1" style="font-weight: normal; {{if eq .Color "5319e7" "0052cc" "b60205"}}color:#FFF;{{end}} background-color: #{{.Color}}!important;">{{.Name}}</span> + {{- end -}} + </div> + <div class="col-md-1 text-right"> + <a href="https://github.com/gentoo/gentoo/pull/{{.Id}}" class="text-muted"> + <i class="fa fa-comment-o" aria-hidden="true"></i> + {{.Comments}} + </a> + </div> + <div class="col-md-12 text-muted"> + <span style="font-size: 90%;"> + #{{.Id}} opened {{.CreatedAt}} by {{.Author}} + </span> + </div> + </div> + </li> + {{- end }} + </ul> + {{- else -}} + <div class="row pt-5"> + <div class="col-md-4"> + <img style="width: 100%;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/Larry-the-cow-full.svg/1200px-Larry-the-cow-full.svg.png"/> + </div> + <div class="col-md-8 pt-3"> + <h2>There are no pull requests</h2> + <span>You think something is missing here? <br/> Start with filling a <a href="https://wiki.gentoo.org/wiki/Gentoo_GitHub">new pull requests</a>.</span> + </div> + </div> + {{- end }} + </div> + <div class="col-md-3 pt-4"> + <h4 class=""> + <a class="collapseLink" style="color:#000000;" data-toggle="collapse" href="#collapseDescription" role="button" aria-expanded="false" aria-controls="collapseDescription"> + Description + </a> + </h4> + <div class="collapse show" id="collapseDescription"> + <span class="text-muted"> + If you also like to help the Gentoo project, you can consider sending a Pull Request via GitHub.<br/> + Before doing so, you might want to take a look at <a href="https://wiki.gentoo.org/wiki/Gentoo_GitHub">the wiki page</a>. + </span> + </div> + </div> + </div> + +{{end}} diff --git a/web/templates/categories/show.tmpl b/web/templates/categories/show.tmpl index 9a32510..1a853bb 100644 --- a/web/templates/categories/show.tmpl +++ b/web/templates/categories/show.tmpl @@ -14,6 +14,8 @@ {{template "packages" .}} {{else if eq .PageName "outdated"}} {{template "outdated" .}} + {{else if eq .PageName "pull-requests"}} + {{template "pull-requests" .}} {{end}} </div> </div> |