Browse Source

Выведена вкладка компетенции и настроен маршрут для будущего поиска по компетенциям #106

pull/118/head
Artur Galyamov 2 years ago
parent
commit
ed2c6571a8
  1. 1
      options/locale/locale_ru-RU.ini
  2. 22
      routers/web/explore/competence.go
  3. 1
      routers/web/web.go
  4. 1
      templates/explore/competences.tmpl
  5. 3
      templates/explore/navbar.tmpl

1
options/locale/locale_ru-RU.ini

@ -259,6 +259,7 @@ users=Пользователи
organizations=Сообщества
search=Поиск
code=Файлы
competences=Компетенции
search.fuzzy=Неточный
search.match=Соответствие
repo_no_results=Подходящие проекты не найдены.

22
routers/web/explore/competence.go

@ -0,0 +1,22 @@
package explore
import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/setting"
"net/http"
)
const (
tplExploreCompetences base.TplName = "explore/competences"
)
func Competences(ctx *context.Context) {
ctx.Data["UsersIsDisabled"] = setting.Service.Explore.DisableUsersPage
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["Title"] = ctx.Tr("explore")
ctx.Data["PageIsExplore"] = true
ctx.Data["PageIsExploreCompetences"] = true
ctx.HTML(http.StatusOK, tplExploreCompetences)
}

1
routers/web/web.go

@ -254,6 +254,7 @@ func RegisterRoutes(m *web.Route) {
m.Get("/users", explore.Users)
m.Get("/organizations", explore.Organizations)
m.Get("/code", explore.Code)
m.Get("/competences", explore.Competences)
}, ignExploreSignIn)
m.Group("/map", func() {
m.Get("/umap", umap.UsersMap)

1
templates/explore/competences.tmpl

@ -0,0 +1 @@
<h1>Competences</h1>

3
templates/explore/navbar.tmpl

@ -15,4 +15,7 @@
{{svg "octicon-code"}} {{.i18n.Tr "explore.code"}}
</a>
{{end}}
<a class="{{if .PageIsExploreCompetences}}active{{end}} item" href="{{AppSubUrl}}/explore/competences">
{{svg "octicon-book"}} {{.i18n.Tr "explore.competences"}}
</a>
</div>

Loading…
Cancel
Save