From 23e8063895243065af67d1267e5b5034e89c9c5f Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Thu, 15 Sep 2022 18:49:06 +0500 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=D1=8F=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D0=B5=D1=82=D0=B5=D0=BD=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D1=80=D0=B5=D1=81=D1=83=D1=80=D1=81=D1=8B=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0?= =?UTF-8?q?=20#65?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit если таковые имеются --- options/locale/locale_ru-RU.ini | 4 ++-- routers/web/repo/competence.go | 15 +++++++++++++++ routers/web/repo/resource.go | 15 +++++++++++++++ routers/web/web.go | 2 ++ templates/repo/competences/list.tmpl | 1 + templates/repo/header.tmpl | 16 ++++++++++++++-- templates/repo/resources/list.tmpl | 1 + 7 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 routers/web/repo/competence.go create mode 100644 routers/web/repo/resource.go create mode 100644 templates/repo/competences/list.tmpl create mode 100644 templates/repo/resources/list.tmpl diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index 09643754b4..eec461d65a 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -804,8 +804,8 @@ download_bundle=Скачать BUNDLE generate_repo=Создать проект generate_from=Создать из repo_desc=Описание -resources=Необходимые ресурсы -competences=Необходимые компетенции +resources=Ресурсы +competences=Компетенции repo_desc_helper=Добавьте краткое описание (необязательно) repo_lang=Язык repo_gitignore_helper=Выберите шаблон .gitignore. diff --git a/routers/web/repo/competence.go b/routers/web/repo/competence.go new file mode 100644 index 0000000000..14fa178ccd --- /dev/null +++ b/routers/web/repo/competence.go @@ -0,0 +1,15 @@ +package repo + +import ( + "code.gitea.io/gitea/modules/base" + "code.gitea.io/gitea/modules/context" + "net/http" +) + +const ( + tplCompetences base.TplName = "repo/competences/list" +) + +func Competences(ctx *context.Context) { + ctx.HTML(http.StatusOK, tplCompetences) +} diff --git a/routers/web/repo/resource.go b/routers/web/repo/resource.go new file mode 100644 index 0000000000..95e75c0818 --- /dev/null +++ b/routers/web/repo/resource.go @@ -0,0 +1,15 @@ +package repo + +import ( + "code.gitea.io/gitea/modules/base" + "code.gitea.io/gitea/modules/context" + "net/http" +) + +const ( + tplResources base.TplName = "repo/resources/list" +) + +func Resources(ctx *context.Context) { + ctx.HTML(http.StatusOK, tplResources) +} diff --git a/routers/web/web.go b/routers/web/web.go index 171d5c0e81..1e0937671e 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -890,6 +890,8 @@ func RegisterRoutes(m *web.Route) { m.Group("", func() { m.Get("/{type:issues|pulls}", repo.Issues) m.Get("/issues_tree", repo.IssuesTree) + m.Get("/resources", repo.Resources) + m.Get("/competences", repo.Competences) m.Get("/{type:issues|pulls}/{index}", repo.ViewIssue) m.Group("/{type:issues|pulls}/{index}/content-history", func() { m.Get("/overview", repo.GetContentHistoryOverview) diff --git a/templates/repo/competences/list.tmpl b/templates/repo/competences/list.tmpl new file mode 100644 index 0000000000..15bd99afda --- /dev/null +++ b/templates/repo/competences/list.tmpl @@ -0,0 +1 @@ +

Competences

diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 4948d90379..7221d7ac88 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -152,7 +152,7 @@ {{svg "octicon-book"}} {{.i18n.Tr "repo.wiki"}} {{end}} - + {{if .Permission.CanRead $.UnitTypeIssues}} {{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}} @@ -162,6 +162,18 @@ {{end}} + {{if .Repository.Resources}} + + {{svg "octicon-briefcase"}} {{.i18n.Tr "repo.resources"}} + + {{end}} + + {{if .Repository.Competences}} + + {{svg "octicon-multi-select"}} {{.i18n.Tr "repo.competences"}} + + {{end}} + {{if .Permission.CanRead $.UnitTypeExternalTracker}} {{svg "octicon-link-external"}} {{.i18n.Tr "repo.issues"}} @@ -176,7 +188,7 @@ {{end}} {{ end }} - + {{if .Permission.CanRead $.UnitTypeCode}} {{svg "octicon-code"}} {{.i18n.Tr "repo.code"}} diff --git a/templates/repo/resources/list.tmpl b/templates/repo/resources/list.tmpl new file mode 100644 index 0000000000..81f8fc8e69 --- /dev/null +++ b/templates/repo/resources/list.tmpl @@ -0,0 +1 @@ +

Resources