Browse Source

Выводятся вкладки компетенции и ресурсы для проекта #65

если таковые имеются
pull/120/head
Artur Galyamov 2 years ago
parent
commit
23e8063895
  1. 4
      options/locale/locale_ru-RU.ini
  2. 15
      routers/web/repo/competence.go
  3. 15
      routers/web/repo/resource.go
  4. 2
      routers/web/web.go
  5. 1
      templates/repo/competences/list.tmpl
  6. 16
      templates/repo/header.tmpl
  7. 1
      templates/repo/resources/list.tmpl

4
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.

15
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)
}

15
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)
}

2
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)

1
templates/repo/competences/list.tmpl

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

16
templates/repo/header.tmpl

@ -152,7 +152,7 @@
{{svg "octicon-book"}} {{.i18n.Tr "repo.wiki"}}
</a>
{{end}}
{{if .Permission.CanRead $.UnitTypeIssues}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
{{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}}
@ -162,6 +162,18 @@
</a>
{{end}}
{{if .Repository.Resources}}
<a class="{{if .PageIsResources}}active{{end}} item" href="{{.RepoLink}}/resources">
{{svg "octicon-briefcase"}} {{.i18n.Tr "repo.resources"}}
</a>
{{end}}
{{if .Repository.Competences}}
<a class="{{if .PageIsCompetences}}active{{end}} item" href="{{.RepoLink}}/competences">
{{svg "octicon-multi-select"}} {{.i18n.Tr "repo.competences"}}
</a>
{{end}}
{{if .Permission.CanRead $.UnitTypeExternalTracker}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
{{svg "octicon-link-external"}} {{.i18n.Tr "repo.issues"}} </span>
@ -176,7 +188,7 @@
{{end}}
</a>
{{ end }}
{{if .Permission.CanRead $.UnitTypeCode}}
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL}}{{else}}/code{{end}}">
{{svg "octicon-code"}} {{.i18n.Tr "repo.code"}}

1
templates/repo/resources/list.tmpl

@ -0,0 +1 @@
<h1>Resources</h1>
Loading…
Cancel
Save