diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-11 10:27:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-10-11 10:27:00 +0000 |
commit | 65aa53fc52ff15efe54df4147564828d535837f8 (patch) | |
tree | 31c51dad04fdcca80e6d3043c8bd49d2f1a51f83 /templates/explore | |
parent | Initial commit. (diff) | |
download | forgejo-upstream.tar.xz forgejo-upstream.zip |
Adding upstream version 8.0.3.HEADupstream/8.0.3upstreamdebian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'templates/explore')
-rw-r--r-- | templates/explore/code.tmpl | 8 | ||||
-rw-r--r-- | templates/explore/navbar.tmpl | 20 | ||||
-rw-r--r-- | templates/explore/repo_list.tmpl | 73 | ||||
-rw-r--r-- | templates/explore/repos.tmpl | 10 | ||||
-rw-r--r-- | templates/explore/search.tmpl | 23 | ||||
-rw-r--r-- | templates/explore/user_list.tmpl | 33 | ||||
-rw-r--r-- | templates/explore/users.tmpl | 10 |
7 files changed, 177 insertions, 0 deletions
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl new file mode 100644 index 00000000..039933fa --- /dev/null +++ b/templates/explore/code.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content explore users"> + {{template "explore/navbar" .}} + <div class="ui container"> + {{template "shared/search/code/search" .}} + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl new file mode 100644 index 00000000..8e619fa6 --- /dev/null +++ b/templates/explore/navbar.tmpl @@ -0,0 +1,20 @@ +<overflow-menu class="ui secondary pointing tabular top attached borderless menu secondary-nav"> + <div class="overflow-menu-items tw-justify-center"> + <a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos"> + {{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}} + </a> + {{if not .UsersIsDisabled}} + <a class="{{if .PageIsExploreUsers}}active {{end}}item" href="{{AppSubUrl}}/explore/users"> + {{svg "octicon-person"}} {{ctx.Locale.Tr "explore.users"}} + </a> + {{end}} + <a class="{{if .PageIsExploreOrganizations}}active {{end}}item" href="{{AppSubUrl}}/explore/organizations"> + {{svg "octicon-organization"}} {{ctx.Locale.Tr "explore.organizations"}} + </a> + {{if and (not $.UnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}} + <a class="{{if .PageIsExploreCode}}active {{end}}item" href="{{AppSubUrl}}/explore/code"> + {{svg "octicon-code"}} {{ctx.Locale.Tr "explore.code"}} + </a> + {{end}} + </div> +</overflow-menu> diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl new file mode 100644 index 00000000..59bc6c8a --- /dev/null +++ b/templates/explore/repo_list.tmpl @@ -0,0 +1,73 @@ +<div class="flex-list"> + {{range .Repos}} + <div class="flex-item"> + <div class="flex-item-leading"> + {{template "repo/icon" .}} + </div> + <div class="flex-item-main"> + <div class="flex-item-header"> + <div class="flex-item-title"> + {{if and (or $.PageIsExplore $.PageIsProfileStarList) .Owner}} + <a class="text primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/ + {{end}} + <a class="text primary name" href="{{.Link}}">{{.Name}}</a> + <span class="label-list"> + {{if .IsArchived}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> + {{end}} + {{if .IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span> + {{else}} + {{if .Owner.Visibility.IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> + {{end}} + {{end}} + {{if .IsTemplate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span> + {{end}} + {{if eq .ObjectFormatName "sha256"}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span> + {{end}} + </span> + </div> + <div class="flex-item-trailing muted-links"> + {{if .PrimaryLanguage}} + <a class="flex-text-inline" href="?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}{{if $.TabName}}&tab={{$.TabName}}{{end}}"> + <i class="color-icon tw-mr-2" style="background-color: {{.PrimaryLanguage.Color}}"></i> + {{.PrimaryLanguage.Language}} + </a> + {{end}} + {{if not $.DisableStars}} + <a class="flex-text-inline" href="{{.Link}}/stars" aria-label="{{ctx.Locale.TrN .NumStars "explore.stars_one" "explore.stars_few" .NumStars}}" {{if ge .NumStars 1000}}data-tooltip-content="{{.NumStars}}"{{end}}> + {{svg "octicon-star" 16}} + {{CountFmt .NumStars}} + </a> + {{end}} + {{if not $.DisableForks}} + <a class="flex-text-inline" href="{{.Link}}/forks" aria-label="{{ctx.Locale.TrN .NumForks "explore.forks_one" "explore.forks_few" .NumForks}}" {{if ge .NumForks 1000}}data-tooltip-content="{{.NumForks}}"{{end}}> + {{svg "octicon-git-branch" 16}} + {{CountFmt .NumForks}} + </a> + {{end}} + </div> + </div> + {{$description := .DescriptionHTML $.Context}} + {{if $description}} + <div class="flex-item-body">{{$description}}</div> + {{end}} + {{if .Topics}} + <div class="label-list"> + {{range .Topics}} + {{if ne . ""}}<a class="ui label" href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1">{{.}}</a>{{end}} + {{end}} + </div> + {{end}} + <div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated" (TimeSinceUnix .UpdatedUnix ctx.Locale)}}</div> + </div> + </div> + {{else}} + <div> + {{ctx.Locale.Tr "search.no_results"}} + </div> + {{end}} +</div> diff --git a/templates/explore/repos.tmpl b/templates/explore/repos.tmpl new file mode 100644 index 00000000..53742bf0 --- /dev/null +++ b/templates/explore/repos.tmpl @@ -0,0 +1,10 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content explore repositories"> + {{template "explore/navbar" .}} + <div class="ui container"> + {{template "shared/repo_search" .}} + {{template "explore/repo_list" .}} + {{template "base/paginate" .}} + </div> +</div> +{{template "base/footer" .}} diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl new file mode 100644 index 00000000..1d984a2e --- /dev/null +++ b/templates/explore/search.tmpl @@ -0,0 +1,23 @@ +<div class="ui small secondary filter menu tw-items-center tw-mx-0"> + <form class="ui form ignore-dirty tw-flex-1"> + {{if .PageIsExploreUsers}} + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}} + {{else}} + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}} + {{end}} + </form> + <!-- Sort --> + <div class="ui small dropdown type jump item tw-mr-0"> + <span class="text"> + {{ctx.Locale.Tr "repo.issues.filter_sort"}} + </span> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <a class="{{if eq .SortType "newest"}}active {{end}}item" href="?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> + <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> + <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> + </div> + </div> +</div> +<div class="divider"></div> diff --git a/templates/explore/user_list.tmpl b/templates/explore/user_list.tmpl new file mode 100644 index 00000000..f2cf939f --- /dev/null +++ b/templates/explore/user_list.tmpl @@ -0,0 +1,33 @@ +<div class="flex-list"> + {{range .Users}} + <div class="flex-item tw-items-center"> + <div class="flex-item-leading"> + {{ctx.AvatarUtils.Avatar . 48}} + </div> + <div class="flex-item-main"> + <div class="flex-item-title"> + {{template "shared/user/name" .}} + {{if .Visibility.IsPrivate}} + <span class="ui basic tiny label">{{ctx.Locale.Tr "repo.desc.private"}}</span> + {{end}} + </div> + <div class="flex-item-body"> + {{if .Location}} + <span class="flex-text-inline">{{svg "octicon-location"}}{{.Location}}</span> + {{end}} + {{if and .Email (or (and $.ShowUserEmail $.IsSigned (not .KeepEmailPrivate)) $.PageIsAdminUsers)}} + <span class="flex-text-inline"> + {{svg "octicon-mail"}} + <a href="mailto:{{.Email}}">{{.Email}}</a> + </span> + {{end}} + <span class="flex-text-inline">{{svg "octicon-calendar"}}{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .CreatedUnix)}}</span> + </div> + </div> + </div> + {{else}} + <div class="flex-item"> + {{ctx.Locale.Tr "search.no_results"}} + </div> + {{end}} +</div> diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl new file mode 100644 index 00000000..e9046125 --- /dev/null +++ b/templates/explore/users.tmpl @@ -0,0 +1,10 @@ +{{template "base/head" .}} +<div role="main" aria-label="{{.Title}}" class="page-content explore users"> + {{template "explore/navbar" .}} + <div class="ui container"> + {{template "explore/search" .}} + {{template "explore/user_list" .}} + {{template "base/paginate" .}} + </div> +</div> +{{template "base/footer" .}} |