summaryrefslogtreecommitdiffstats
path: root/templates/explore
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
commitdd136858f1ea40ad3c94191d647487fa4f31926c (patch)
tree58fec94a7b2a12510c9664b21793f1ed560c6518 /templates/explore
parentInitial commit. (diff)
downloadforgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.tar.xz
forgejo-dd136858f1ea40ad3c94191d647487fa4f31926c.zip
Adding upstream version 9.0.0.upstream/9.0.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/explore')
-rw-r--r--templates/explore/code.tmpl8
-rw-r--r--templates/explore/navbar.tmpl20
-rw-r--r--templates/explore/repo_list.tmpl73
-rw-r--r--templates/explore/repos.tmpl10
-rw-r--r--templates/explore/search.tmpl23
-rw-r--r--templates/explore/user_list.tmpl33
-rw-r--r--templates/explore/users.tmpl10
7 files changed, 177 insertions, 0 deletions
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl
new file mode 100644
index 0000000..039933f
--- /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 0000000..8e619fa
--- /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 0000000..59bc6c8
--- /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 0000000..53742bf
--- /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 0000000..1d984a2
--- /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 0000000..f2cf939
--- /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 0000000..e904612
--- /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" .}}