mirror of
https://github.com/gogs/gogs.git
synced 2026-07-18 20:50:48 +02:00
Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fb4f7f498 | ||
|
|
9e09e48502 | ||
|
|
c79774e8d4 | ||
|
|
d6b09c35f7 | ||
|
|
0048980da5 | ||
|
|
d169d00be6 | ||
|
|
ff731ea07d | ||
|
|
9a5a27ea8d | ||
|
|
94d7b62922 | ||
|
|
2df42e369e | ||
|
|
1f5bb08c25 | ||
|
|
01ff65a93e | ||
|
|
8540043c45 | ||
|
|
f57adf3637 | ||
|
|
a75fa58e1c | ||
|
|
6ccb2d36cf | ||
|
|
414e5f09c7 | ||
|
|
a04596659b | ||
|
|
149d62a648 | ||
|
|
db3905c0a3 | ||
|
|
3253e3c5aa | ||
|
|
c9321550e0 | ||
|
|
ac390d28b8 | ||
|
|
561e5f9ccb | ||
|
|
9df5c39bca | ||
|
|
9976fc6782 | ||
|
|
8966f5635d | ||
|
|
85d7afeba0 | ||
|
|
63e21c146a | ||
|
|
9bd9ad4205 | ||
|
|
dd6faf7f9b | ||
|
|
db4da7beec | ||
|
|
b4f47a7623 | ||
|
|
af8eccc02e | ||
|
|
820be19cf5 | ||
|
|
d733efc1cc | ||
|
|
985a0f3450 | ||
|
|
322515a50b | ||
|
|
13e1fa6789 | ||
|
|
c6277cce51 | ||
|
|
6530375dbf | ||
|
|
449a6e490b | ||
|
|
ebea20b4e7 | ||
|
|
f76d821bda | ||
|
|
263304b6b7 | ||
|
|
73e98c91c3 | ||
|
|
2bf8494332 | ||
|
|
df2bdf7ea3 | ||
|
|
514382e2eb | ||
|
|
cb1eadc276 | ||
|
|
1314ba219e | ||
|
|
5267dce210 | ||
|
|
97c48da49f | ||
|
|
1e74ee51ff | ||
|
|
067edcdb90 | ||
|
|
792c13cf0a | ||
|
|
3bd7d3b1c5 | ||
|
|
af847ef94e | ||
|
|
bfed3ea7d3 | ||
|
|
b44e4d7cb0 | ||
|
|
eed9966ad6 | ||
|
|
affa3c2dbf | ||
|
|
6775ac7334 | ||
|
|
2c626371b0 | ||
|
|
3cacec9163 | ||
|
|
ad513a20e9 | ||
|
|
72a8fa3bc8 | ||
|
|
0c9a616326 | ||
|
|
0e9bc2d410 | ||
|
|
1d3ec27cb7 | ||
|
|
a0cd59bd0e |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,3 +17,4 @@ output*
|
||||
gogs.sublime-project
|
||||
gogs.sublime-workspace
|
||||
/release
|
||||
vendor
|
||||
|
||||
33
.gopmfile
33
.gopmfile
@@ -3,35 +3,35 @@ path = github.com/gogits/gogs
|
||||
|
||||
[deps]
|
||||
github.com/bradfitz/gomemcache = commit:fb1f79c
|
||||
github.com/codegangsta/cli = commit:a294348
|
||||
github.com/codegangsta/cli = commit:aca5b04
|
||||
github.com/go-macaron/binding = commit:a68f342
|
||||
github.com/go-macaron/cache = commit:5617353
|
||||
github.com/go-macaron/captcha = commit:8aa5919
|
||||
github.com/go-macaron/csrf = commit:546646c
|
||||
github.com/go-macaron/csrf = commit:6a9a7df
|
||||
github.com/go-macaron/gzip = commit:cad1c65
|
||||
github.com/go-macaron/i18n = commit:d2d3329
|
||||
github.com/go-macaron/inject = commit:c5ab7bf
|
||||
github.com/go-macaron/session = commit:66031fc
|
||||
github.com/go-macaron/toolbox = commit:82b5115
|
||||
github.com/go-sql-driver/mysql = commit:0f2db9e
|
||||
github.com/go-sql-driver/mysql = commit:66312f7
|
||||
github.com/go-xorm/core = commit:5021584
|
||||
github.com/go-xorm/xorm = commit:1045aa0
|
||||
github.com/gogits/chardet = commit:2404f77725
|
||||
github.com/go-xorm/xorm = commit:769f6b3
|
||||
github.com/gogits/chardet = commit:2404f77
|
||||
github.com/gogits/cron = commit:3abc0f8
|
||||
github.com/gogits/git-module = commit:76e8cce
|
||||
github.com/gogits/go-gogs-client = commit:d584b1e
|
||||
github.com/gogits/go-gogs-client = commit:788ec59
|
||||
github.com/issue9/identicon = commit:f8c0d2c
|
||||
github.com/kardianos/minwinsvc = commit:cad6b2b
|
||||
github.com/klauspost/compress = commit:2d3d403
|
||||
github.com/klauspost/compress = commit:006acde
|
||||
github.com/klauspost/cpuid = commit:09cded8
|
||||
github.com/klauspost/crc32 = commit:19b0b33
|
||||
github.com/lib/pq = commit:165a352
|
||||
github.com/mattn/go-sqlite3 = commit:45f056c
|
||||
github.com/mattn/go-sqlite3 = commit:76e335f
|
||||
github.com/mcuadros/go-version = commit:d52711f
|
||||
github.com/microcosm-cc/bluemonday = commit:4ac6f27
|
||||
github.com/msteinert/pam = commit:02ccfbf
|
||||
github.com/nfnt/resize = commit:4d93a29
|
||||
github.com/russross/blackfriday = commit:006144a
|
||||
github.com/russross/blackfriday = commit:b43df97
|
||||
github.com/satori/go.uuid = commit:e673fdd
|
||||
github.com/sergi/go-diff = commit:ec7fdbb
|
||||
github.com/shurcooL/sanitized_anchor_name = commit:10ef21a
|
||||
@@ -39,15 +39,18 @@ github.com/Unknwon/cae = commit:7f5e046
|
||||
github.com/Unknwon/com = commit:28b053d
|
||||
github.com/Unknwon/i18n = commit:3b48b66
|
||||
github.com/Unknwon/paginater = commit:7748a72
|
||||
golang.org/x/net = commit:a4bbce9
|
||||
golang.org/x/text = commit:a71fd10
|
||||
golang.org/x/crypto = commit:5dc8cb4
|
||||
golang.org/x/crypto = commit:c197bcf
|
||||
golang.org/x/net = commit:35b06af
|
||||
golang.org/x/sys = commit:9d4e42a
|
||||
golang.org/x/text = commit:1b466db
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 = commit:2caba25
|
||||
gopkg.in/asn1-ber.v1 = commit:4e86f43
|
||||
gopkg.in/gomail.v2 = commit:5ceb8e6
|
||||
gopkg.in/bufio.v1 = commit:567b2bf
|
||||
gopkg.in/gomail.v2 = commit:060a5f4
|
||||
gopkg.in/ini.v1 = commit:776aa73
|
||||
gopkg.in/ldap.v2 = commit:07a7330
|
||||
gopkg.in/macaron.v1 = commit:b9eee38
|
||||
gopkg.in/redis.v2 = commit:e617904962
|
||||
gopkg.in/macaron.v1 = commit:94a5ef7
|
||||
gopkg.in/redis.v2 = commit:e617904
|
||||
|
||||
[res]
|
||||
include = public|scripts|templates
|
||||
|
||||
5
Makefile
5
Makefile
@@ -6,6 +6,7 @@ LESS_FILES := $(wildcard public/less/gogs.less public/less/_*.less)
|
||||
GENERATED := modules/bindata/bindata.go public/css/gogs.css
|
||||
|
||||
TAGS = ""
|
||||
BUILD_FLAGS = "-v"
|
||||
|
||||
RELEASE_ROOT = "release"
|
||||
RELEASE_GOGS = "release/gogs"
|
||||
@@ -16,14 +17,14 @@ NOW = $(shell date -u '+%Y%m%d%I%M%S')
|
||||
.IGNORE: public/css/gogs.css
|
||||
|
||||
build: $(GENERATED)
|
||||
go install -v -ldflags '$(LDFLAGS)' -tags '$(TAGS)'
|
||||
go install $(BUILD_FLAGS) -ldflags '$(LDFLAGS)' -tags '$(TAGS)'
|
||||
cp '$(GOPATH)/bin/gogs' .
|
||||
|
||||
govet:
|
||||
go tool vet -composites=false -methods=false -structtags=false .
|
||||
|
||||
build-dev: $(GENERATED) govet
|
||||
go install -v -race -tags '$(TAGS)'
|
||||
go install $(BUILD_FLAGS) -race -tags '$(TAGS)'
|
||||
cp '$(GOPATH)/bin/gogs' .
|
||||
|
||||
pack:
|
||||
|
||||
@@ -3,7 +3,7 @@ Gogs - Go Git Service [
|
||||
|
||||
##### Current version: 0.9.0
|
||||
##### Current version: 0.9.13
|
||||
|
||||
| Web | UI | Preview |
|
||||
|:-------------:|:-------:|:-------:|
|
||||
@@ -105,6 +105,7 @@ There are 5 ways to install Gogs:
|
||||
- [Puppet](https://forge.puppetlabs.com/Siteminds/gogs) (IT)
|
||||
- [Kanboard](http://kanboard.net/plugin/gogs-webhook) (Project Management)
|
||||
- [BearyChat](https://bearychat.com/) (Team Communication)
|
||||
- [HiWork](http://www.hiwork.cc/) (Team Communication)
|
||||
|
||||
### Product Support
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
|
||||
- [Puppet](https://forge.puppetlabs.com/Siteminds/gogs)(IT)
|
||||
- [Kanboard](http://kanboard.net/plugin/gogs-webhook)(项目管理)
|
||||
- [BearyChat](https://bearychat.com/)(团队交流)
|
||||
- [HiWork](http://www.hiwork.cc/)(团队交流)
|
||||
|
||||
### 产品支持
|
||||
|
||||
|
||||
96
cmd/web.go
96
cmd/web.go
@@ -34,8 +34,8 @@ import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/bindata"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/modules/template"
|
||||
"github.com/gogits/gogs/routers"
|
||||
@@ -81,14 +81,14 @@ func checkVersion() {
|
||||
{"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.5.2.0304"},
|
||||
{"github.com/go-macaron/binding", binding.Version, "0.2.1"},
|
||||
{"github.com/go-macaron/cache", cache.Version, "0.1.2"},
|
||||
{"github.com/go-macaron/csrf", csrf.Version, "0.0.5"},
|
||||
{"github.com/go-macaron/csrf", csrf.Version, "0.1.0"},
|
||||
{"github.com/go-macaron/i18n", i18n.Version, "0.2.0"},
|
||||
{"github.com/go-macaron/session", session.Version, "0.1.6"},
|
||||
{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
|
||||
{"gopkg.in/ini.v1", ini.Version, "1.8.4"},
|
||||
{"gopkg.in/macaron.v1", macaron.Version, "0.8.0"},
|
||||
{"gopkg.in/macaron.v1", macaron.Version, "1.1.2"},
|
||||
{"github.com/gogits/git-module", git.Version, "0.2.9"},
|
||||
{"github.com/gogits/go-gogs-client", gogs.Version, "0.7.3"},
|
||||
{"github.com/gogits/go-gogs-client", gogs.Version, "0.7.4"},
|
||||
}
|
||||
for _, c := range checkers {
|
||||
if !version.Compare(c.Version(), c.Expected, ">=") {
|
||||
@@ -124,9 +124,10 @@ func newMacaron() *macaron.Macaron {
|
||||
},
|
||||
))
|
||||
m.Use(macaron.Renderer(macaron.RenderOptions{
|
||||
Directory: path.Join(setting.StaticRootPath, "templates"),
|
||||
Funcs: template.NewFuncMap(),
|
||||
IndentJSON: macaron.Env != macaron.PROD,
|
||||
Directory: path.Join(setting.StaticRootPath, "templates"),
|
||||
AppendDirectories: []string{path.Join(setting.CustomPath, "templates")},
|
||||
Funcs: template.NewFuncMap(),
|
||||
IndentJSON: macaron.Env != macaron.PROD,
|
||||
}))
|
||||
|
||||
localeNames, err := bindata.AssetDir("conf/locale")
|
||||
@@ -157,6 +158,7 @@ func newMacaron() *macaron.Macaron {
|
||||
m.Use(session.Sessioner(setting.SessionConfig))
|
||||
m.Use(csrf.Csrfer(csrf.Options{
|
||||
Secret: setting.SecretKey,
|
||||
Cookie: setting.CSRFCookieName,
|
||||
SetCookie: true,
|
||||
Header: "X-Csrf-Token",
|
||||
CookiePath: setting.AppSubUrl,
|
||||
@@ -169,7 +171,7 @@ func newMacaron() *macaron.Macaron {
|
||||
},
|
||||
},
|
||||
}))
|
||||
m.Use(middleware.Contexter())
|
||||
m.Use(context.Contexter())
|
||||
return m
|
||||
}
|
||||
|
||||
@@ -182,10 +184,10 @@ func runWeb(ctx *cli.Context) {
|
||||
|
||||
m := newMacaron()
|
||||
|
||||
reqSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true})
|
||||
ignSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: setting.Service.RequireSignInView})
|
||||
ignSignInAndCsrf := middleware.Toggle(&middleware.ToggleOptions{DisableCsrf: true})
|
||||
reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
|
||||
reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
|
||||
ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
|
||||
ignSignInAndCsrf := context.Toggle(&context.ToggleOptions{DisableCSRF: true})
|
||||
reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true})
|
||||
|
||||
bindIgnErr := binding.BindIgnErr
|
||||
|
||||
@@ -193,17 +195,17 @@ func runWeb(ctx *cli.Context) {
|
||||
// Especially some AJAX requests, we can reduce middleware number to improve performance.
|
||||
// Routers.
|
||||
m.Get("/", ignSignIn, routers.Home)
|
||||
m.Get("/explore", ignSignIn, routers.Explore)
|
||||
m.Group("/explore", func() {
|
||||
m.Get("", func(ctx *context.Context) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/explore/repos")
|
||||
})
|
||||
m.Get("/repos", routers.ExploreRepos)
|
||||
m.Get("/users", routers.ExploreUsers)
|
||||
}, ignSignIn)
|
||||
m.Combo("/install", routers.InstallInit).Get(routers.Install).
|
||||
Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
|
||||
m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues)
|
||||
|
||||
// ***** START: API *****
|
||||
m.Group("/api", func() {
|
||||
apiv1.RegisterRoutes(m)
|
||||
}, ignSignIn)
|
||||
// ***** END: API *****
|
||||
|
||||
// ***** START: User *****
|
||||
m.Group("/user", func() {
|
||||
m.Get("/login", user.SignIn)
|
||||
@@ -231,7 +233,7 @@ func runWeb(ctx *cli.Context) {
|
||||
Post(bindIgnErr(auth.NewAccessTokenForm{}), user.SettingsApplicationsPost)
|
||||
m.Post("/applications/delete", user.SettingsDeleteApplication)
|
||||
m.Route("/delete", "GET,POST", user.SettingsDelete)
|
||||
}, reqSignIn, func(ctx *middleware.Context) {
|
||||
}, reqSignIn, func(ctx *context.Context) {
|
||||
ctx.Data["PageIsUserSettings"] = true
|
||||
})
|
||||
|
||||
@@ -246,7 +248,7 @@ func runWeb(ctx *cli.Context) {
|
||||
})
|
||||
// ***** END: User *****
|
||||
|
||||
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
|
||||
adminReq := context.Toggle(&context.ToggleOptions{SignInRequired: true, AdminRequired: true})
|
||||
|
||||
// ***** START: Admin *****
|
||||
m.Group("/admin", func() {
|
||||
@@ -295,7 +297,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/stars", user.Stars)
|
||||
})
|
||||
|
||||
m.Get("/attachments/:uuid", func(ctx *middleware.Context) {
|
||||
m.Get("/attachments/:uuid", func(ctx *context.Context) {
|
||||
attach, err := models.GetAttachmentByUUID(ctx.Params(":uuid"))
|
||||
if err != nil {
|
||||
if models.IsErrAttachmentNotExist(err) {
|
||||
@@ -332,8 +334,8 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/template/*", dev.TemplatePreview)
|
||||
}
|
||||
|
||||
reqRepoAdmin := middleware.RequireRepoAdmin()
|
||||
reqRepoWriter := middleware.RequireRepoWriter()
|
||||
reqRepoAdmin := context.RequireRepoAdmin()
|
||||
reqRepoWriter := context.RequireRepoWriter()
|
||||
|
||||
// ***** START: Organization *****
|
||||
m.Group("/org", func() {
|
||||
@@ -347,14 +349,14 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/members/action/:action", org.MembersAction)
|
||||
|
||||
m.Get("/teams", org.Teams)
|
||||
}, middleware.OrgAssignment(true))
|
||||
}, context.OrgAssignment(true))
|
||||
|
||||
m.Group("/:org", func() {
|
||||
m.Get("/teams/:team", org.TeamMembers)
|
||||
m.Get("/teams/:team/repositories", org.TeamRepositories)
|
||||
m.Route("/teams/:team/action/:action", "GET,POST", org.TeamsAction)
|
||||
m.Route("/teams/:team/action/repo/:action", "GET,POST", org.TeamsRepoAction)
|
||||
}, middleware.OrgAssignment(true, false, true))
|
||||
}, context.OrgAssignment(true, false, true))
|
||||
|
||||
m.Group("/:org", func() {
|
||||
m.Get("/teams/new", org.NewTeam)
|
||||
@@ -384,7 +386,7 @@ func runWeb(ctx *cli.Context) {
|
||||
})
|
||||
|
||||
m.Route("/invitations/new", "GET,POST", org.Invitation)
|
||||
}, middleware.OrgAssignment(true, true))
|
||||
}, context.OrgAssignment(true, true))
|
||||
}, reqSignIn)
|
||||
// ***** END: Organization *****
|
||||
|
||||
@@ -423,7 +425,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("", repo.GitHooks)
|
||||
m.Combo("/:name").Get(repo.GitHooksEdit).
|
||||
Post(repo.GitHooksEditPost)
|
||||
}, middleware.GitHookService())
|
||||
}, context.GitHookService())
|
||||
})
|
||||
|
||||
m.Group("/keys", func() {
|
||||
@@ -432,15 +434,15 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Post("/delete", repo.DeleteDeployKey)
|
||||
})
|
||||
|
||||
}, func(ctx *middleware.Context) {
|
||||
}, func(ctx *context.Context) {
|
||||
ctx.Data["PageIsSettings"] = true
|
||||
})
|
||||
}, reqSignIn, middleware.RepoAssignment(), reqRepoAdmin, middleware.RepoRef())
|
||||
}, reqSignIn, context.RepoAssignment(), reqRepoAdmin, context.RepoRef())
|
||||
|
||||
m.Get("/:username/:reponame/action/:action", reqSignIn, middleware.RepoAssignment(), repo.Action)
|
||||
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), repo.Action)
|
||||
m.Group("/:username/:reponame", func() {
|
||||
m.Group("/issues", func() {
|
||||
m.Combo("/new", repo.MustEnableIssues).Get(middleware.RepoRef(), repo.NewIssue).
|
||||
m.Combo("/new", repo.MustEnableIssues).Get(context.RepoRef(), repo.NewIssue).
|
||||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost)
|
||||
|
||||
m.Combo("/:index/comments").Post(bindIgnErr(auth.CreateCommentForm{}), repo.NewComment)
|
||||
@@ -460,7 +462,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
|
||||
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
|
||||
m.Post("/delete", repo.DeleteLabel)
|
||||
}, reqRepoWriter, middleware.RepoRef())
|
||||
}, reqRepoWriter, context.RepoRef())
|
||||
m.Group("/milestones", func() {
|
||||
m.Combo("/new").Get(repo.NewMilestone).
|
||||
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost)
|
||||
@@ -468,7 +470,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost)
|
||||
m.Get("/:id/:action", repo.ChangeMilestonStatus)
|
||||
m.Post("/delete", repo.DeleteMilestone)
|
||||
}, reqRepoWriter, middleware.RepoRef())
|
||||
}, reqRepoWriter, context.RepoRef())
|
||||
|
||||
m.Group("/releases", func() {
|
||||
m.Get("/new", repo.NewRelease)
|
||||
@@ -476,11 +478,11 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/edit/:tagname", repo.EditRelease)
|
||||
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
|
||||
m.Post("/delete", repo.DeleteRelease)
|
||||
}, reqRepoWriter, middleware.RepoRef())
|
||||
}, reqRepoWriter, context.RepoRef())
|
||||
|
||||
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
|
||||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
|
||||
}, reqSignIn, middleware.RepoAssignment(), repo.MustBeNotBare)
|
||||
}, reqSignIn, context.RepoAssignment(), repo.MustBeNotBare)
|
||||
|
||||
m.Group("/:username/:reponame", func() {
|
||||
m.Group("", func() {
|
||||
@@ -489,7 +491,7 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/^:type(issues|pulls)$/:index", repo.ViewIssue)
|
||||
m.Get("/labels/", repo.RetrieveLabels, repo.Labels)
|
||||
m.Get("/milestones", repo.Milestones)
|
||||
}, middleware.RepoRef())
|
||||
}, context.RepoRef())
|
||||
|
||||
// m.Get("/branches", repo.Branches)
|
||||
|
||||
@@ -504,13 +506,13 @@ func runWeb(ctx *cli.Context) {
|
||||
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost)
|
||||
m.Post("/:page/delete", repo.DeleteWikiPagePost)
|
||||
}, reqSignIn, reqRepoWriter)
|
||||
}, repo.MustEnableWiki, middleware.RepoRef())
|
||||
}, repo.MustEnableWiki, context.RepoRef())
|
||||
|
||||
m.Get("/archive/*", repo.Download)
|
||||
|
||||
m.Group("/pulls/:index", func() {
|
||||
m.Get("/commits", middleware.RepoRef(), repo.ViewPullCommits)
|
||||
m.Get("/files", middleware.RepoRef(), repo.ViewPullFiles)
|
||||
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
||||
m.Get("/files", context.RepoRef(), repo.ViewPullFiles)
|
||||
m.Post("/merge", reqRepoWriter, repo.MergePullRequest)
|
||||
}, repo.MustAllowPulls)
|
||||
|
||||
@@ -520,20 +522,20 @@ func runWeb(ctx *cli.Context) {
|
||||
m.Get("/commits/*", repo.RefCommits)
|
||||
m.Get("/commit/*", repo.Diff)
|
||||
m.Get("/forks", repo.Forks)
|
||||
}, middleware.RepoRef())
|
||||
}, context.RepoRef())
|
||||
|
||||
m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff)
|
||||
}, ignSignIn, middleware.RepoAssignment(), repo.MustBeNotBare)
|
||||
}, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare)
|
||||
m.Group("/:username/:reponame", func() {
|
||||
m.Get("/stars", repo.Stars)
|
||||
m.Get("/watchers", repo.Watchers)
|
||||
}, ignSignIn, middleware.RepoAssignment(), middleware.RepoRef())
|
||||
}, ignSignIn, context.RepoAssignment(), context.RepoRef())
|
||||
|
||||
m.Group("/:username", func() {
|
||||
m.Group("/:reponame", func() {
|
||||
m.Get("", repo.Home)
|
||||
m.Get("\\.git$", repo.Home)
|
||||
}, ignSignIn, middleware.RepoAssignment(true), middleware.RepoRef())
|
||||
}, ignSignIn, context.RepoAssignment(true), context.RepoRef())
|
||||
|
||||
m.Group("/:reponame", func() {
|
||||
m.Any("/*", ignSignInAndCsrf, repo.HTTP)
|
||||
@@ -542,8 +544,12 @@ func runWeb(ctx *cli.Context) {
|
||||
})
|
||||
// ***** END: Repository *****
|
||||
|
||||
m.Group("/api", func() {
|
||||
apiv1.RegisterRoutes(m)
|
||||
}, ignSignIn)
|
||||
|
||||
// robots.txt
|
||||
m.Get("/robots.txt", func(ctx *middleware.Context) {
|
||||
m.Get("/robots.txt", func(ctx *context.Context) {
|
||||
if setting.HasRobotsTxt {
|
||||
ctx.ServeFileContent(path.Join(setting.CustomPath, "robots.txt"))
|
||||
} else {
|
||||
|
||||
@@ -93,6 +93,8 @@ KEY_FILE = custom/https/key.pem
|
||||
; Upper level of template and static file path
|
||||
; default is the path where Gogs is executed
|
||||
STATIC_ROOT_PATH =
|
||||
; Default path for App data
|
||||
APP_DATA_PATH = data
|
||||
; Application level GZIP support
|
||||
ENABLE_GZIP = false
|
||||
; Landing page for non-logged users, can be "home" or "explore"
|
||||
|
||||
@@ -26,6 +26,7 @@ Hamid Feizabadi <hamidfzm AT gmail DOT com>
|
||||
Huimin Wang <wanghm2009 AT hotmail DOT co DOT jp>
|
||||
ilko <kontact-mr.k AT outlook DOT com">
|
||||
Ilya Makarov
|
||||
Robert Nuske <robert DOT nuske AT web DOT de>
|
||||
Robin Hübner <profan AT prfn DOT se>
|
||||
Jamie Mansfield <dev AT jamierocks DOT uk>
|
||||
Jean THOMAS <contact AT tibounise DOT com>
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Задачи
|
||||
|
||||
cancel=Отказ
|
||||
|
||||
[search]
|
||||
search=Търсене...
|
||||
repository=Хранилище
|
||||
user=Потребител
|
||||
issue=Задача
|
||||
code=Код
|
||||
|
||||
[install]
|
||||
install=Инсталация
|
||||
title=Стъпки за инсталиране при първоначално стартиране
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Във Вашите хранилища
|
||||
|
||||
[explore]
|
||||
repos=Хранилища
|
||||
users=Потребители
|
||||
search=Търсене
|
||||
|
||||
[auth]
|
||||
create_new_account=Създай нов профил
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
app_desc=Ein einfacher, selbst gehosteter Git-Service
|
||||
|
||||
home=Home
|
||||
home=Startseite
|
||||
dashboard=Übersicht
|
||||
explore=Erkunden
|
||||
help=Hilfe
|
||||
@@ -20,7 +20,7 @@ signed_in_as=Angemeldet als
|
||||
username=Benutzername
|
||||
email=E-Mail
|
||||
password=Passwort
|
||||
re_type=Passwort bestätigen
|
||||
re_type=Erneut eingeben
|
||||
captcha=Captcha
|
||||
|
||||
repository=Repository
|
||||
@@ -29,7 +29,7 @@ mirror=Mirror
|
||||
new_repo=Neues Repository
|
||||
new_migrate=Neue Migration
|
||||
new_mirror=Neuer Mirror
|
||||
new_fork=Neuer Fork
|
||||
new_fork=Neues Fork-Repository
|
||||
new_org=Neue Organisation
|
||||
manage_org=Organisationen verwalten
|
||||
admin_panel=Administration
|
||||
@@ -44,13 +44,6 @@ issues=Issues
|
||||
|
||||
cancel=Abbrechen
|
||||
|
||||
[search]
|
||||
search=Suchen...
|
||||
repository=Repository
|
||||
user=Benutzer
|
||||
issue=Issue
|
||||
code=Code
|
||||
|
||||
[install]
|
||||
install=Installation
|
||||
title=Installationsschritte für den ersten Start
|
||||
@@ -65,9 +58,9 @@ db_name=Datenbankname
|
||||
db_helper=Bitte verwenden Sie in MySQL die InnoDB-Engine mit dem Zeichensatz utf8_general_ci.
|
||||
ssl_mode=SSL-Modus
|
||||
path=Pfad
|
||||
sqlite_helper=Der Dateipfad zur SQLite3- oder TiDB-Datenbank. <br> Bitte benutzen Sie eine absoluten Pfad, wenn Gogs als Service gestartet wird.
|
||||
sqlite_helper=Der Dateipfad zur SQLite3- oder TiDB-Datenbank. <br>Bitte verwenden Sie einen absoluten Pfad, wenn Gogs als Service gestartet wird.
|
||||
err_empty_db_path=SQLite3 oder TiDB Datenbankpfad darf nicht leer sein.
|
||||
err_invalid_tidb_name=Der TiDB Datenbankname darf kein "." und kein "-" enthalten.
|
||||
err_invalid_tidb_name=Der TiDB Datenbankname darf nicht "." und "-" enthalten.
|
||||
no_admin_and_disable_registration=Sie können die Registrierung nicht deaktivieren, ohne ein Administratorkonto zu erstellen.
|
||||
err_empty_admin_password=Das Administrator-Passwort darf nicht leer sein.
|
||||
|
||||
@@ -77,7 +70,7 @@ app_name_helper=Hier den Namen der Organisation einfügen!
|
||||
repo_path=Repository-Verzeichnis
|
||||
repo_path_helper=Alle Git-Repositories werden in diesem Verzeichnis gespeichert.
|
||||
run_user=Ausführender Benutzer
|
||||
run_user_helper=Der Benutzer muss die Zugriffsberechtigung für das Repository Root-Verzeichnis haben und der ausführende Benutzer von Gogs sein.
|
||||
run_user_helper=Der Benutzer muss die Zugriffsberechtigung für das Repository-Verzeichnis haben und der ausführende Benutzer von Gogs sein.
|
||||
domain=Domain
|
||||
domain_helper=Dies hat Auswirkung auf die SSH Klon-URLs.
|
||||
ssh_port=SSH Port
|
||||
@@ -110,7 +103,7 @@ enable_captcha_popup=Captcha-Eingabe bei der Registrierung erforderlich.
|
||||
require_sign_in_view=Seiten nur für angemeldete Benutzer zugänglich.
|
||||
require_sign_in_view_popup=Nur angemeldete Benutzer können auf alle Seiten zugreifen. Gäste sehen nur die Seiten Anmelden/Registrieren.
|
||||
admin_setting_desc=Sie müssen jetzt noch kein Administrator-Konto anlegen. Der erste Benutzer ("ID=1") erhält automatisch Administrator-Rechte.
|
||||
admin_title=Konto-Einstellungen für den Administrator
|
||||
admin_title=Administrator Einstellungen
|
||||
admin_name=Benutzername
|
||||
admin_password=Passwort
|
||||
confirm_password=Passwort bestätigen
|
||||
@@ -118,7 +111,7 @@ admin_email=Administrator E-Mail
|
||||
install_gogs=Gogs installieren
|
||||
test_git_failed=Fehler beim Test des 'git' Kommandos: %v
|
||||
sqlite3_not_available=Ihre Gogs-Version unterstützt SQLite3 nicht. Bitte laden Sie die offizielle binäre Version von %s herunter, NICHT die gobuild-Version.
|
||||
invalid_db_setting=Datenbank-Einstellungen sind nicht korrekt: %v
|
||||
invalid_db_setting=Datenbankeinstellungen sind nicht korrekt: %v
|
||||
invalid_repo_path=Repository Verzeichnis ist ungültig: %v
|
||||
run_user_not_match=Der ausführende Benutzer ist nicht der aktuelle Benutzer: %s -> %s
|
||||
save_config_failed=Fehler beim Speichern der Konfiguration: %v
|
||||
@@ -140,10 +133,12 @@ issues.in_your_repos=In Ihren Repositories
|
||||
|
||||
[explore]
|
||||
repos=Repositories
|
||||
users=Benutzer
|
||||
search=Suche
|
||||
|
||||
[auth]
|
||||
create_new_account=Neues Konto erstellen
|
||||
register_hepler_msg=Sie haben bereits ein Konto? Jetzt anmelden!
|
||||
register_hepler_msg=Haben Sie bereits ein Konto? Jetzt anmelden!
|
||||
social_register_hepler_msg=Haben Sie bereits ein Konto? Jetzt verknüpfen!
|
||||
disable_register_prompt=Es tut uns leid, die Registrierung wurde deaktiviert. Bitte wenden Sie sich an den Administrator.
|
||||
disable_register_mail=Es tut uns leid, die Bestätigung der Registrierungs-E-Mail wurde deaktiviert.
|
||||
@@ -185,7 +180,7 @@ SSHTitle=SSH-Schlüsselname
|
||||
HttpsUrl=HTTPS URL
|
||||
PayloadUrl=Payload URL
|
||||
TeamName=Teamname
|
||||
AuthName=Authentifizierungsname
|
||||
AuthName=Name der Autorisierung
|
||||
AdminEmail=Administrator E-Mail
|
||||
|
||||
require_error=` darf nicht leer sein.`
|
||||
@@ -213,7 +208,7 @@ enterred_invalid_password=Bitte achten Sie darauf, dass das eingegebene Passwort
|
||||
user_not_exist=Angegebener Benutzer existiert nicht.
|
||||
last_org_owner=Entfernen des letzten Mitglieds aus einem Eigentümer-Team ist nicht zulässig, da es immer mindestens einen Eigentümer je Organisation geben muss.
|
||||
|
||||
invalid_ssh_key=Leider sind wir nicht in der Lage, deinen SSH-Schlüssel zu überprüfen: %s
|
||||
invalid_ssh_key=Leider sind wir nicht in der Lage, Ihren SSH-Schlüssel zu überprüfen: %s
|
||||
unable_verify_ssh_key=Gogs kann Ihren SSH-Schlüssel nicht überprüfen, nimmt aber an, dass er gültig ist. Bitte stellen Sie dies selbst sicher.
|
||||
auth_failed=Authentifizierung fehlgeschlagen: %v
|
||||
|
||||
@@ -229,9 +224,9 @@ change_custom_avatar=Ändern Sie Ihr Profilbild in den Einstellungen
|
||||
join_on=Beigetreten am
|
||||
repositories=Repositories
|
||||
activity=Öffentliche Aktivität
|
||||
followers=Followers
|
||||
followers=Folgende
|
||||
starred=Favorisierte Repositories
|
||||
following=Folgt
|
||||
following=Folge ich
|
||||
follow=Folgen
|
||||
unfollow=Nicht mehr folgen
|
||||
|
||||
@@ -250,14 +245,14 @@ uid=Uid
|
||||
|
||||
public_profile=Öffentliches Profil
|
||||
profile_desc=Ihre E-Mail-Adresse ist öffentlich einsehbar und dient dazu, Ihnen Benachrichtigungen bezüglich Ihres Kontos und Aktivitäten auf der Webseite zu schicken.
|
||||
password_username_disabled=Nicht-lokalen Benutzern ist es nicht erlaubt, ihren Usernamen zu ändern.
|
||||
password_username_disabled=Nicht-lokalen Benutzern ist es nicht erlaubt, ihren Benutzernamen zu ändern.
|
||||
full_name=Vollständiger Name
|
||||
website=Webseite
|
||||
location=Standort
|
||||
update_profile=Profil aktualisieren
|
||||
update_profile_success=Ihr Profil wurde erfolgreich aktualisiert.
|
||||
change_username=Benutzername geändert
|
||||
change_username_prompt=Diese Änderung wirkt sich auf die Links zu Ihrem Benutzerkonto aus
|
||||
change_username_prompt=Diese Änderung wirkt sich auf die Links zu Ihrem Benutzerkonto aus.
|
||||
continue=Weiter
|
||||
cancel=Abbrechen
|
||||
|
||||
@@ -266,7 +261,7 @@ choose_new_avatar=Neues Profilbild auswählen
|
||||
update_avatar=Profilbildeinstellungen aktualisieren
|
||||
delete_current_avatar=Aktuelles Profilbild löschen
|
||||
uploaded_avatar_not_a_image=Die hochgeladene Datei ist kein Bild.
|
||||
update_avatar_success=Ihre Avatar-Einstellung wurde aktualisiert.
|
||||
update_avatar_success=Ihre Profilbild-Einstellung wurden erfolgreich aktualisiert.
|
||||
|
||||
change_password=Passwort ändern
|
||||
old_password=Aktuelles Passwort
|
||||
@@ -278,7 +273,7 @@ password_change_disabled=Nicht-lokalen Benutzern ist es nicht erlaubt, ihr Passw
|
||||
|
||||
emails=E-Mail-Adressen
|
||||
manage_emails=E-Mail-Adressen verwalten
|
||||
email_desc=Ihre primäre E-Mail-Adresse wird für Benachrichtigungen und andere Funktionen verwendet werden.
|
||||
email_desc=Ihre primäre E-Mail-Adresse wird für Benachrichtigungen und andere Funktionen verwendet.
|
||||
primary=Primär
|
||||
primary_email=Als primäre Adresse verwenden
|
||||
delete_email=Löschen
|
||||
@@ -293,7 +288,7 @@ add_email_success=Ihre neue E-Mail-Adresse wurde erfolgreich hinzugefügt.
|
||||
manage_ssh_keys=SSH-Schlüssel verwalten
|
||||
add_key=Schlüssel hinzufügen
|
||||
ssh_desc=Dies ist eine Liste aller SSH-Schlüssel, die Ihrem Konto zugeordnet sind. Bitte entfernen Sie alle Schlüssel, die Ihnen nicht bekannt sind.
|
||||
ssh_helper=<strong>Sie brauchen Hilfe?</strong> Hier ist eine Anleitung zum <a href="%s">Erzeugen von SSH-Schlüsseln</a> oder <a href="%s">Lösen einfacher SSH-Probleme</a>.
|
||||
ssh_helper=<strong>Brauchen Sie Hilfe?</strong> Hier ist eine Anleitung zum <a href="%s">Erzeugen von SSH-Schlüsseln</a> oder <a href="%s">Lösen einfacher SSH-Probleme</a>.
|
||||
add_new_key=SSH-Schlüssel hinzufügen
|
||||
ssh_key_been_used=Inhalt des öffentlichen Schlüssels wurde verwendet.
|
||||
ssh_key_name_used=Ein öffentlicher Schlüssel mit diesem Namen existiert bereits.
|
||||
@@ -315,7 +310,7 @@ social_desc=Dies ist eine Liste verknüpfter sozialer Konten. Bitte entfernen Si
|
||||
unbind=Verknüpfung entfernen
|
||||
unbind_success=Die Verknüpfung zum sozialen Konto wurde entfernt.
|
||||
|
||||
manage_access_token=Verwaltung persönlicher Zugangs-Tokens
|
||||
manage_access_token=Verwaltung persönlicher Zugangs-Token
|
||||
generate_new_token=Neuen Token erzeugen
|
||||
tokens_desc=Die von Ihnen erzeugten Token können zum Zugriff auf die Gogs-API verwendet werden.
|
||||
new_token_desc=Jeder Token erlaubt vollen Zugriff auf ihr Konto.
|
||||
@@ -323,7 +318,7 @@ token_name=Token-Name
|
||||
generate_token=Token generieren
|
||||
generate_token_succees=Ihr Zugangs-Token wurde erfolgreich generiert! Stellen Sie sicher, dass Sie den Token kopiert haben, da Sie ihn später nicht mehr ansehen können!
|
||||
delete_token=Löschen
|
||||
access_token_deletion=Entfernung von persönlichen Token
|
||||
access_token_deletion=Persönlichen Token entfernen
|
||||
access_token_deletion_desc=Das Löschen dieses persönlichen Zugangs-Tokens wird alle zugehörigen Zugriffe der Anwendung entfernen. Möchten Sie fortfahren?
|
||||
delete_token_success=Persönlicher Zugriffs-Token wurde erfolgreich entfernt! Vergessen Sie nicht Ihre Anwendung zu aktualisieren.
|
||||
|
||||
@@ -364,7 +359,7 @@ forks=Forks
|
||||
|
||||
form.reach_limit_of_creation=Der Besitzer hat die maximale Anzahl von %d erstellbaren Repositories erreicht.
|
||||
form.name_reserved=Repository-Name '%s' ist reserviert.
|
||||
form.name_pattern_not_allowed=Repositoryname der Form '%s' sind nicht erlaubt.
|
||||
form.name_pattern_not_allowed=Repository-Namen der Form '%s' sind nicht erlaubt.
|
||||
|
||||
need_auth=Authorisierung benötigt
|
||||
migrate_type=Migrationstyp
|
||||
@@ -377,13 +372,13 @@ migrate.invalid_local_path=Der lokale Pfad ist ungültig, existiert nicht oder i
|
||||
migrate.failed=Fehler bei Migration: %v
|
||||
|
||||
mirror_from=Mirror von
|
||||
forked_from=Geforkt von
|
||||
forked_from=geforkt von
|
||||
fork_from_self=Sie können kein Repository forken, das Ihnen gehört!
|
||||
copy_link=Kopieren
|
||||
copy_link_success=Kopiert!
|
||||
copy_link_error=Drücken Sie ⌘-C oder Strg-C zum Kopieren
|
||||
copied=Kopiert OK
|
||||
unwatch=Nicht mehr beobachten
|
||||
copied=Erfolgreich kopiert
|
||||
unwatch=Beobachten beenden
|
||||
watch=Beobachten
|
||||
unstar=Favorit entfernen
|
||||
star=Favorit hinzufügen
|
||||
@@ -394,7 +389,7 @@ quick_guide=Kurzanleitung
|
||||
clone_this_repo=Dieses Repository klonen
|
||||
create_new_repo_command=Erstellen Sie ein neues Repository mittels der Kommandozeile
|
||||
push_exist_repo=Bestehendes Repository von der Kommandozeile pushen
|
||||
repo_is_empty=Das Repository ist leer, bitte kommen Sie später wieder!
|
||||
repo_is_empty=Dieses Repository ist leer. Bitte kommen Sie später wieder!
|
||||
|
||||
code=Code
|
||||
branch=Branch
|
||||
@@ -408,9 +403,9 @@ labels=Label
|
||||
milestones=Meilensteine
|
||||
commits=Commits
|
||||
releases=Releases
|
||||
file_raw=Roh
|
||||
file_raw=Originalformat
|
||||
file_history=Verlauf
|
||||
file_view_raw=Ansicht Roh
|
||||
file_view_raw=Ansicht im Originalformat
|
||||
file_permalink=Permalink
|
||||
|
||||
commits.commits=Commits
|
||||
@@ -448,9 +443,9 @@ issues.filter_assignee=Zuständig
|
||||
issues.filter_assginee_no_select=Keine Zuständigkeit ausgewählt
|
||||
issues.filter_type=Typ
|
||||
issues.filter_type.all_issues=Alle Issues
|
||||
issues.filter_type.assigned_to_you=Ihnen zugewiesenen
|
||||
issues.filter_type.assigned_to_you=Ihnen zugewiesen
|
||||
issues.filter_type.created_by_you=Von Ihnen erstellt
|
||||
issues.filter_type.mentioning_you=Erwähnen Sie
|
||||
issues.filter_type.mentioning_you=Erwähnt Sie
|
||||
issues.filter_sort=Sortieren
|
||||
issues.filter_sort.latest=Neueste
|
||||
issues.filter_sort.oldest=Älteste
|
||||
@@ -474,7 +469,7 @@ issues.reopen_comment_issue=Kommentieren und wieder öffnen
|
||||
issues.create_comment=Kommentieren
|
||||
issues.closed_at=`hat <a id="%[1]s" href="#%[1]s">%[2]s</a> geschlossen`
|
||||
issues.reopened_at=`hat <a id="%[1]s" href="#%[1]s">%[2]s</a> wieder geöffnet`
|
||||
issues.commit_ref_at=`referenzierte dieses Issue aus einem Commit <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commit_ref_at=`hat dieses Issue <a id="%[1]s" href="#%[1]s">%[2]s</a> aus einem Commit referenziert`
|
||||
issues.poster=Ersteller
|
||||
issues.collaborator=Mitarbeiter
|
||||
issues.owner=Besitzer
|
||||
@@ -510,14 +505,14 @@ pulls.merged_title_desc=hat %[1]d Commits von <code>%[2]s</code> nach <code>%[3]
|
||||
pulls.tab_conversation=Diskussion
|
||||
pulls.tab_commits=Commits
|
||||
pulls.tab_files=Geänderte Dateien
|
||||
pulls.reopen_to_merge=Bitte diese Pull-Anforderung wiedereröffnen, um die Merge-Operation auszuführen.
|
||||
pulls.reopen_to_merge=Bitte diesen Pull-Request wiedereröffnen, um die Merge-Operation auszuführen.
|
||||
pulls.merged=Zusammengeführt
|
||||
pulls.has_merged=Dieser Pull-Request wurde erfolgreich zusammengeführt!
|
||||
pulls.data_broken=Die Daten dieses Pull-Requests sind defekt, da Fork-Informationen gelöscht wurden.
|
||||
pulls.is_checking=Die Konfliktprüfung ist in Arbeit. Bitte aktualisieren Sie die Seite in wenigen Momenten.
|
||||
pulls.can_auto_merge_desc=Dieser Pull-Request kann automatisch zusammengeführt werden.
|
||||
pulls.cannot_auto_merge_desc=Dieser Pull-Request kann nicht automatisch zusammengeführt werden, da es Konflikte gibt.
|
||||
pulls.cannot_auto_merge_helper=Bitte manuell zusammenführen um die Konflikte zu lösen.
|
||||
pulls.cannot_auto_merge_helper=Bitte manuell zusammenführen, um die Konflikte zu lösen.
|
||||
pulls.merge_pull_request=Pull-Request zusammenführen
|
||||
pulls.open_unmerged_pull_exists=`Sie können diesen Pull-Request nicht wieder öffnen, da bereits ein offener Pull-Request (#%d) aus dem selben Repository mit den gleichen Merge-Informationen existiert und auf das Zusammenführen wartet.`
|
||||
|
||||
@@ -528,16 +523,16 @@ milestones.closed=Geschlossen %s
|
||||
milestones.no_due_date=Kein Fälligkeitsdatum
|
||||
milestones.open=Offen
|
||||
milestones.close=Geschlossen
|
||||
milestones.new_subheader=Erstellen Sie Meilensteine um Ihre Issues zu organisieren.
|
||||
milestones.new_subheader=Erstellen Sie Meilensteine, um ihre Issues zu organisieren.
|
||||
milestones.create=Meilenstein erstellen
|
||||
milestones.title=Titel
|
||||
milestones.desc=Beschreibung
|
||||
milestones.due_date=Fälligkeitsdatum (optional)
|
||||
milestones.clear=Entfernen
|
||||
milestones.clear=Feld leeren
|
||||
milestones.invalid_due_date_format=Format des Fälligkeitsdatums ist ungültig. Es muss das Format 'JJJJ-mm-dd' haben.
|
||||
milestones.create_success=Meilenstein '%s' wurde erfolgreich erstellt!
|
||||
milestones.edit=Meilenstein bearbeiten
|
||||
milestones.edit_subheader=Verwenden Sie eine aussagekräftige Beschreibung um Missverständnisse zu vermeiden.
|
||||
milestones.edit_subheader=Verwenden Sie eine aussagekräftige Beschreibung für Meilensteine, um Missverständnisse zu vermeiden.
|
||||
milestones.cancel=Abbrechen
|
||||
milestones.modify=Meilenstein ändern
|
||||
milestones.edit_success=Änderungen des Meilensteins '%s' wurden erfolgreich gespeichert!
|
||||
@@ -547,7 +542,7 @@ milestones.deletion_success=Meilenstein erfolgreich gelöscht!
|
||||
|
||||
wiki=Wiki
|
||||
wiki.welcome=Willkommen im Wiki!
|
||||
wiki.welcome_desc=Das Wiki ist der Ort, an dem Sie Ihr Projekt mit einer gemeinsam erstellten Dokumentation noch ansprechender gestalten können.
|
||||
wiki.welcome_desc=Das Wiki ist der Ort, an dem Sie ihr Projekt gemeinsam dokumentieren und verbessern können.
|
||||
wiki.create_first_page=Erstellen Sie die erste Seite
|
||||
wiki.page=Seite
|
||||
wiki.filter_page=Seite filtern
|
||||
@@ -558,7 +553,7 @@ wiki.last_commit_info=%s hat diese Seite bearbeitet %s
|
||||
wiki.edit_page_button=Bearbeiten
|
||||
wiki.new_page_button=Neue Seite
|
||||
wiki.delete_page_button=Seite löschen
|
||||
wiki.delete_page_notice_1=Die Seite <code>"%s"</code> wird gelöscht.
|
||||
wiki.delete_page_notice_1=Die Seite <code>"%s"</code> wird gelöscht. Bitte seien Sie vorsichtig.
|
||||
wiki.page_already_exists=Eine Wiki-Seite mit dem gleichen Namen existiert bereits.
|
||||
wiki.pages=Seiten
|
||||
wiki.last_updated=Zuletzt aktualisiert %s
|
||||
@@ -573,7 +568,7 @@ settings.site=Offizielle Webseite
|
||||
settings.update_settings=Einstellungen speichern
|
||||
settings.change_reponame_prompt=Diese Änderung wirkt sich darauf aus, wie sich Links auf Repositories beziehen.
|
||||
settings.advanced_settings=Erweiterte Einstellungen
|
||||
settings.wiki_desc=Wiki aktivieren damit Benutzer Seiten anlegen können
|
||||
settings.wiki_desc=Wiki aktivieren, damit Benutzer Seiten anlegen können
|
||||
settings.use_external_wiki=Externes Wiki verwenden
|
||||
settings.external_wiki_url=Externe Wiki URL
|
||||
settings.external_wiki_url_desc=Besucher werden auf diese URL umgeleitet, wenn sie auf den Tab klicken.
|
||||
@@ -590,12 +585,12 @@ settings.convert_notices_1=- Dieser Vorgang wandelt das Mirror-Repository in ein
|
||||
settings.convert_confirm=Umwandlung bestätigen
|
||||
settings.convert_succeed=Das Repository wurde erfolgreich in ein normales Repository umgewandelt.
|
||||
settings.transfer=Besitz übertragen
|
||||
settings.transfer_desc=Übertragen Sie dieses Repository auf einen anderen Benutzer oder eine Organisation in der Sie Admin-Rechte haben.
|
||||
settings.transfer_desc=Dieses Repository auf einen anderen Benutzer bzw. eine Organisation in der Sie Admin-Rechte haben übertragen.
|
||||
settings.transfer_notices_1=- Sie werden keinen Zugriff mehr haben, wenn der neue Besitzer ein individueller Benutzer ist.
|
||||
settings.transfer_notices_2=- Sie werden weiterhin Zugriff haben, wenn der neue Besitzer eine Organisation ist und Sie einer der Besitzer sind.
|
||||
settings.transfer_form_title=Bitte geben Sie die folgenden Informationen ein, um die Operation zu bestätigen:
|
||||
settings.wiki_delete=Wiki-Daten löschen
|
||||
settings.wiki_delete_desc=Das Löschen von Wiki Daten kann nicht rückgängig gemacht werden.
|
||||
settings.wiki_delete_desc=Das Löschen von Wiki Daten kann nicht rückgängig gemacht werden. Bitte seien Sie vorsichtig.
|
||||
settings.wiki_delete_notices_1=- Dies löscht und deaktiviert das Wiki für %s
|
||||
settings.wiki_deletion_success=Repository Wiki Daten erfolgreich gelöscht.
|
||||
settings.delete=Dieses Repository löschen
|
||||
@@ -604,7 +599,7 @@ settings.delete_notices_1=- Diese Operation kann <strong>NICHT</strong> rückgä
|
||||
settings.delete_notices_2=- Die Operation wird alles, was mit diesem Git-Repository verbunden ist, dauerhaft löschen, inklusive der Daten, Issues, Kommentare und Zugriffsrechte von Mitarbeitern.
|
||||
settings.delete_notices_fork_1=- Wenn dies ein öffentliches Repository ist, werden nach dem Löschen alle Forks unabhängig.
|
||||
settings.delete_notices_fork_2=- Wenn dies ein privates Repository ist, werden gleichzeitig alle Forks entfernt.
|
||||
settings.delete_notices_fork_3=Wenn alle Forks erhalten bleiben sollen, dann muss zuerst die Sichtbarkeit des Repositories auf öffentlich gesetzt werden.
|
||||
settings.delete_notices_fork_3=- Wenn alle Forks erhalten bleiben sollen, dann muss zuerst die Sichtbarkeit dieses Repositories auf öffentlich gesetzt werden.
|
||||
settings.deletion_success=Repository wurde erfolgreich gelöscht!
|
||||
settings.update_settings_success=Repository-Optionen aktualisiert.
|
||||
settings.transfer_owner=Neuer Besitzer
|
||||
@@ -612,7 +607,7 @@ settings.make_transfer=Transfer starten
|
||||
settings.transfer_succeed=Das Repository wurde erfolgreich übertragen.
|
||||
settings.confirm_delete=Löschen
|
||||
settings.add_collaborator=Mitarbeiter hinzufügen
|
||||
settings.add_collaborator_success=Neuer Mitarbeiter hinzugefügt.
|
||||
settings.add_collaborator_success=Neuer Mitarbeiter wurde hinzugefügt.
|
||||
settings.delete_collaborator=Löschen
|
||||
settings.collaborator_deletion=Mitarbeiter löschen
|
||||
settings.collaborator_deletion_desc=Nach dem Löschen wird dieser Benutzer keinen Zugriff mehr als Mitarbeiter auf dieses Repository haben. Möchten Sie fortfahren?
|
||||
@@ -621,12 +616,12 @@ settings.search_user_placeholder=Benutzer suchen...
|
||||
settings.org_not_allowed_to_be_collaborator=Eine Organisation kann nicht als Mitarbeiter hinzugefügt werden.
|
||||
settings.user_is_org_member=Benutzer ist ein Organisationsmitglied und kann nicht als Mitarbeiter hinzugefügt werden.
|
||||
settings.add_webhook=Webhook hinzufügen
|
||||
settings.hooks_desc=Webhooks erlauben es Ihnen, externe Dienste zu informieren, wenn etwas bestimmtes in Ihrem Repository passiert. Gogs sendet dann einen POST-Request an alle angegebenen URLs. Erfahren Sie mehr in unserem <a target="_blank" href="%s">Webhooks Guide</a>.
|
||||
settings.hooks_desc=Webhooks erlauben es Ihnen, externe Dienste zu informieren, wenn etwas Bestimmtes in Ihrem Repository passiert. Gogs sendet dann einen POST-Request an alle angegebenen URLs. Erfahren Sie mehr in unserem <a target="_blank" href="%s">Webhooks Guide</a>.
|
||||
settings.webhook_deletion=Webhook entfernen
|
||||
settings.webhook_deletion_desc=Das Löschen dieses Webhooks wird alle zugehörigen Informationen und den Übertragungsverlauf entfernen. Wirklich fortfahren?
|
||||
settings.webhook_deletion_success=Webhook wurde erfolgreich entfernt!
|
||||
settings.webhook.test_delivery=Auslieferung testen
|
||||
settings.webhook.test_delivery_desc=Sendet ein imitiertes Push-Ereignis um die Webhook-Einstellungen zu testen
|
||||
settings.webhook.test_delivery=Senden testen
|
||||
settings.webhook.test_delivery_desc=Sendet ein simuliertes Push-Ereignis, um die Webhook-Einstellungen zu testen
|
||||
settings.webhook.test_delivery_success=Test-Webhook wurde zur Auslieferungswarteschlange hinzugefügt. Es kann einige Sekunden dauern, bevor es in der Auslieferungshistorie erscheint.
|
||||
settings.webhook.request=Anfrage
|
||||
settings.webhook.response=Antwort
|
||||
@@ -639,7 +634,7 @@ settings.githook_name=Hook-Name
|
||||
settings.githook_content=Hook-Inhalt
|
||||
settings.update_githook=Hook aktualisieren
|
||||
settings.add_webhook_desc=Gogs sendet einen <code>POST</code>-Request an die unten stehende URL mit Details aller abonnierten Ereignisse. Sie können auch angeben, welches Datenformat Sie empfangen wollen (JSON, <code>x-www-form-urlencoded</code>, <em>etc</em>). Mehr Informationen finden Sie im <a target="_blank" href="%s">Webhooks Guide</a>.
|
||||
settings.payload_url=Payload-URL
|
||||
settings.payload_url=Payload URL
|
||||
settings.content_type=Inhaltstyp
|
||||
settings.secret=Secret
|
||||
settings.slack_username=Benutzername
|
||||
@@ -667,7 +662,7 @@ settings.slack_domain=Domain
|
||||
settings.slack_channel=Kanal
|
||||
settings.deploy_keys=Deploy-Schlüssel
|
||||
settings.add_deploy_key=Deploy-Schlüssel hinzufügen
|
||||
settings.deploy_key_desc=Deploy-Schlüssel haben nur lesenden Zugriff. Sie sind nicht identisch mit dem persönlichen SSH-Schlüssel des Kontos.
|
||||
settings.deploy_key_desc=Deploy-Schlüssel haben nur lesenden Zugriff. Sie sind nicht identisch mit dem SSH-Schlüssel des persönlichen Kontos.
|
||||
settings.no_deploy_keys=Sie haben noch keine Deploy-Schlüssel hinzugefügt.
|
||||
settings.title=Titel
|
||||
settings.deploy_key_content=Inhalt
|
||||
@@ -675,7 +670,7 @@ settings.key_been_used=Deploy-Schlüssel wurde verwendet.
|
||||
settings.key_name_used=Ein Deploy-Schlüssel mit diesem Namen existiert bereits.
|
||||
settings.add_key_success=Der Deploy-Schlüssel '%s' wurde erfolgreich hinzugefügt!
|
||||
settings.deploy_key_deletion=Deploy-Schlüssel löschen
|
||||
settings.deploy_key_deletion_desc=Nach dem Löschen dieses Deploy-Schlüssels werden entsprechende Zugriffe auf diese Repository nicht mehr möglich sein. Möchten Sie wirklich fortfahren?
|
||||
settings.deploy_key_deletion_desc=Nach dem Löschen dieses Deploy-Schlüssels werden entsprechende Zugriffe auf dieses Repository nicht mehr möglich sein. Möchten Sie wirklich fortfahren?
|
||||
settings.deploy_key_deletion_success=Deploy-Schlüssel wurde erfolgreich gelöscht!
|
||||
|
||||
diff.browse_source=Quellcode durchsuchen
|
||||
@@ -685,7 +680,7 @@ diff.data_not_available=Keine Diff-Daten verfügbar.
|
||||
diff.show_diff_stats=Diff-Statistik anzeigen
|
||||
diff.show_split_view=Geteilte Ansicht
|
||||
diff.show_unified_view=Gesamtansicht
|
||||
diff.stats_desc=<strong> %d geänderte Dateien</strong> mit <strong>%d neuen Zeilen</strong> und <strong>%d gelöschten Zeilen</strong>
|
||||
diff.stats_desc=<strong> %d geänderte Dateien</strong> mit <strong>%d neuen</strong> und <strong>%d gelöschten</strong> Zeilen
|
||||
diff.bin=BIN
|
||||
diff.view_file=Datei anzeigen
|
||||
|
||||
@@ -697,11 +692,11 @@ release.stable=Stabil
|
||||
release.edit=bearbeiten
|
||||
release.ahead=<strong>%d</strong> Commits zu %s seit diesem Release
|
||||
release.source_code=Quelltext
|
||||
release.new_subheader=Versionen des Projekts veröffentlichen.
|
||||
release.new_subheader=Neue Version des Projekts veröffentlichen.
|
||||
release.edit_subheader=Eine detaillierte Liste aller Änderungen verrät Benutzern, was verbessert wurde.
|
||||
release.tag_name=Tag-Name
|
||||
release.target=Ziel
|
||||
release.tag_helper=Wählen Sie einen neuen Tag oder erstellen Sie einen Tag beim Veröffentlichen.
|
||||
release.tag_helper=Wählen Sie einen Tag oder erstellen Sie einen neuen Tag beim Veröffentlichen.
|
||||
release.title=Titel
|
||||
release.content=Inhalt
|
||||
release.write=Schreiben
|
||||
@@ -791,7 +786,7 @@ teams.delete_team_title=Team löschen
|
||||
teams.delete_team_desc=Mitglieder dieses Teams verlieren möglicherweise ihren Zugang zu einigen Repositories, wenn dieses Team gelöscht wird. Möchten Sie fortfahren?
|
||||
teams.delete_team_success=Team gelöscht
|
||||
teams.read_permission_desc=Dieses Team hat <strong>Lesezugriff</strong>: Mitglieder können Team-Repositories einsehen und klonen.
|
||||
teams.write_permission_desc=Dieses Team hat <strong>Schreibzugriff</strong>: Mitglieder können Team-Repositories einsehen und hinein pushen.
|
||||
teams.write_permission_desc=Dieses Team hat <strong>Schreibzugriff</strong>: Mitglieder können Team-Repositories einsehen und darauf pushen.
|
||||
teams.admin_permission_desc=Dieses Team hat <strong>Adminzugriff</strong>: Mitglieder dieses Teams können pullen, pushen und Mitarbeiter zu Team-Repositories hinzufügen.
|
||||
teams.repositories=Team-Repositories
|
||||
teams.search_repo_placeholder=Repository durchsuchen...
|
||||
@@ -806,7 +801,7 @@ organizations=Organisationen
|
||||
repositories=Repositories
|
||||
authentication=Authentifizierung
|
||||
config=Konfiguration
|
||||
notices=System-Mitteilungen
|
||||
notices=Systemmitteilungen
|
||||
monitor=Monitoring
|
||||
first_page=Erste
|
||||
last_page=Letzte
|
||||
@@ -829,8 +824,8 @@ dashboard.delete_missing_repos=Alle Repository-Datensätze mit verlorenen gegang
|
||||
dashboard.delete_missing_repos_success=Alle Repository-Datensätze, mit verlorenen Git-Dateien wurden erfolgreich gelöscht.
|
||||
dashboard.git_gc_repos=Garbage Collection auf Repositories ausführen
|
||||
dashboard.git_gc_repos_success=Garbage Collection wurde auf allen Repositories erfolgreich ausgeführt.
|
||||
dashboard.resync_all_sshkeys=Datei '.ssh/authorized_keys' neu anlegen (Achtung: Keys, die nicht zu Gogs gehören gehen verloren)
|
||||
dashboard.resync_all_sshkeys_success=Alle öffentlichen Keys wurden erfolgreich neu angelegt.
|
||||
dashboard.resync_all_sshkeys=Datei '.ssh/authorized_keys' neu anlegen (Achtung: Schlüssel, die nicht zu Gogs gehören gehen verloren)
|
||||
dashboard.resync_all_sshkeys_success=Alle öffentlichen Keys wurden erfolgreich neu geschrieben.
|
||||
dashboard.resync_all_update_hooks=Alle Aktualisierungs-Hooks von Repositories neu anlegen (wird benötigt, wenn der angepasste Konfigurationspfad geändert wurde)
|
||||
dashboard.resync_all_update_hooks_success=Die Hooks aller Repositories wurden erfolgreich neu angelegt.
|
||||
dashboard.reinit_missing_repos=Alle Repository-Datensätze mit verloren gegangenen Git-Dateien neu initialisieren
|
||||
@@ -861,7 +856,7 @@ dashboard.gc_metadata_obtained=Erhaltene GC-Metadata
|
||||
dashboard.other_system_allocation_obtained=Andere erhaltene System-Allokationen
|
||||
dashboard.next_gc_recycle=Nächster GC-Zyklus
|
||||
dashboard.last_gc_time=Seit letztem GC-Zyklus
|
||||
dashboard.total_gc_time=Gesamte GC-Zeit
|
||||
dashboard.total_gc_time=Gesamte GC-Pause
|
||||
dashboard.total_gc_pause=Gesamte GC-Pause
|
||||
dashboard.last_gc_pause=Letzte GC-Pause
|
||||
dashboard.gc_times=GC-Takt
|
||||
@@ -872,13 +867,13 @@ users.name=Name
|
||||
users.activated=Aktiviert
|
||||
users.admin=Admin
|
||||
users.repos=Repositories
|
||||
users.created=Erzeugt
|
||||
users.created=Erstellt am
|
||||
users.send_register_notify=Bei der Registrierung eine Benachrichtigung an den Benutzer senden
|
||||
users.new_success=Das neue Konto '%s' wurde erfolgreich erstellt.
|
||||
users.edit=Bearbeiten
|
||||
users.auth_source=Authentifizierungsquelle
|
||||
users.local=Lokal
|
||||
users.auth_login_name=Authentifizierung-Login-Name
|
||||
users.auth_login_name=Anmeldename zur Authentifizierung
|
||||
users.password_helper=Leer lassen um es unverändert zu lassen.
|
||||
users.update_profile_success=Kontoprofil wurde erfolgreich aktualisiert.
|
||||
users.edit_account=Konto bearbeiten
|
||||
@@ -886,9 +881,9 @@ users.max_repo_creation=Maximale Anzahl erstellbarer Repositories
|
||||
users.max_repo_creation_desc=(Auf -1 setzen, um das globale Standardlimit zu verwenden)
|
||||
users.is_activated=Dieses Konto ist aktiviert
|
||||
users.is_admin=Dieses Konto hat Administratorrechte
|
||||
users.allow_git_hook=Dieses Konto ist berechtigt, Git-Hooks zu erstellen
|
||||
users.allow_git_hook=Dieses Konto ist berechtigt Git-Hooks zu erstellen
|
||||
users.allow_import_local=Dieses Konto ist berechtigt, lokale Repositories zu importieren
|
||||
users.update_profile=Kontoprofil aktualisieren
|
||||
users.update_profile=Konto aktualisieren
|
||||
users.delete_account=Dieses Konto löschen
|
||||
users.still_own_repo=Dieses Konto besitzt noch Repositories. Sie müssen diese zuerst löschen oder übertragen.
|
||||
users.still_has_org=Dieses Konto ist noch Mitglied einer Organisation. Sie müssen die Organisation erst löschen oder verlassen.
|
||||
@@ -923,17 +918,17 @@ auths.bind_password=Passwort binden
|
||||
auths.bind_password_helper=Achtung: Das Passwort wird im Klartext gespeichert. Benutzen Sie kein Konto mit hoher Berechtigungsstufe.
|
||||
auths.user_base=Basis für Benutzersuche
|
||||
auths.user_dn=Benutzer DN
|
||||
auths.attribute_username=Attribute des Benutzernamens
|
||||
auths.attribute_username_placeholder=Leer lassen, um den Wert aus dem Anmelde-Formular als Benutzername zu verwenden.
|
||||
auths.attribute_name=Vorname Attribut
|
||||
auths.attribute_surname=Nachname Attribut
|
||||
auths.attribute_mail=E-Mail Attribut
|
||||
auths.attribute_username=Attribut Benutzername
|
||||
auths.attribute_username_placeholder=Leer lassen, um den Wert aus dem Anmeldeformular als Benutzernamen zu verwenden.
|
||||
auths.attribute_name=Attribut Vorname
|
||||
auths.attribute_surname=Attribut Nachname
|
||||
auths.attribute_mail=Attribut E-Mail
|
||||
auths.attributes_in_bind=Hole Attribute im Bind-Kontext
|
||||
auths.filter=Benutzer Filter
|
||||
auths.filter=Benutzerfilter
|
||||
auths.admin_filter=Admin Filter
|
||||
auths.ms_ad_sa=Ms Ad SA
|
||||
auths.smtp_auth=SMTP Authentifizierung
|
||||
auths.smtphost=SMTP-Host
|
||||
auths.smtp_auth=SMTP-Authentifizierung
|
||||
auths.smtphost=SMTP Host
|
||||
auths.smtpport=SMTP-Port
|
||||
auths.allowed_domains=Erlaubte Domains
|
||||
auths.allowed_domains_helper=Leer lassen für keine Einschränkungen. Mehrere Domains können durch Komma "," getrennt werden.
|
||||
@@ -948,12 +943,12 @@ auths.new_success=Neue Authentifizierung '%s' wurde erfolgreich hinzugefügt.
|
||||
auths.update_success=Die Authentifizierungseinstellungen wurden erfolgreich aktualisiert.
|
||||
auths.update=Authentifizierungseinstellungen aktualisieren
|
||||
auths.delete=Diese Authentifizierung löschen
|
||||
auths.delete_auth_title=Löschen der Authentifizierung
|
||||
auths.delete_auth_title=Authentifizierung löschen
|
||||
auths.delete_auth_desc=Diese Authentifizierung wird gelöscht. Möchten Sie fortfahren?
|
||||
auths.still_in_used=Diese Authentifizierung wird noch von einigen Benutzer verwendet. Bitte löschen Sie diese Benutzer oder ändern Sie deren Anmeldetyp.
|
||||
auths.still_in_used=Diese Authentifizierung wird noch von einigen Benutzern verwendet. Bitte löschen Sie diese Benutzer oder ändern Sie deren Anmeldetyp.
|
||||
auths.deletion_success=Authentifizierung wurde erfolgreich entfernt!
|
||||
|
||||
config.server_config=Server-Konfiguration
|
||||
config.server_config=Serverkonfiguration
|
||||
config.app_name=Anwendungsname
|
||||
config.app_ver=Anwendungsversion
|
||||
config.app_url=Anwendungs-URL
|
||||
@@ -970,14 +965,14 @@ config.reverse_auth_user=Nutzer bei Reverse-Authentifizierung
|
||||
|
||||
config.ssh_config=SSH Konfiguration
|
||||
config.ssh_enabled=Aktiviert
|
||||
config.ssh_start_builtin_server=Builtin-Server starten
|
||||
config.ssh_start_builtin_server=Eingebauten Server starten
|
||||
config.ssh_domain=Domain
|
||||
config.ssh_port=Port
|
||||
config.ssh_listen_port=Listen Port
|
||||
config.ssh_root_path=Verzeichnis
|
||||
config.ssh_key_test_path=Schlüssel-Test-Pfad
|
||||
config.ssh_keygen_path=Keygen ('ssh-Keygen') Pfad
|
||||
config.ssh_minimum_key_size_check=Prüfe minimale Schlüssellänge
|
||||
config.ssh_keygen_path=Keygen ('ssh-keygen') Pfad
|
||||
config.ssh_minimum_key_size_check=Prüfung der Mindestschlüssellänge
|
||||
config.ssh_minimum_key_sizes=Minimale Schlüssellängen
|
||||
|
||||
config.db_config=Datenbankkonfiguration
|
||||
@@ -987,9 +982,9 @@ config.db_name=Name
|
||||
config.db_user=Benutzer
|
||||
config.db_ssl_mode=SSL-Modus
|
||||
config.db_ssl_mode_helper=(nur für "postgres")
|
||||
config.db_path=Pfad
|
||||
config.db_path=Verzeichnis
|
||||
config.db_path_helper=(für "sqlite3" und "tidb")
|
||||
config.service_config=Service-Einstellungen
|
||||
config.service_config=Service-Konfiguration
|
||||
config.register_email_confirm=E-Mail-Bestätigung bei Registrierung
|
||||
config.disable_register=Registrierung deaktivieren
|
||||
config.show_registration_button=Schaltfläche Registrieren anzeigen
|
||||
@@ -999,11 +994,11 @@ config.disable_key_size_check=Prüfung der Mindestschlüssellänge deaktiveren
|
||||
config.enable_captcha=Captcha aktivieren
|
||||
config.active_code_lives=Aktivierungscode Lebensdauer
|
||||
config.reset_password_code_lives=Passwortcode Lebensdauer
|
||||
config.webhook_config=Webhook-Einstellungen
|
||||
config.webhook_config=Webhook-Konfiguration
|
||||
config.queue_length=Warteschlangenlänge
|
||||
config.deliver_timeout=Zeitlimit für Zustellung
|
||||
config.skip_tls_verify=TLS verifikation überspringen
|
||||
config.mailer_config=Mailer-Einstellungen
|
||||
config.mailer_config=Mailer-Konfiguration
|
||||
config.mailer_enabled=Aktiviert
|
||||
config.mailer_disable_helo=HELO Deaktivieren
|
||||
config.mailer_name=Name
|
||||
@@ -1012,25 +1007,25 @@ config.mailer_user=Benutzer
|
||||
config.send_test_mail=Test-E-Mail senden
|
||||
config.test_mail_failed=Das Senden der Test-E-Mail an '%s': %v ist fehlgeschlagen
|
||||
config.test_mail_sent=Test-E-Mail wurde an '%s' gesendet.
|
||||
config.oauth_config=OAuth-Einstellungen
|
||||
config.oauth_config=OAuth-Konfiguration
|
||||
config.oauth_enabled=Aktiviert
|
||||
config.cache_config=Cache-Einstellungen
|
||||
config.cache_config=Cache-Konfiguration
|
||||
config.cache_adapter=Cache-Adapter
|
||||
config.cache_interval=Cache-Intervall
|
||||
config.cache_conn=Cache-Anbindung
|
||||
config.session_config=Session-Einstellungen
|
||||
config.session_config=Session-Konfiguration
|
||||
config.session_provider=Session-Provider
|
||||
config.provider_config=Provider-Einstellungen
|
||||
config.cookie_name=Cookie-Name
|
||||
config.enable_set_cookie=Cookies verwenden
|
||||
config.gc_interval_time=GC-Intervallzeit
|
||||
config.gc_interval_time=GC-Intervall
|
||||
config.session_life_time=Session-Lebensdauer
|
||||
config.https_only=Nur HTTPS
|
||||
config.cookie_life_time=Cookie-Lebensdauer
|
||||
config.picture_config=Bildeinstellungen
|
||||
config.picture_config=Konfiguration der Profilbilder
|
||||
config.picture_service=Bildservice
|
||||
config.disable_gravatar=Gravatar deaktivieren
|
||||
config.log_config=Log-Einstellungen
|
||||
config.log_config=Konfiguration des Loggings
|
||||
config.log_mode=Log-Modus
|
||||
|
||||
monitor.cron=Cron-Tasks
|
||||
@@ -1044,7 +1039,7 @@ monitor.desc=Beschreibung
|
||||
monitor.start=Startzeit
|
||||
monitor.execute_time=Ausführungszeit
|
||||
|
||||
notices.system_notice_list=System-Mitteilungen
|
||||
notices.system_notice_list=Systemmitteilungen
|
||||
notices.view_detail_header=Mitteilungsdetails ansehen
|
||||
notices.actions=Aktionen
|
||||
notices.select_all=Alles auswählen
|
||||
@@ -1059,17 +1054,17 @@ notices.op=Op.
|
||||
notices.delete_success=Systemmitteilungen wurden erfolgreich gelöscht.
|
||||
|
||||
[action]
|
||||
create_repo=hat Repository <a href="%s">%s</a> erstellt
|
||||
create_repo=hat das Repository <a href="%s">%s</a> erstellt
|
||||
rename_repo=hat das Repository von <code>%[1]s</code> zu <a href="%[2]s">%[3]s</a> umbenannt
|
||||
commit_repo=hat nach <a href="%[1]s/src/%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a> gepusht
|
||||
create_issue=`hat Issue <a href="%s/issues/%s">%s#%[2]s</a> eröffnet`
|
||||
close_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> geschlossen`
|
||||
reopen_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> wieder geöffnet`
|
||||
create_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> erstellt`
|
||||
close_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> geschlossen`
|
||||
reopen_pull_request=`hat Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> wieder geöffnet`
|
||||
comment_issue=`hat das Issue <a href="%s/issues/%s">%s#%[2]s</a> kommentiert`
|
||||
merge_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> zuammengeführt`
|
||||
commit_repo=hat auf <a href="%[1]s/src/%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a> gepusht
|
||||
create_issue=`hat Issue <a href="%s/issues/%s">%s#%[2]s</a> geöffnet`
|
||||
close_issue=`hat Issue <a href="%s/issues/%s">%s#%[2]s</a> geschlossen`
|
||||
reopen_issue=`hat Issue <a href="%s/issues/%s">%s#%[2]s</a> wieder geöffnet`
|
||||
create_pull_request=`hat Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> erstellt`
|
||||
close_pull_request=`hat Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> geschlossen`
|
||||
reopen_pull_request=`hat den Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> wieder geöffnet`
|
||||
comment_issue=`hat Issue <a href="%s/issues/%s">%s#%[2]s</a> kommentiert`
|
||||
merge_pull_request=`hat Pull-Request <a href="%s/pulls/%s">%s#%[2]s</a> zuammengeführt`
|
||||
transfer_repo=hat Repository <code>%s</code> transferiert an <a href="%s">%s</a>
|
||||
push_tag=hat Tag <a href="%s/src/%s">%[2]s</a> auf <a href="%[1]s">%[3]s</a> gepusht
|
||||
compare_commits=Zeige Vergleich für diese %d Commits
|
||||
@@ -1096,7 +1091,7 @@ raw_seconds=Sekunden
|
||||
raw_minutes=Minuten
|
||||
|
||||
[dropzone]
|
||||
default_message=Für den Upload klicken oder die Datei hier ablegen.
|
||||
default_message=Zum Hochladen hier klicken oder Datei hier ablegen.
|
||||
invalid_input_type=Dateien dieses Dateityps können nicht hochgeladen werden.
|
||||
file_too_big=Dateigröße ({{filesize}} MB) überschreitet die Maximalgröße ({{maxFilesize}} MB).
|
||||
remove_file=Datei entfernen
|
||||
|
||||
@@ -44,13 +44,6 @@ issues = Issues
|
||||
|
||||
cancel = Cancel
|
||||
|
||||
[search]
|
||||
search = Search...
|
||||
repository = Repository
|
||||
user = User
|
||||
issue = Issue
|
||||
code = Code
|
||||
|
||||
[install]
|
||||
install = Installation
|
||||
title = Install Steps For First-time Run
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos = In your repositories
|
||||
|
||||
[explore]
|
||||
repos = Repositories
|
||||
users = Users
|
||||
search = Search
|
||||
|
||||
[auth]
|
||||
create_new_account = Create New Account
|
||||
@@ -162,6 +157,7 @@ reset_password = Reset Your Password
|
||||
invalid_code = Sorry, your confirmation code has expired or not valid.
|
||||
reset_password_helper = Click here to reset your password
|
||||
password_too_short = Password length cannot be less then 6.
|
||||
non_local_account = Non-local accounts cannot change passwords through Gogs.
|
||||
|
||||
[mail]
|
||||
activate_account = Please activate your account
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Incidencias
|
||||
|
||||
cancel=Cancelar
|
||||
|
||||
[search]
|
||||
search=Buscar...
|
||||
repository=Repositorio
|
||||
user=Usuario
|
||||
issue=Incidencia
|
||||
code=Código
|
||||
|
||||
[install]
|
||||
install=Instalación
|
||||
title=Pasos de la instalación por primera vez
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=En tus repositorios
|
||||
|
||||
[explore]
|
||||
repos=Repositorios
|
||||
users=Usuarios
|
||||
search=Buscar
|
||||
|
||||
[auth]
|
||||
create_new_account=Crear una Nueva Cuenta
|
||||
@@ -378,7 +373,7 @@ migrate.failed=Migración fallida: %v
|
||||
|
||||
mirror_from=espejo de
|
||||
forked_from=forked de
|
||||
fork_from_self=Eres el propietario del repositorio, ¡no puedes hacer fork!
|
||||
fork_from_self=¡No puedes crear un fork de un repositorio que ya es tuyo!
|
||||
copy_link=Copiar
|
||||
copy_link_success=¡Copiado!
|
||||
copy_link_error=Presione ⌘ + C o Ctrl-C para copiar
|
||||
@@ -496,7 +491,7 @@ issues.label_deletion_success=Etiqueta borrada con éxito!
|
||||
issues.num_participants=%d participantes
|
||||
|
||||
pulls.new=Nuevo Pull Request
|
||||
pulls.compare_changes=Comparar Cambios
|
||||
pulls.compare_changes=Comparar cambios
|
||||
pulls.compare_changes_desc=Comparar dos ramas y generar un pull request con las diferencias.
|
||||
pulls.compare_base=base
|
||||
pulls.compare_compare=comparar con
|
||||
@@ -682,12 +677,12 @@ diff.browse_source=Explorar el Código
|
||||
diff.parent=padre
|
||||
diff.commit=commit
|
||||
diff.data_not_available=Los datos del Diff no están disponibles.
|
||||
diff.show_diff_stats=Mostrar Estadísticas de Diff
|
||||
diff.show_diff_stats=Mostrar estadísticas de diff
|
||||
diff.show_split_view=Dividir vista
|
||||
diff.show_unified_view=Unificar vista
|
||||
diff.stats_desc=Se han <strong>modificado %d ficheros</strong> con <strong>%d adiciones</strong> y <strong>%d borrados</strong>
|
||||
diff.bin=BIN
|
||||
diff.view_file=Ver Fichero
|
||||
diff.view_file=Ver fichero
|
||||
|
||||
release.releases=Releases
|
||||
release.new_release=Nueva Release
|
||||
@@ -705,7 +700,7 @@ release.tag_helper=Escoge una etiqueta o crea una nueva al publicar.
|
||||
release.title=Título
|
||||
release.content=Contenido
|
||||
release.write=Escribir
|
||||
release.preview=Vista Previa
|
||||
release.preview=Vista previa
|
||||
release.loading=Cargando...
|
||||
release.prerelease_desc=Esta es una pre-release
|
||||
release.prerelease_helper=Esta release está marcada como no apta para producción.
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Ongelmat
|
||||
|
||||
cancel=Peruuta
|
||||
|
||||
[search]
|
||||
search=Etsi...
|
||||
repository=Repo
|
||||
user=Käyttäjä
|
||||
issue=Ongelma
|
||||
code=Koodi
|
||||
|
||||
[install]
|
||||
install=Asennus
|
||||
title=Asennusvaiheet ottaessa ensi kertaa käyttöön
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Repoissasi
|
||||
|
||||
[explore]
|
||||
repos=Repot
|
||||
users=Users
|
||||
search=Search
|
||||
|
||||
[auth]
|
||||
create_new_account=Luo uusi tili
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Tickets
|
||||
|
||||
cancel=Annuler
|
||||
|
||||
[search]
|
||||
search=Rechercher...
|
||||
repository=Dépôt
|
||||
user=Utilisateur
|
||||
issue=Ticket
|
||||
code=Code
|
||||
|
||||
[install]
|
||||
install=Installation
|
||||
title=Instructions pour la première exécution
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Dans vos dépôts
|
||||
|
||||
[explore]
|
||||
repos=Dépôts
|
||||
users=Utilisateurs
|
||||
search=Rechercher
|
||||
|
||||
[auth]
|
||||
create_new_account=Créer un nouveau compte
|
||||
@@ -264,7 +259,7 @@ cancel=Annuler
|
||||
enable_custom_avatar=Activer l'Avatar personnalisé
|
||||
choose_new_avatar=Sélectionner un nouvel avatar
|
||||
update_avatar=Mettre à jour l'avatar
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Supprimer l'avatar actuel
|
||||
uploaded_avatar_not_a_image=Le fichier téléchargé n'est pas une image.
|
||||
update_avatar_success=Votre avatar a été mis à jour avec succès.
|
||||
|
||||
@@ -476,7 +471,7 @@ issues.closed_at=`fermé à <a id="%[1]s"href="#%[1]s"> %[2]s"</a>`
|
||||
issues.reopened_at=`réouvert à <a id="%[1]s" href="#%[1]s"> %[2]s</a>`
|
||||
issues.commit_ref_at=`a référencé ce problème à partir d'un commit <a id="%[1]s" href="#%[1]s"> %[2]s</a>`
|
||||
issues.poster=Publier
|
||||
issues.collaborator=Collaborator
|
||||
issues.collaborator=Collaborateur
|
||||
issues.owner=Propriétaire
|
||||
issues.sign_up_for_free=Inscrivez-vous gratuitement
|
||||
issues.sign_in_require_desc=pour rejoindre cette conversation. Vous avez déjà un compte ? <a href="%s">Connectez-vous commenter</a>
|
||||
@@ -557,8 +552,8 @@ wiki.save_page=Enregistrer la page
|
||||
wiki.last_commit_info=%s a édité cette page %s
|
||||
wiki.edit_page_button=Modifier
|
||||
wiki.new_page_button=Nouvelle Page
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.delete_page_button=Supprimer la page
|
||||
wiki.delete_page_notice_1=Cela supprimera la page <code>"%s"</code>. Soyez-en sûr.
|
||||
wiki.page_already_exists=Une page de wiki avec le même nom existe déjà.
|
||||
wiki.pages=Pages
|
||||
wiki.last_updated=Dernière mise à jour: %s
|
||||
@@ -594,10 +589,10 @@ settings.transfer_desc=Transférer ce dépôt à un autre utilisateur ou une org
|
||||
settings.transfer_notices_1=-Vous perdrez l'accès si le nouveau propriétaire est un utilisateur individuel.
|
||||
settings.transfer_notices_2=- Vous conserverez l'accès si le nouveau propriétaire est une organisation et que vous y appartenez.
|
||||
settings.transfer_form_title=Veuillez recopier le texte suivant afin de confirmer votre opération :
|
||||
settings.wiki_delete=Erase Wiki Data
|
||||
settings.wiki_delete_desc=Once you erase wiki data there is no going back. Please be certain.
|
||||
settings.wiki_delete_notices_1=- This will delete and disable the wiki for %s
|
||||
settings.wiki_deletion_success=Repository wiki data have been erased successfully.
|
||||
settings.wiki_delete=Effacer les données du Wiki
|
||||
settings.wiki_delete_desc=Une fois que vous effacez les données du wiki, on ne peut revenir en arrière. Soyez-en sûr.
|
||||
settings.wiki_delete_notices_1=- Cela va supprimer et désactiver le wiki pour %s
|
||||
settings.wiki_deletion_success=Le dépôt de données wiki ont été effacés avec succès.
|
||||
settings.delete=Supprimer ce dépôt
|
||||
settings.delete_desc=Attention, cette action est action irréversible. Soyez sûr de vous.
|
||||
settings.delete_notices_1=- Cette opération <strong>ne peut pas </strong> être annulée.
|
||||
@@ -613,9 +608,9 @@ settings.transfer_succeed=Le contrôle du dépôt a été transféré avec succ
|
||||
settings.confirm_delete=Confirmer la suppression
|
||||
settings.add_collaborator=Ajouter un collaborateur
|
||||
settings.add_collaborator_success=Nouveau collaborateur ajouté.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.delete_collaborator=Supprimer
|
||||
settings.collaborator_deletion=Suppression d'un collaborateur
|
||||
settings.collaborator_deletion_desc=Cet utilisateur n'aura plus accès pour collaborer à ce dépôt après sa suppression. Voulez-vous continuer?
|
||||
settings.remove_collaborator_success=Collaborateur supprimé.
|
||||
settings.search_user_placeholder=Rechercher un utilisateur...
|
||||
settings.org_not_allowed_to_be_collaborator=Une organisation n'est pas autorisée à être ajoutée en tant que collaborateur.
|
||||
@@ -950,7 +945,7 @@ auths.update=Mettre à jour les paramètres d'authentifications
|
||||
auths.delete=Supprimer cette authentification
|
||||
auths.delete_auth_title=Suppression de l'authentification
|
||||
auths.delete_auth_desc=Cette authentification va être supprimée. voulez-vous continuer ?
|
||||
auths.still_in_used=This authentication is still used by some users, please delete or convert these users to another login type first.
|
||||
auths.still_in_used=Cette authentification est encore utilisée par d'autres utilisateurs, supprimez-les ou convertir ces utilisateurs vers un autre type de session, avant.
|
||||
auths.deletion_success=L'authentification a été supprimée avec succès !
|
||||
|
||||
config.server_config=Configuration du Serveur
|
||||
@@ -975,9 +970,9 @@ config.ssh_domain=Domaine
|
||||
config.ssh_port=Port
|
||||
config.ssh_listen_port=Port d'écoute
|
||||
config.ssh_root_path=Emplacement racine
|
||||
config.ssh_key_test_path=Emplacement de test des clés
|
||||
config.ssh_key_test_path=Chemin de test des clés
|
||||
config.ssh_keygen_path=Chemin vers le générateur de clefs ("ssh-keygen")
|
||||
config.ssh_minimum_key_size_check=Minimum Key Size Check
|
||||
config.ssh_minimum_key_size_check=Vérification de la longueur de clé minimale
|
||||
config.ssh_minimum_key_sizes=Tailles de clé minimales
|
||||
|
||||
config.db_config=Configuration de la Base de Données
|
||||
@@ -1066,8 +1061,8 @@ create_issue=`a ouvert un problème <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`tickets clos <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
reopen_issue=`tickets ré-ouverts <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
create_pull_request=`pull request créée le <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`closed pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`reopened pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`pull request fermé <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`pull request ré-ouverte <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
comment_issue=`a commenté le problème <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
merge_pull_request=`pull request fusionné le <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
transfer_repo=a transféré le dépôt <code>%s</code> à <a href="%s">%s</a>
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Problemi
|
||||
|
||||
cancel=Annulla
|
||||
|
||||
[search]
|
||||
search=Ricerca...
|
||||
repository=Repository
|
||||
user=Utente
|
||||
issue=Problema
|
||||
code=Codice
|
||||
|
||||
[install]
|
||||
install=Installazione
|
||||
title=Passi d'installazione per il primo avvio
|
||||
@@ -65,7 +58,7 @@ db_name=Nome del database
|
||||
db_helper=Utilizza il motore INNODB con codifica utf8_general_ci per MySQL.
|
||||
ssl_mode=Modalità SSL
|
||||
path=Percorso
|
||||
sqlite_helper=The file path of SQLite3 or TiDB database. <br>Please use absolute path when you start as service.
|
||||
sqlite_helper=Il path assoluto per il database SQLite3 o TiDB. <br>Per favore usa il path assoluto quando lo avvii come servizio.
|
||||
err_empty_db_path=Il percorso file del database SQLite3 o TiDB non può essere vuoto.
|
||||
err_invalid_tidb_name=Il nome del database TiDB non ammette caratteri "." e "-".
|
||||
no_admin_and_disable_registration=Non puoi disabilitare la registrazione senza aver creato un amministratore.
|
||||
@@ -79,7 +72,7 @@ repo_path_helper=Tutti i repository Git remoti saranno salvati in questa directo
|
||||
run_user=Esegui con l'utente
|
||||
run_user_helper=L'utente deve avere accesso al percorso root del repository e avviare Gogs.
|
||||
domain=Dominio
|
||||
domain_helper=Questo modifica lo SSH clone URLs.
|
||||
domain_helper=Questo influisce sugli URL per il clonaggio via SSH.
|
||||
ssh_port=Porta SSH
|
||||
ssh_port_helper=Numero di porta utilizzato dal server SSH, lasciare vuoto per disabilitare l'integrazione SSH.
|
||||
http_port=Porta HTTP
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Nei tuoi repository
|
||||
|
||||
[explore]
|
||||
repos=Repository
|
||||
users=Utenti
|
||||
search=Cerca
|
||||
|
||||
[auth]
|
||||
create_new_account=Crea un nuovo Account
|
||||
@@ -264,7 +259,7 @@ cancel=Annulla
|
||||
enable_custom_avatar=Abilita avatar personalizzato
|
||||
choose_new_avatar=Scegli un nuovo avatar
|
||||
update_avatar=Aggiorna le impostazioni avatar
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Elimina Avatar attuale
|
||||
uploaded_avatar_not_a_image=Il file caricato non è un'immagine.
|
||||
update_avatar_success=Le tue impostazioni avatar sono state aggiornate con successo.
|
||||
|
||||
@@ -466,7 +461,7 @@ issues.open_title=Aperto
|
||||
issues.closed_title=Chiuso
|
||||
issues.num_comments=%d commenti
|
||||
issues.commented_at=`commented <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.no_content=There is no content yet.
|
||||
issues.no_content=Non ci sono ancora contenuti.
|
||||
issues.close_issue=Chiudi
|
||||
issues.close_comment_issue=Commenta e chiudi
|
||||
issues.reopen_issue=Riapri
|
||||
@@ -476,12 +471,12 @@ issues.closed_at=`closed <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.reopened_at=`reopened <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commit_ref_at=`referenced this issue from a commit <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.poster=Autore
|
||||
issues.collaborator=Collaborator
|
||||
issues.collaborator=Collaboratori
|
||||
issues.owner=Proprietario
|
||||
issues.sign_up_for_free=Registrati gratuitamente
|
||||
issues.sign_in_require_desc=to join this conversation. Already have an account? <a href="%s">Sign in to comment</a>
|
||||
issues.sign_in_require_desc=per partecipare a questa conversazione. Possiedi già un account?<a href="%s">Fai il login per commentare</a>
|
||||
issues.edit=Modifica
|
||||
issues.cancel=Cancel
|
||||
issues.cancel=Annulla
|
||||
issues.save=Salva
|
||||
issues.label_title=Nome etichetta
|
||||
issues.label_color=Colore etichetta
|
||||
@@ -500,10 +495,10 @@ pulls.compare_changes=Confronta le modifiche
|
||||
pulls.compare_changes_desc=Confronta due branch e fai una pull request per le modifiche.
|
||||
pulls.compare_base=base
|
||||
pulls.compare_compare=confronta
|
||||
pulls.filter_branch=Filter branch
|
||||
pulls.filter_branch=Filtra branch
|
||||
pulls.no_results=Nessun risultato trovato.
|
||||
pulls.nothing_to_compare=There is nothing to compare because base and head branches are even.
|
||||
pulls.has_pull_request=`There is already a pull request between these two targets: <a href="%[1]s/pulls/%[3]d">%[2]s#%[3]d</a>`
|
||||
pulls.nothing_to_compare=Non c'è niente da confrontare perchè i branch base e head uguali.
|
||||
pulls.has_pull_request=`E' già presente una pull request tra questi due trargets: <a href="%[1]s/pulls/%[3]d">%[2]s#%[3]d</a>`
|
||||
pulls.create=Crea Pull Request
|
||||
pulls.title_desc=wants to merge %[1]d commits from <code>%[2]s</code> into <code>%[3]s</code>
|
||||
pulls.merged_title_desc=merged %[1]d commits from <code>%[2]s</code> into <code>%[3]s</code> %[4]s
|
||||
@@ -511,29 +506,29 @@ pulls.tab_conversation=Conversazione
|
||||
pulls.tab_commits=Commit
|
||||
pulls.tab_files=File modificati
|
||||
pulls.reopen_to_merge=Riapri questa pull request per effettuare il merge.
|
||||
pulls.merged=Merged
|
||||
pulls.has_merged=This pull request has been merged successfully!
|
||||
pulls.data_broken=Data of this pull request has been broken due to deletion of fork information.
|
||||
pulls.merged=Unito
|
||||
pulls.has_merged=Questa pull reqeust è stata mergiata con successo!
|
||||
pulls.data_broken=I dati di questa pull request si sono rotti causa dell'eliminazione delle informazioni di fork.
|
||||
pulls.is_checking=Il controllo dei conflitti è ancora in corso, per favore aggiorna pagina tra qualche istante.
|
||||
pulls.can_auto_merge_desc=This pull request can be merged automatically.
|
||||
pulls.cannot_auto_merge_desc=This pull request can't be merged automatically because there are conflicts.
|
||||
pulls.can_auto_merge_desc=La pull request non può essere mergiata automaticamente.
|
||||
pulls.cannot_auto_merge_desc=Questa pull request non può essere mergiata automaticamente perchè ci sono dei conflitti.
|
||||
pulls.cannot_auto_merge_helper=Effettua il merge manualmente per risolvere i conflitti.
|
||||
pulls.merge_pull_request=Unisci Pull Request
|
||||
pulls.open_unmerged_pull_exists=`You can't perform reopen operation because there is already an open pull request (#%d) from same repository with same merge information and is waiting for merging.`
|
||||
|
||||
milestones.new=Nuova Milestone
|
||||
milestones.open_tab=%d Open
|
||||
milestones.close_tab=%d Closed
|
||||
milestones.closed=Closed %s
|
||||
milestones.no_due_date=No due date
|
||||
milestones.open=Open
|
||||
milestones.close=Close
|
||||
milestones.new_subheader=Create milestones to organize your issues.
|
||||
milestones.open_tab=%d Aperti
|
||||
milestones.close_tab=%d Chiusi
|
||||
milestones.closed=Chiuso %s
|
||||
milestones.no_due_date=Nessuna data di scadenza
|
||||
milestones.open=Apri
|
||||
milestones.close=Chiudi
|
||||
milestones.new_subheader=Crea delle milestones per organizzare le tue issues.
|
||||
milestones.create=Crea Milestone
|
||||
milestones.title=Titolo
|
||||
milestones.desc=Descrizione
|
||||
milestones.due_date=Data di scadenza (opzionale)
|
||||
milestones.clear=Clear
|
||||
milestones.clear=Pulisci
|
||||
milestones.invalid_due_date_format=Il formato della data di scadenza non è valido, deve essere 'yyyy-mm-dd'.
|
||||
milestones.create_success=La Milestone '%s' è stata creata con successo!
|
||||
milestones.edit=Modifica Milestone
|
||||
@@ -557,8 +552,8 @@ wiki.save_page=Salva pagina
|
||||
wiki.last_commit_info=%s ha modificato questa pagina %s
|
||||
wiki.edit_page_button=Modifica
|
||||
wiki.new_page_button=Nuova pagina
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.delete_page_button=Cancella Pagina
|
||||
wiki.delete_page_notice_1=Questo cancellerà lapagina <code>"%s"</code>. Si prega di esserne certi.
|
||||
wiki.page_already_exists=Esiste già una pagina Wiki con questo stesso nome.
|
||||
wiki.pages=Pagine
|
||||
wiki.last_updated=Ultimo aggiornamento: %s
|
||||
@@ -577,16 +572,16 @@ settings.wiki_desc=Abilitare il wiki per consentire alle persone di scrivere doc
|
||||
settings.use_external_wiki=Usa Wiki esterno
|
||||
settings.external_wiki_url=URL Wiki esterno
|
||||
settings.external_wiki_url_desc=I visitatori verranno reindirizzati all'URL quando cliccano sulla scheda.
|
||||
settings.issues_desc=Enable builtin lightweight issue tracker
|
||||
settings.issues_desc=Abilita l'issue tracker builtin leggero
|
||||
settings.use_external_issue_tracker=Utilizza gestore di problemi esterno
|
||||
settings.tracker_url_format=External Issue Tracker URL Format
|
||||
settings.tracker_url_format_desc=You can use placeholder <code>{user} {repo} {index}</code> for user name, repository name and issue index.
|
||||
settings.pulls_desc=Enable pull requests to accept public contributions
|
||||
settings.pulls_desc=Abilita le pull requests per accettare contributi pubblici
|
||||
settings.danger_zone=Zona Pericolosa
|
||||
settings.new_owner_has_same_repo=Il nuovo proprietario ha già un repository con lo stesso nome. Per favore scegli un altro nome.
|
||||
settings.convert=Convert To Regular Repository
|
||||
settings.convert_desc=You can convert this mirror to a regular repository. This cannot be reversed.
|
||||
settings.convert_notices_1=- This operation will convert this repository mirror into a regular repository and cannot be undone.
|
||||
settings.convert=Converti in Repository Regolare
|
||||
settings.convert_desc=Puoi convertire questo mirror in un repository regolare. Questa operazione non può essere annullata.
|
||||
settings.convert_notices_1=- Questa operazione non potrà essere annullata e convertirà questo mirror in un repository regolare.
|
||||
settings.convert_confirm=Conferma la conversione
|
||||
settings.convert_succeed=Repository has been converted to regular type successfully.
|
||||
settings.transfer=Trasferisci proprietà
|
||||
@@ -594,17 +589,17 @@ settings.transfer_desc=Trasferisci questa repository a un altro utente o a un'or
|
||||
settings.transfer_notices_1=- You will lose access if new owner is a individual user.
|
||||
settings.transfer_notices_2=- You will conserve access if new owner is an organization and if you're one of the owners.
|
||||
settings.transfer_form_title=Per favore inserisci le informazioni seguenti per confermare l'operazione:
|
||||
settings.wiki_delete=Erase Wiki Data
|
||||
settings.wiki_delete=Elimina i dati della Wiki
|
||||
settings.wiki_delete_desc=Once you erase wiki data there is no going back. Please be certain.
|
||||
settings.wiki_delete_notices_1=- This will delete and disable the wiki for %s
|
||||
settings.wiki_deletion_success=Repository wiki data have been erased successfully.
|
||||
settings.wiki_deletion_success=I dati della wiki del repository sono stati eliminati con successo.
|
||||
settings.delete=Elimina questo repository
|
||||
settings.delete_desc=Una volta che hai cancellato il repository, non puoi tornare indietro. Si prega di fare attenzione.
|
||||
settings.delete_notices_1=-Questa operazione <strong>NON PUÒ</strong> essere annullata.
|
||||
settings.delete_notices_2=-Questa operazione eliminerà definitivamente il tutto il contenuto del repository, inclusi i dati di Git, incidenti, commenti e accessi dei collaboratori.
|
||||
settings.delete_notices_fork_1=-Se questo repository è pubblico, tutti i fork diventeranno indipendenti dopo la sua cancellazione.
|
||||
settings.delete_notices_fork_2=-Se questo repository è privato, tutti fork verranno rimossi assieme ad esso.
|
||||
settings.delete_notices_fork_3=- If you want to keep all forks after deletion, please change visibility of this repository to public first.
|
||||
settings.delete_notices_fork_3=- Se vuoi mantenere i forks dopo la cancellazione, per piacere cambia la visibilità di questo repository in pubblica.
|
||||
settings.deletion_success=Il repository è stato eliminato con successo!
|
||||
settings.update_settings_success=Le opzioni repository sono state aggiornate con successo.
|
||||
settings.transfer_owner=Nuovo Proprietario
|
||||
@@ -613,9 +608,9 @@ settings.transfer_succeed=Proprietà del repository trasferita con successo.
|
||||
settings.confirm_delete=Conferma eliminazione
|
||||
settings.add_collaborator=Aggiungi nuovo collaboratore
|
||||
settings.add_collaborator_success=Il nuovo collaboratore è stato aggiunto.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.delete_collaborator=Elimina
|
||||
settings.collaborator_deletion=Eliminazione collaboratore
|
||||
settings.collaborator_deletion_desc=Questo utente non potrà più collaborare a questo repository dopo l'eliminazione. Si desidera continuare?
|
||||
settings.remove_collaborator_success=Il collaboratore è stato rimosso.
|
||||
settings.search_user_placeholder=Cerca utente...
|
||||
settings.org_not_allowed_to_be_collaborator=Un'organizzazione non può essere aggiunta come collaboratore.
|
||||
@@ -625,11 +620,11 @@ settings.hooks_desc=I Webhooks sono molto simili a un basilare evento trigger HT
|
||||
settings.webhook_deletion=Elimina Webhook
|
||||
settings.webhook_deletion_desc=Delete this webhook will remove its information and all delivery history. Do you want to continue?
|
||||
settings.webhook_deletion_success=Webhook has been deleted successfully!
|
||||
settings.webhook.test_delivery=Test Delivery
|
||||
settings.webhook.test_delivery=Test di consegna
|
||||
settings.webhook.test_delivery_desc=Send a fake push event delivery to test your webhook settings
|
||||
settings.webhook.test_delivery_success=Test webhook has been added to delivery queue. It may take few seconds before it shows up in the delivery history.
|
||||
settings.webhook.request=Request
|
||||
settings.webhook.response=Response
|
||||
settings.webhook.request=Richiesta
|
||||
settings.webhook.response=Risposta
|
||||
settings.webhook.headers=Headers
|
||||
settings.webhook.payload=Payload
|
||||
settings.webhook.body=Body
|
||||
@@ -642,17 +637,17 @@ settings.add_webhook_desc=Gogs manderà una richiesta <code>POST</code> all'URL
|
||||
settings.payload_url=Payload URL
|
||||
settings.content_type=Content Type
|
||||
settings.secret=Secret
|
||||
settings.slack_username=Username
|
||||
settings.slack_username=Nome utente
|
||||
settings.slack_icon_url=URL icona
|
||||
settings.slack_color=Colore
|
||||
settings.event_desc=Quali eventi dovrebbero innescare questo webhook?
|
||||
settings.event_push_only=Solo l'evento <code>push</code>.
|
||||
settings.event_send_everything=I need <strong>everything</strong>.
|
||||
settings.event_choose=Let me choose what I need.
|
||||
settings.event_send_everything=Ho bisogno di <strong>tutto</strong>.
|
||||
settings.event_choose=Lasciami scegliere ciò di cui ho bisogno.
|
||||
settings.event_create=Crea
|
||||
settings.event_create_desc=Branch, or tag created
|
||||
settings.event_create_desc=Branch, o tag creato
|
||||
settings.event_push=Push
|
||||
settings.event_push_desc=Git push to a repository
|
||||
settings.event_push_desc=Git push in un repository
|
||||
settings.active=Attivo
|
||||
settings.active_helper=Anche i dettagli riguardanti l'evento che ha innescato l'hook saranno inviati.
|
||||
settings.add_hook_success=Il nuovo webhook è stato aggiunto.
|
||||
@@ -666,25 +661,25 @@ settings.slack_token=Token
|
||||
settings.slack_domain=Dominio
|
||||
settings.slack_channel=Canale
|
||||
settings.deploy_keys=Dispiega Chiavi
|
||||
settings.add_deploy_key=Add Deploy Key
|
||||
settings.deploy_key_desc=Deploy keys have read-only access. They are not the same as personal account SSH keys.
|
||||
settings.no_deploy_keys=You haven't added any deploy keys.
|
||||
settings.title=Title
|
||||
settings.deploy_key_content=Content
|
||||
settings.key_been_used=Deploy key content has been used.
|
||||
settings.key_name_used=Deploy key with the same name already exists.
|
||||
settings.add_key_success=New deploy key '%s' has been added successfully!
|
||||
settings.deploy_key_deletion=Delete Deploy Key
|
||||
settings.deploy_key_deletion_desc=Deleting this deploy key will remove all related accesses for this repository. Do you want to continue?
|
||||
settings.deploy_key_deletion_success=Deploy key has been deleted successfully!
|
||||
settings.add_deploy_key=Aggiungi Deploy Key
|
||||
settings.deploy_key_desc=Le deploy keys hanno accesso in sola lettura. Non equivalgono alle chiavi SSH personali.
|
||||
settings.no_deploy_keys=Non hai aggiunto alcuna deploy key.
|
||||
settings.title=Titolo
|
||||
settings.deploy_key_content=Contenuto
|
||||
settings.key_been_used=La deploy key è già in uso.
|
||||
settings.key_name_used=Esiste già una deploy key con questo nome.
|
||||
settings.add_key_success=La nuova deploy key '%s' è stata aggiunta con successo!
|
||||
settings.deploy_key_deletion=Elimina Deploy Key
|
||||
settings.deploy_key_deletion_desc=Cancellando questa deploy key verrà rismosso ogni accesso relativo a questa repository. Vuoi continuare?
|
||||
settings.deploy_key_deletion_success=Deploy key eliminata con successo!
|
||||
|
||||
diff.browse_source=Sfoglia il codice sorgente
|
||||
diff.parent=parent
|
||||
diff.commit=commit
|
||||
diff.data_not_available=Diff Data non disponibile.
|
||||
diff.show_diff_stats=Mostra Diff Stats
|
||||
diff.show_split_view=Split View
|
||||
diff.show_unified_view=Unified View
|
||||
diff.show_split_view=Visualizzazione separata
|
||||
diff.show_unified_view=Visualizzazione unificata
|
||||
diff.stats_desc=<strong>%d ha cambiato i file</strong> con <strong>%d aggiunte</strong> e <strong>%d eliminazioni</strong>
|
||||
diff.bin=BIN
|
||||
diff.view_file=Vedi File
|
||||
@@ -702,21 +697,21 @@ release.edit_subheader=Detailed change log can help users understand what has be
|
||||
release.tag_name=Nome tag
|
||||
release.target=Obbiettivo
|
||||
release.tag_helper=Scegli un tag esistente o crea un nuovo tag una volta pubblicato.
|
||||
release.title=Title
|
||||
release.content=Content
|
||||
release.title=Titolo
|
||||
release.content=Contenuto
|
||||
release.write=Scrivi
|
||||
release.preview=Anteprima
|
||||
release.loading=Caricamento...
|
||||
release.prerelease_desc=Questo è un pre-rilascio
|
||||
release.prerelease_helper=Precisiamo che questo rilascio non è pronta per la produzione.
|
||||
release.cancel=Cancel
|
||||
release.cancel=Annulla
|
||||
release.publish=Pubblica Rilascio
|
||||
release.save_draft=Salva Bozza
|
||||
release.edit_release=Modifica Rilascio
|
||||
release.delete_release=Delete This Release
|
||||
release.deletion=Release Deletion
|
||||
release.deletion_desc=Deleting this release will delete the corresponding Git tag. Do you want to continue?
|
||||
release.deletion_success=Release has been deleted successfully!
|
||||
release.delete_release=Cancela questa Release
|
||||
release.deletion=Eliminazione Release
|
||||
release.deletion_desc=Eliminando questa release cancellarai anche i tag Git corrispondenti. Vuoi continuare?
|
||||
release.deletion_success=La release è stata eliminata con successo!
|
||||
release.tag_name_already_exist=Un rilascio con questo tag esiste già.
|
||||
release.downloads=Download
|
||||
|
||||
@@ -749,7 +744,7 @@ settings.website=Sito Web
|
||||
settings.location=Residenza
|
||||
settings.update_settings=Aggiorna Impostazioni
|
||||
settings.update_setting_success=Impostazioni dell'organizzazione aggiornate con successo.
|
||||
settings.change_orgname_prompt=This change will affect how links relate to the organization.
|
||||
settings.change_orgname_prompt=Questa operazione modificherà il modo in cui i links sono in relazione con l'organizzazione.
|
||||
settings.update_avatar_success=Organization avatar setting has been updated successfully.
|
||||
settings.delete=Elimina organizzazione
|
||||
settings.delete_account=Elimina questa organizzazione
|
||||
@@ -764,7 +759,7 @@ members.public=Pubblico
|
||||
members.public_helper=rendi privato
|
||||
members.private=Privato
|
||||
members.private_helper=rendi pubblico
|
||||
members.member_role=Member Role:
|
||||
members.member_role=Ruolo del membro:
|
||||
members.owner=Proprietario
|
||||
members.member=Membro
|
||||
members.remove=Rimuovere
|
||||
@@ -794,7 +789,7 @@ teams.read_permission_desc=Questo Team concede accesso di <strong>Lettura</stron
|
||||
teams.write_permission_desc=Questo Team concede accesso di <strong>Scrittura</strong>: i membri possono leggere e pushare i repository del Team.
|
||||
teams.admin_permission_desc=Questo Team concede accesso di <strong>Amministratore</strong>: i membri possono leggere i, pushare a, e aggiungere collaboratori ai repository del Team.
|
||||
teams.repositories=Repository di Squadra
|
||||
teams.search_repo_placeholder=Search repository...
|
||||
teams.search_repo_placeholder=Cerca repository...
|
||||
teams.add_team_repository=Aggiungere Repository di Squadra
|
||||
teams.remove_repo=Rimuovi
|
||||
teams.add_nonexistent_repo=Il repository che stai tentando di aggiungere non esiste, crealo prima.
|
||||
@@ -882,8 +877,8 @@ users.auth_login_name=Authentication Login Name
|
||||
users.password_helper=Leave it empty to remain unchanged.
|
||||
users.update_profile_success=Profilo dell'account aggiornato con successo.
|
||||
users.edit_account=Modifica Account
|
||||
users.max_repo_creation=Maximum Repository Creation Limit
|
||||
users.max_repo_creation_desc=(Set -1 to use global default limit)
|
||||
users.max_repo_creation=Limite massimo per la creazione di Repository
|
||||
users.max_repo_creation_desc=(Inserire -1 per usare il limite globale di default)
|
||||
users.is_activated=Questo account è attivato
|
||||
users.is_admin=Questo account ha permessi di amministratore
|
||||
users.allow_git_hook=Questo account ha il permesso di creare hooks di Git
|
||||
@@ -908,31 +903,31 @@ repos.stars=Voti
|
||||
repos.issues=Problemi
|
||||
|
||||
auths.auth_manage_panel=Authentication Manage Panel
|
||||
auths.new=Add New Source
|
||||
auths.new=Aggiungi Nuova Origine
|
||||
auths.name=Nome
|
||||
auths.type=Tipo
|
||||
auths.enabled=Attivo
|
||||
auths.updated=Aggiornato
|
||||
auths.auth_type=Authentication Type
|
||||
auths.auth_name=Authentication Name
|
||||
auths.auth_type=Tipo di autenticazione
|
||||
auths.auth_name=Nome di autenticazione
|
||||
auths.domain=Dominio
|
||||
auths.host=Host
|
||||
auths.port=Porta
|
||||
auths.bind_dn=Bind DN
|
||||
auths.bind_password=Bind Password
|
||||
auths.bind_password_helper=Warning: This password is stored in plain text. Do not use a high privileged account.
|
||||
auths.bind_dn=Binda DN
|
||||
auths.bind_password=Binda Password
|
||||
auths.bind_password_helper=Attenzione: Questa password è salvata in chiaro. Non usare su un acount con alti privilegi.
|
||||
auths.user_base=User Search Base
|
||||
auths.user_dn=User DN
|
||||
auths.attribute_username=Username attribute
|
||||
auths.user_dn=DN dell'utente
|
||||
auths.attribute_username=Attributo username
|
||||
auths.attribute_username_placeholder=Leave empty to use sign-in form field value for user name.
|
||||
auths.attribute_name=Attributo Nome
|
||||
auths.attribute_surname=Attributo Cognome
|
||||
auths.attribute_mail=Attributo Email
|
||||
auths.attributes_in_bind=Fetch attributes in Bind DN context
|
||||
auths.filter=User Filter
|
||||
auths.admin_filter=Admin Filter
|
||||
auths.filter=Fitro utente
|
||||
auths.admin_filter=Filtro Amministratore
|
||||
auths.ms_ad_sa=Ms Ad SA
|
||||
auths.smtp_auth=SMTP Authentication Type
|
||||
auths.smtp_auth=Tipo di autenticazione SMTP
|
||||
auths.smtphost=Host SMTP
|
||||
auths.smtpport=Porta SMTP
|
||||
auths.allowed_domains=Domini consentiti
|
||||
@@ -942,12 +937,12 @@ auths.skip_tls_verify=Salta verifica TLS
|
||||
auths.pam_service_name=Nome del Servizio PAM
|
||||
auths.enable_auto_register=Abilitare Registrazione Automatica
|
||||
auths.tips=Consigli
|
||||
auths.edit=Edit Authentication Setting
|
||||
auths.edit=Modifica impostazioni di autenticazione
|
||||
auths.activated=Questa Autenticazione è stata attivata
|
||||
auths.new_success=New authentication '%s' has been added successfully.
|
||||
auths.update_success=Authentication setting has been updated successfully.
|
||||
auths.update=Update Authentication Setting
|
||||
auths.delete=Delete This Authentication
|
||||
auths.update=Aggiornare le impostazioni di autenticazione
|
||||
auths.delete=Elimina questa autenticazione
|
||||
auths.delete_auth_title=Authentication Deletion
|
||||
auths.delete_auth_desc=This authentication is going to be deleted, do you want to continue?
|
||||
auths.still_in_used=This authentication is still used by some users, please delete or convert these users to another login type first.
|
||||
@@ -969,16 +964,16 @@ config.script_type=Tipo di Script
|
||||
config.reverse_auth_user=Autenticazione Utente Inversa
|
||||
|
||||
config.ssh_config=Configurazione SSH
|
||||
config.ssh_enabled=Enabled
|
||||
config.ssh_start_builtin_server=Start Builtin Server
|
||||
config.ssh_domain=Domain
|
||||
config.ssh_enabled=Attivo
|
||||
config.ssh_start_builtin_server=Avvia server builtin
|
||||
config.ssh_domain=Dominio
|
||||
config.ssh_port=Porta
|
||||
config.ssh_listen_port=Porta in ascolto
|
||||
config.ssh_root_path=Root Path
|
||||
config.ssh_key_test_path=Key Test Path
|
||||
config.ssh_keygen_path=Keygen ('ssh-keygen') Path
|
||||
config.ssh_minimum_key_size_check=Minimum Key Size Check
|
||||
config.ssh_minimum_key_sizes=Minimum Key Sizes
|
||||
config.ssh_root_path=Percorso Root
|
||||
config.ssh_key_test_path=Percorso chiave di test
|
||||
config.ssh_keygen_path=Percorso Keygen ('ssh-keygen')
|
||||
config.ssh_minimum_key_size_check=Verifica delle dimensioni minime della chiave
|
||||
config.ssh_minimum_key_sizes=Dimensioni minime della chiave
|
||||
|
||||
config.db_config=Configurazione Database
|
||||
config.db_type=Tipo
|
||||
@@ -995,12 +990,12 @@ config.disable_register=Disabilita Registrazione
|
||||
config.show_registration_button=Mostra Pulsane Registrazione
|
||||
config.require_sign_in_view=Richiesto Accesso per Vedere
|
||||
config.mail_notify=Email di Notifica
|
||||
config.disable_key_size_check=Disable Minimum Key Size Check
|
||||
config.disable_key_size_check=Disabilita controllo sulle dimensioni minime della chiave
|
||||
config.enable_captcha=Abilita Captcha
|
||||
config.active_code_lives=Attiva Vita del Codice
|
||||
config.reset_password_code_lives=Reimpostare Password della Vita del Codice
|
||||
config.webhook_config=Configurazione Webhook
|
||||
config.queue_length=Queue Length
|
||||
config.queue_length=Lunghezza della coda
|
||||
config.deliver_timeout=Tempo Limite di Consegna
|
||||
config.skip_tls_verify=Salta verifiche TLS
|
||||
config.mailer_config=Configurazione Mailer
|
||||
@@ -1010,8 +1005,8 @@ config.mailer_name=Nome
|
||||
config.mailer_host=Host
|
||||
config.mailer_user=Utente
|
||||
config.send_test_mail=Invia email di test
|
||||
config.test_mail_failed=Fail to send test email to '%s': %v
|
||||
config.test_mail_sent=Test email has been sent to '%s'.
|
||||
config.test_mail_failed=Impossibile inviare mail a '%s': %v
|
||||
config.test_mail_sent=Una mail di prova è stata inviata a '%s'.
|
||||
config.oauth_config=Configurazione OAuth
|
||||
config.oauth_enabled=Attivo
|
||||
config.cache_config=Configurazione Cache
|
||||
@@ -1045,18 +1040,18 @@ monitor.start=Orario Avvio
|
||||
monitor.execute_time=Tempo di Esecuzione
|
||||
|
||||
notices.system_notice_list=Avvisi di Sistema
|
||||
notices.view_detail_header=View Notice Detail
|
||||
notices.actions=Actions
|
||||
notices.view_detail_header=Visualizza dettagli dell'avviso
|
||||
notices.actions=Azioni
|
||||
notices.select_all=Seleziona tutto
|
||||
notices.deselect_all=Deseleziona tutto
|
||||
notices.inverse_selection=Inverti selezione
|
||||
notices.delete_selected=Elimina selezionati
|
||||
notices.delete_all=Delete All Notices
|
||||
notices.delete_all=Elimina tutti gli avvisi
|
||||
notices.type=Tipo
|
||||
notices.type_1=Repository
|
||||
notices.desc=Descrizione
|
||||
notices.op=Op.
|
||||
notices.delete_success=System notices have been deleted successfully.
|
||||
notices.delete_success=Gli avvisi di sistema sono stati successivamente eliminati.
|
||||
|
||||
[action]
|
||||
create_repo=ha creato il repository <a href="%s">%s</a>
|
||||
@@ -1099,5 +1094,5 @@ raw_minutes=minuti
|
||||
default_message=Drop files here or click to upload.
|
||||
invalid_input_type=You can't upload files of this type.
|
||||
file_too_big=File size ({{filesize}} MB) exceeds maximum size ({{maxFilesize}} MB).
|
||||
remove_file=Remove file
|
||||
remove_file=Rimuovi file
|
||||
|
||||
|
||||
@@ -38,23 +38,16 @@ settings=設定
|
||||
your_profile=あなたのプロファイル
|
||||
your_settings=あなたの設定
|
||||
|
||||
activities=Activities
|
||||
activities=アクティビティ
|
||||
pull_requests=プルリクエスト
|
||||
issues=課題
|
||||
|
||||
cancel=キャンセル
|
||||
|
||||
[search]
|
||||
search=検索...
|
||||
repository=リポジトリ
|
||||
user=ユーザ
|
||||
issue=課題
|
||||
code=コード
|
||||
|
||||
[install]
|
||||
install=インストール
|
||||
title=初回実行のインストール手順
|
||||
docker_helper=DockerでGogsを稼動する場合、このページに変更を加えるまえに、 <a target="_blank" href="%s">Guidelines</a>をよく読んでください!
|
||||
title=インストールをする前に必要な準備をしましょう
|
||||
docker_helper=DockerでGogsを稼動する場合は、このページに変更を加える前に、 <a target="_blank" href="%s">ガイドライン</a>をよく読んでください!
|
||||
requite_db_desc=Gogs は、MySQL、PostgreSQL、SQLite3 または TiDB が必要です。
|
||||
db_title=データベース設定
|
||||
db_type=データベースの種類
|
||||
@@ -62,10 +55,10 @@ host=ホスト
|
||||
user=ユーザ
|
||||
password=パスワード
|
||||
db_name=データベース名
|
||||
db_helper=Mysql INNODB エンジン utf8_general_ci の文字セットを使用してください。
|
||||
db_helper=MySQLではエンジンがINNODB、文字セットがutf8_general_ciである必要があります。
|
||||
ssl_mode=SSL モード
|
||||
path=パス
|
||||
sqlite_helper=The file path of SQLite3 or TiDB database. <br>Please use absolute path when you start as service.
|
||||
sqlite_helper=SQLite3かTiDBのデータベースのファイルパス。<br>サービスとして開始する際には絶対パスを利用してください。
|
||||
err_empty_db_path=SQLite3 または TiDB データベースのパスを空にすることはできません。
|
||||
err_invalid_tidb_name=TiDB データベース名は文字"."と"-"を許可しない。
|
||||
no_admin_and_disable_registration=管理者アカウントを作成せずに登録を無効にすることはできません。
|
||||
@@ -86,8 +79,8 @@ http_port=HTTP ポート
|
||||
http_port_helper=アプリケーションが待ち受けするポート番号。
|
||||
app_url=アプリケーションの URL
|
||||
app_url_helper=この設定は、HTTP / HTTPSのクローンURLおよび、一部のメールボックスへのリンクに影響を与えます。
|
||||
log_root_path=Log Path
|
||||
log_root_path_helper=Directory to write log files to.
|
||||
log_root_path=ログのパス
|
||||
log_root_path_helper=ログファイルを書き込むディレクトリ。
|
||||
|
||||
optional_title=オプション設定
|
||||
email_title=E-mailサービス設定
|
||||
@@ -99,10 +92,10 @@ mailer_password=送信者のパスワード
|
||||
register_confirm=登録の確認を有効にする
|
||||
mail_notify=メール通知を有効にする
|
||||
server_service_title=サーバーとその他のサービスの設定
|
||||
offline_mode=オフラインモード有効化
|
||||
offline_mode_popup=プロダクション モードでCDN を無効にし、すべてのリソースファイルをローカルで提供します 。
|
||||
offline_mode=オフラインモードを有効にする
|
||||
offline_mode_popup=プロダクションモードでは、CDNを使用せずにローカルからリソースファイルを使用します。
|
||||
disable_gravatar=Gravatarのサービスを無効にします
|
||||
disable_gravatar_popup=Disable Gravatar and custom sources, all avatars are uploaded by users or default.
|
||||
disable_gravatar_popup=Gravatarとカスタムソースを無効にして、全てのアバターをユーザーによってアップロードされたものかデフォルトなものにします。
|
||||
disable_registration=自己登録を無効にする
|
||||
disable_registration_popup=自己登録を無効にし、管理者のみがアカウント作成できる
|
||||
enable_captcha=Captchaを有効にする
|
||||
@@ -124,7 +117,7 @@ run_user_not_match=実行ユーザーは、現在のユーザーではない: %s
|
||||
save_config_failed=構成の保存に失敗した: %v
|
||||
invalid_admin_setting=管理者アカウントの設定が無効です: %v
|
||||
install_success=ようこそ!我々はあなたが Gogs を選んでくれて嬉しいです!楽しみましょう!
|
||||
invalid_log_root_path=Log root path is invalid: %v
|
||||
invalid_log_root_path=ログのルートパスがむこうです: %v
|
||||
|
||||
[home]
|
||||
uname_holder=ユーザー名またはEメール
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=あなたのリポジトリ
|
||||
|
||||
[explore]
|
||||
repos=リポジトリ
|
||||
users=Users
|
||||
search=Search
|
||||
|
||||
[auth]
|
||||
create_new_account=新規アカウントを作成
|
||||
@@ -168,7 +163,7 @@ activate_account=あなたのアカウントを有効にしてください。
|
||||
activate_email=電子メール アドレスを確認します。
|
||||
reset_password=パスワードをリセットします.
|
||||
register_success=ようこそ、登録成功
|
||||
register_notify=Welcome on board
|
||||
register_notify=ボードへようこそ
|
||||
|
||||
[modal]
|
||||
yes=はい
|
||||
@@ -264,7 +259,7 @@ cancel=キャンセル
|
||||
enable_custom_avatar=カスタムのアバターを有効にする
|
||||
choose_new_avatar=新しいアバターを選択
|
||||
update_avatar=アバターの設定を更新
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=現在のアバターを削除
|
||||
uploaded_avatar_not_a_image=アップロードされたファイルは画像ではない。
|
||||
update_avatar_success=あなたのアバターの設定が更新されました。
|
||||
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Problēmas
|
||||
|
||||
cancel=Atcelt
|
||||
|
||||
[search]
|
||||
search=Meklēt...
|
||||
repository=Repozitorijs
|
||||
user=Lietotājs
|
||||
issue=Kļūda
|
||||
code=Kods
|
||||
|
||||
[install]
|
||||
install=Instalācija
|
||||
title=Instalācijas soļi pirmo reizi palaižot
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Jūsu repozitorijos
|
||||
|
||||
[explore]
|
||||
repos=Repozitoriji
|
||||
users=Lietotāji
|
||||
search=Meklēt
|
||||
|
||||
[auth]
|
||||
create_new_account=Izveidot jaunu kontu
|
||||
@@ -264,7 +259,7 @@ cancel=Atcelt
|
||||
enable_custom_avatar=Iespējot maināmu profila attēlu
|
||||
choose_new_avatar=Izvēlēties jaunu profila attēlu
|
||||
update_avatar=Saglabāt profila bildi
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Dzēst pašreizējo profila bildi
|
||||
uploaded_avatar_not_a_image=Augšupielādētais fails nav attēls.
|
||||
update_avatar_success=Jūsu profila bilde tika veiksmīgi saglabāta.
|
||||
|
||||
@@ -476,7 +471,7 @@ issues.closed_at=`aizvērts <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.reopened_at=`atvērts atkārtoti <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commit_ref_at=`pieminēja šo problēmu revīzijā <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.poster=Autors
|
||||
issues.collaborator=Collaborator
|
||||
issues.collaborator=Līdzstrādnieks
|
||||
issues.owner=Īpašnieks
|
||||
issues.sign_up_for_free=Pievienojieties
|
||||
issues.sign_in_require_desc=, lai piedalītos diskusijā. Jau ir konts? <a href="%s">Pierakstieties, lai komentētu</a>
|
||||
@@ -557,8 +552,8 @@ wiki.save_page=Saglabāt lapu
|
||||
wiki.last_commit_info=%s laboja lapu %s
|
||||
wiki.edit_page_button=Labot
|
||||
wiki.new_page_button=Jauna lapa
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.delete_page_button=Dzēst lapu
|
||||
wiki.delete_page_notice_1=Tiks izdzēsta lapa <code>"%s"</code>. Pārliecinieties, ka patiešām to vēlaties.
|
||||
wiki.page_already_exists=Vikivietnes lapa ar šādu nosaukumu jau eksistē.
|
||||
wiki.pages=Lapas
|
||||
wiki.last_updated=Pēdējo reizi labota %s
|
||||
@@ -594,10 +589,10 @@ settings.transfer_desc=Mainīt šī repozitorija īpašnieku uz citu lietotāju
|
||||
settings.transfer_notices_1=- Jūs pazaudēsiet piekļuvi, ja jaunais īpašnieks ir lietotājs.
|
||||
settings.transfer_notices_2=- Jūs saglabāsiet piekļuvi, ja jaunais īpašnieks ir organizācija un Jūs esat viens no tās īpašniekiem.
|
||||
settings.transfer_form_title=Lūdzu, ievadiet sekojošu informāciju, lai apstiprinātu šo darbību:
|
||||
settings.wiki_delete=Erase Wiki Data
|
||||
settings.wiki_delete_desc=Once you erase wiki data there is no going back. Please be certain.
|
||||
settings.wiki_delete_notices_1=- This will delete and disable the wiki for %s
|
||||
settings.wiki_deletion_success=Repository wiki data have been erased successfully.
|
||||
settings.wiki_delete=Dzēst Vikivietnes datus
|
||||
settings.wiki_delete_desc=Vikivietnes datu dzēšana ir neatgriezeniska. Pārliecinieties vai patiešām to vēlaties.
|
||||
settings.wiki_delete_notices_1=- Šī darbība dzēsīs un atspējos %s Vikivietni
|
||||
settings.wiki_deletion_success=Repozitorija Vikivietnes dati tika veiksmīgi izdzēsti.
|
||||
settings.delete=Dzēst šo repozitoriju
|
||||
settings.delete_desc=Dzēšot repozitoriju, tā datus vairs nebūs iespējams atgūt. Pirms dzēšanas pārliecinieites vai patiešām vēlaties to darīt.
|
||||
settings.delete_notices_1=- Šī darbība ir <strong>NEATGRIEZENISKA</strong>.
|
||||
@@ -613,9 +608,9 @@ settings.transfer_succeed=Repozitorija īpašnieks ir veiksmīgi nomainīts.
|
||||
settings.confirm_delete=Apstiprināt dzēšanu
|
||||
settings.add_collaborator=Pievienot jaunu līdzstrādnieku
|
||||
settings.add_collaborator_success=Jauns līdzstrādnieks ir pievienots.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.delete_collaborator=Dzēst
|
||||
settings.collaborator_deletion=Līdzstrādnieka dzēšana
|
||||
settings.collaborator_deletion_desc=Šim lietotājam pēc dzēšanas vairs nebūs sadarbības pieejas šai krātuvei. Vai vēlaties turpināt?
|
||||
settings.remove_collaborator_success=Līdzstrādnieks tika noņemts.
|
||||
settings.search_user_placeholder=Meklēt lietotāju...
|
||||
settings.org_not_allowed_to_be_collaborator=Organizāciju nav atļauts pievienot kā līdzstrādnieku.
|
||||
@@ -950,7 +945,7 @@ auths.update=Mainīt autentifikācijas iestatījumus
|
||||
auths.delete=Dzēst šo autentifikāciju
|
||||
auths.delete_auth_title=Autentifikācijas dzēšana
|
||||
auths.delete_auth_desc=Šī autentifikācija tiks dzēsta, vai vēlaties turpināt?
|
||||
auths.still_in_used=This authentication is still used by some users, please delete or convert these users to another login type first.
|
||||
auths.still_in_used=Daži lietotāji joprojām izmanto šo autentifikācijas veidu. Nepieciešams veikt šo lietotāju konvertāciju vai dzēšanu.
|
||||
auths.deletion_success=Autentifikācija tika veiksmīgi izdzēsta!
|
||||
|
||||
config.server_config=Servera konfigurācija
|
||||
@@ -1066,8 +1061,8 @@ create_issue=`reģistrēja problēmu <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`slēdza problēmu <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
reopen_issue=`atkārtoti atvēra problēmu <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
create_pull_request=`izveidoja izmaiņu pieprasījumu <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`closed pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`reopened pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`aizvēra izmaiņu pieprasījumu <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`atkārtoti atvēra izmaiņu pieprasījumu <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
comment_issue=`pievienoja komentāru problēmai <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
merge_pull_request=`sapludināja izmaiņu pieprasījumu <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
transfer_repo=mainīja repozitorija <code>%s</code> īpašnieku uz <a href="%s">%s</a>
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Kwesties
|
||||
|
||||
cancel=Annuleren
|
||||
|
||||
[search]
|
||||
search=Zoeken...
|
||||
repository=Repository
|
||||
user=Gebruiker
|
||||
issue=Probleem
|
||||
code=Code
|
||||
|
||||
[install]
|
||||
install=Installatie
|
||||
title=Installatiestappen voor de eerste keer opstarten
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=In uw repositories
|
||||
|
||||
[explore]
|
||||
repos=Repositories
|
||||
users=Gebruikers
|
||||
search=Zoeken
|
||||
|
||||
[auth]
|
||||
create_new_account=Maak nieuw account aan
|
||||
@@ -264,7 +259,7 @@ cancel=Annuleren
|
||||
enable_custom_avatar=Aangepaste avatar inschakelen
|
||||
choose_new_avatar=Kies een nieuwe avatar
|
||||
update_avatar=Avatar instelling bijwerken
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Verwijder huidige avatar
|
||||
uploaded_avatar_not_a_image=Geüpload bestand is geen afbeelding.
|
||||
update_avatar_success=Instellingen voor avatar succesvol bijgewerkt.
|
||||
|
||||
@@ -557,7 +552,7 @@ wiki.save_page=Pagina opslaan
|
||||
wiki.last_commit_info=%s heeft deze pagina aangepast %s
|
||||
wiki.edit_page_button=Bewerken
|
||||
wiki.new_page_button=Nieuwe pagina
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_button=Verwijder pagina
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.page_already_exists=Er bestaat al een wiki-pagina met deze naam.
|
||||
wiki.pages=Pagina’s
|
||||
@@ -613,7 +608,7 @@ settings.transfer_succeed=Eigendom repositorie succesvol overgedragen
|
||||
settings.confirm_delete=Bevestig verwijdering
|
||||
settings.add_collaborator=Nieuwe medewerker toevoegen
|
||||
settings.add_collaborator_success=medewerker is toegevoegd.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.delete_collaborator=Verwijderen
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.remove_collaborator_success=medewerker is verwijderd.
|
||||
|
||||
@@ -38,19 +38,12 @@ settings=Ustawienia
|
||||
your_profile=Twój profil
|
||||
your_settings=Twoje ustawienia
|
||||
|
||||
activities=Activities
|
||||
activities=Aktywności
|
||||
pull_requests=Oczekujące zmiany
|
||||
issues=Problemy
|
||||
|
||||
cancel=Anuluj
|
||||
|
||||
[search]
|
||||
search=Wyszukiwanie...
|
||||
repository=Repozytorium
|
||||
user=Użytkownik
|
||||
issue=Problem
|
||||
code=Kod
|
||||
|
||||
[install]
|
||||
install=Instalacja
|
||||
title=Kroki instalacyjne dla pierwszego uruchomienia
|
||||
@@ -86,8 +79,8 @@ http_port=Port HTTP
|
||||
http_port_helper=Numer portu na którym aplikacja jest dostępna.
|
||||
app_url=Adres URL aplikacji
|
||||
app_url_helper=To wpłynie na adresy klonowania HTTP/HTTPS i w wiadomościach e-mail.
|
||||
log_root_path=Log Path
|
||||
log_root_path_helper=Directory to write log files to.
|
||||
log_root_path=Ścieżka dla logów
|
||||
log_root_path_helper=Katalog do zapisu logów.
|
||||
|
||||
optional_title=Ustawienia opcjonalne
|
||||
email_title=Ustawienia serwera e-mail
|
||||
@@ -124,7 +117,7 @@ run_user_not_match=Użytkownik aplikacji nie jest aktualnym użytkownikiem: %s -
|
||||
save_config_failed=Nie udało się zapisać konfiguracji: %v
|
||||
invalid_admin_setting=Nieprawidłowe ustawienia konta admina: %v
|
||||
install_success=Cześć! Cieszymy się, że wybierałeś Gogs, baw się dobrze.
|
||||
invalid_log_root_path=Log root path is invalid: %v
|
||||
invalid_log_root_path=Ścieżka dla logów jest niepoprawna: %v
|
||||
|
||||
[home]
|
||||
uname_holder=Nazwa użytkownika lub e-mail
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=W Twoich repozytoriach
|
||||
|
||||
[explore]
|
||||
repos=Repozytoria
|
||||
users=Użytkownicy
|
||||
search=Wyszukiwanie
|
||||
|
||||
[auth]
|
||||
create_new_account=Załóż nowe konto
|
||||
@@ -264,7 +259,7 @@ cancel=Anuluj
|
||||
enable_custom_avatar=Włącz niestandardowe awatary
|
||||
choose_new_avatar=Wybierz nowy avatar
|
||||
update_avatar=Zaktualizuj ustawienia awatara
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Usuń obecny Avatar
|
||||
uploaded_avatar_not_a_image=Załadowany plik nie jest obrazem.
|
||||
update_avatar_success=Ustawienia awatarów zostały pomyślnie zaktualizowane.
|
||||
|
||||
@@ -476,7 +471,7 @@ issues.closed_at=`zamyka <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.reopened_at=`otwiera ponownie <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commit_ref_at=`wspomina ten problem w commicie <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.poster=Autor
|
||||
issues.collaborator=Collaborator
|
||||
issues.collaborator=Współpracownik
|
||||
issues.owner=Właściciel
|
||||
issues.sign_up_for_free=Zarejestruj się za darmo
|
||||
issues.sign_in_require_desc=do przyłączenia się do tej rozmowy. Masz już konto? <a href="%s">Zaloguj się by komentować</a>
|
||||
@@ -557,8 +552,8 @@ wiki.save_page=Zapisz stronę
|
||||
wiki.last_commit_info=%s edytuje tę stronę %s
|
||||
wiki.edit_page_button=Edytuj
|
||||
wiki.new_page_button=Nowa strona
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.delete_page_button=Usuń stronę
|
||||
wiki.delete_page_notice_1=Strona zostanie usunięta <code>"%s"</code>. Bądź ostrożny.
|
||||
wiki.page_already_exists=Strona Wiki o tej samej nazwie już istnieje.
|
||||
wiki.pages=Strony
|
||||
wiki.last_updated=Ostatnia aktualizacja %s
|
||||
@@ -584,20 +579,20 @@ settings.tracker_url_format_desc=Symbole zastępcze <code>{user} {repo} {index}<
|
||||
settings.pulls_desc=Włącz obsługę pull request, aby akceptować publiczny wkład
|
||||
settings.danger_zone=Strefa niebezpieczeństwa
|
||||
settings.new_owner_has_same_repo=Nowy właściciel już posiada repozytorium o tej samej nazwie.
|
||||
settings.convert=Convert To Regular Repository
|
||||
settings.convert_desc=You can convert this mirror to a regular repository. This cannot be reversed.
|
||||
settings.convert_notices_1=- This operation will convert this repository mirror into a regular repository and cannot be undone.
|
||||
settings.convert_confirm=Confirm Conversion
|
||||
settings.convert_succeed=Repository has been converted to regular type successfully.
|
||||
settings.convert=Konwersja na repozytorium regularne
|
||||
settings.convert_desc=Możesz przekonwertować ten mirror na repozytorium regularne. Ta czynność nie może być odwrócona.
|
||||
settings.convert_notices_1=- Ta operacja przekonwertuje mirror tego repozytorium na repozytorium regularne. Ta czynność nie może być odwrócona.
|
||||
settings.convert_confirm=Potwierdź konwersję
|
||||
settings.convert_succeed=Typ repozytorium został zamieniony na regularne.
|
||||
settings.transfer=Przeniesienie własności
|
||||
settings.transfer_desc=Przenieś to repozytorium do innego użytkownika lub organizacji gdzie masz uprawnienia administratora.
|
||||
settings.transfer_notices_1=- Stracisz dostęp jeśli nowy właściciel jest indywidualnym użytkownikiem.
|
||||
settings.transfer_notices_2=- Zachowasz dostęp jeśli nowym właścicielem jest organizacja, której jesteś współwłaścicielem.
|
||||
settings.transfer_form_title=Proszę wpisz co następuje w celu potwierdzenia operacji:
|
||||
settings.wiki_delete=Erase Wiki Data
|
||||
settings.wiki_delete_desc=Once you erase wiki data there is no going back. Please be certain.
|
||||
settings.wiki_delete_notices_1=- This will delete and disable the wiki for %s
|
||||
settings.wiki_deletion_success=Repository wiki data have been erased successfully.
|
||||
settings.wiki_delete=Kasowanie danych Wiki
|
||||
settings.wiki_delete_desc=Usunięcie danych z wiki jest nieodwracalne. Bądź ostrożny.
|
||||
settings.wiki_delete_notices_1=- To usunie i wyłączy wiki dla %s
|
||||
settings.wiki_deletion_success=Dane wiki zostały usunięte.
|
||||
settings.delete=Usuń to repozytorium
|
||||
settings.delete_desc=Po usunięciu repozytorium nie ma odwrotu. Upewnij się, że tego chcesz.
|
||||
settings.delete_notices_1=- Ta operacja <strong>NIE MOŻE</strong> zostać cofnięta.
|
||||
@@ -613,12 +608,12 @@ settings.transfer_succeed=Własność repozytorium została przeniesiona pomyśl
|
||||
settings.confirm_delete=Potwierdź usunięcie
|
||||
settings.add_collaborator=Dodaj nowego współpracownika
|
||||
settings.add_collaborator_success=Został dodany nowy współpracownik.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.delete_collaborator=Usuń
|
||||
settings.collaborator_deletion=Usunięcie współpracownika
|
||||
settings.collaborator_deletion_desc=Ten użytkownik nie będzie miał dostępu współpracownika do repozytorium. Czy chcesz kontynuować?
|
||||
settings.remove_collaborator_success=Współpracownik został usunięty.
|
||||
settings.search_user_placeholder=Szukaj użytkownika...
|
||||
settings.org_not_allowed_to_be_collaborator=Organization is not allowed to be added as a collaborator.
|
||||
settings.org_not_allowed_to_be_collaborator=Organizacji nie można dodać jako współpracownika.
|
||||
settings.user_is_org_member=Użytkownik jest członkiem organizacji, który nie może być dodany jako współpracownik.
|
||||
settings.add_webhook=Dodaj webhooka
|
||||
settings.hooks_desc=Webooki działają tak jak proste wywołania HTTP POST. Jeśli cokolwiek zdarzy się w Gogs, wyślemy powiadomienie do wybranego hosta. Więcej informacji można znaleźć w <a target="_blank" href="%s">przewodniku webhooków</a>.
|
||||
@@ -928,7 +923,7 @@ auths.attribute_username_placeholder=Zostaw puste aby użyć wartości podanej p
|
||||
auths.attribute_name=Atrybut imienia
|
||||
auths.attribute_surname=Atrybut nazwiska
|
||||
auths.attribute_mail=Atrybut e-mail
|
||||
auths.attributes_in_bind=Fetch attributes in Bind DN context
|
||||
auths.attributes_in_bind=Pobierz atrybuty w kontekście Bind DN
|
||||
auths.filter=Filtr użytkownika
|
||||
auths.admin_filter=Filtr administratora
|
||||
auths.ms_ad_sa=Ms Ad SA
|
||||
@@ -950,7 +945,7 @@ auths.update=Aktualizuj ustawienia uwierzytelniania
|
||||
auths.delete=Usuń to uwierzytelnienie
|
||||
auths.delete_auth_title=Usunięcie uwierzytelnienia
|
||||
auths.delete_auth_desc=To uwierzytelnienie zostanie usunięte, czy chcesz kontynuować?
|
||||
auths.still_in_used=This authentication is still used by some users, please delete or convert these users to another login type first.
|
||||
auths.still_in_used=Ten rodzaj autentykacji jest wciąż wykorzystywany przez niektórych użytkowników. Usuń lub przekonwertuj użytkowników, aby wykorzystywali inny typ logowania.
|
||||
auths.deletion_success=Uwierzytelnienie zostało usunięte pomyślnie!
|
||||
|
||||
config.server_config=Konfiguracja serwera
|
||||
@@ -968,17 +963,17 @@ config.log_file_root_path=Ścieżka plików dziennika
|
||||
config.script_type=Typ skryptu
|
||||
config.reverse_auth_user=Użytkownik dostarczony przez odwrotne proxy
|
||||
|
||||
config.ssh_config=SSH Configuration
|
||||
config.ssh_enabled=Enabled
|
||||
config.ssh_start_builtin_server=Start Builtin Server
|
||||
config.ssh_domain=Domain
|
||||
config.ssh_config=Konfiguracja SSH
|
||||
config.ssh_enabled=Aktywne
|
||||
config.ssh_start_builtin_server=Uruchom serwer wbudowany
|
||||
config.ssh_domain=Domena
|
||||
config.ssh_port=Port
|
||||
config.ssh_listen_port=Listen Port
|
||||
config.ssh_root_path=Root Path
|
||||
config.ssh_key_test_path=Key Test Path
|
||||
config.ssh_keygen_path=Keygen ('ssh-keygen') Path
|
||||
config.ssh_minimum_key_size_check=Minimum Key Size Check
|
||||
config.ssh_minimum_key_sizes=Minimum Key Sizes
|
||||
config.ssh_listen_port=Port nasłuchu
|
||||
config.ssh_root_path=Ścieżka katalogu głównego
|
||||
config.ssh_key_test_path=Ścieżka klucza testowego
|
||||
config.ssh_keygen_path=Ścieżka generatora ('ssh-keygen')
|
||||
config.ssh_minimum_key_size_check=Sprawdzanie minimalnej długości klucza
|
||||
config.ssh_minimum_key_sizes=Minimalne rozmiary kluczy
|
||||
|
||||
config.db_config=Konfiguracja bazy danych
|
||||
config.db_type=Typ
|
||||
@@ -1009,9 +1004,9 @@ config.mailer_disable_helo=Wyłącz HELO
|
||||
config.mailer_name=Nazwa
|
||||
config.mailer_host=Host
|
||||
config.mailer_user=Użytkownik
|
||||
config.send_test_mail=Send Test Email
|
||||
config.test_mail_failed=Fail to send test email to '%s': %v
|
||||
config.test_mail_sent=Test email has been sent to '%s'.
|
||||
config.send_test_mail=Wyślij email testowy
|
||||
config.test_mail_failed=Nieudane wysłanie wiadomości email do '%s': %v
|
||||
config.test_mail_sent=Testowa wiadomość email została wysłana do '%s'.
|
||||
config.oauth_config=Konfiguracja OAuth
|
||||
config.oauth_enabled=Aktywne
|
||||
config.cache_config=Konfiguracja cache
|
||||
@@ -1063,11 +1058,11 @@ create_repo=tworzy repozytorium <a href="%s">%s</a>
|
||||
rename_repo=zmienia nazwę repozytorium <code>%[1]s</code> na <a href="%[2]s">%[3]s</a>
|
||||
commit_repo=wypycha do <a href="%[1]s/src/%[2]s">%[3]s</a> w <a href="%[1]s">%[4]s</a>
|
||||
create_issue=`zgłasza problem <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`closed issue <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
reopen_issue=`reopened issue <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`zamknięcie problemu <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
reopen_issue=`ponowne otwarcie problemu <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
create_pull_request=`tworzy pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`closed pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`reopened pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`zamknięcie pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`ponowne otwarcie pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
comment_issue=`komentuje problem <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
merge_pull_request=`scala pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
transfer_repo=przenosi repozytorium <code>%s</code> do <a href="%s">%s</a>
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=Problemas
|
||||
|
||||
cancel=Cancelar
|
||||
|
||||
[search]
|
||||
search=Pesquisar...
|
||||
repository=Repositório
|
||||
user=Usuário
|
||||
issue=Problema
|
||||
code=Código
|
||||
|
||||
[install]
|
||||
install=Instalação
|
||||
title=Etapas de instalação para primeira execução
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=Em seus repositórios
|
||||
|
||||
[explore]
|
||||
repos=Repositórios
|
||||
users=Usuários
|
||||
search=Pesquisar
|
||||
|
||||
[auth]
|
||||
create_new_account=Criar Nova Conta
|
||||
@@ -264,7 +259,7 @@ cancel=Cancelar
|
||||
enable_custom_avatar=Habilitar Avatar Customizado
|
||||
choose_new_avatar=Escolha um novo avatar
|
||||
update_avatar=Atualizar configuração de Avatar
|
||||
delete_current_avatar=Delete Current Avatar
|
||||
delete_current_avatar=Excluir o Avatar atual
|
||||
uploaded_avatar_not_a_image=O arquivo enviado não é uma imagem.
|
||||
update_avatar_success=Sua configuração de avatar foi atualizada com sucesso.
|
||||
|
||||
@@ -476,7 +471,7 @@ issues.closed_at=`fechado em <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.reopened_at=`reaberto em <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.commit_ref_at=`citou este problema em um commit <a id="%[1]s" href="#%[1]s">%[2]s</a>`
|
||||
issues.poster=Autor
|
||||
issues.collaborator=Collaborator
|
||||
issues.collaborator=Colaboradores
|
||||
issues.owner=Proprietário
|
||||
issues.sign_up_for_free=Cadastre-se gratuitamente
|
||||
issues.sign_in_require_desc=para participar nesta conversa. Já tem uma conta? <a href="%s">Faça login para comentar</a>
|
||||
@@ -557,8 +552,8 @@ wiki.save_page=Salvar página
|
||||
wiki.last_commit_info=%s editou esta página %s
|
||||
wiki.edit_page_button=Editar
|
||||
wiki.new_page_button=Nova página
|
||||
wiki.delete_page_button=Delete Page
|
||||
wiki.delete_page_notice_1=This will delete the page <code>"%s"</code>. Please be certain.
|
||||
wiki.delete_page_button=Excluir Página
|
||||
wiki.delete_page_notice_1=Isto irá apagar a página <code>"%s"</code>. Por favor, certifique-se.
|
||||
wiki.page_already_exists=já existe uma página de wiki com o mesmo nome.
|
||||
wiki.pages=Páginas
|
||||
wiki.last_updated=Última atualização %s
|
||||
@@ -570,7 +565,7 @@ settings.hooks=Webhooks
|
||||
settings.githooks=Hooks do Git
|
||||
settings.basic_settings=Configurações Básicas
|
||||
settings.site=Site Oficial
|
||||
settings.update_settings=Configurações de Atualização
|
||||
settings.update_settings=Atualizar configurações
|
||||
settings.change_reponame_prompt=Este mudanças vai afetar os links para este repositório.
|
||||
settings.advanced_settings=Configurações avançadas
|
||||
settings.wiki_desc=Habilitar o wiki para permitir que as pessoas escrevam documentos
|
||||
@@ -594,10 +589,10 @@ settings.transfer_desc=Transferir este repositório para outro usuário ou para
|
||||
settings.transfer_notices_1=- Você vai perder acesso se o novo dono for um usuário individual.
|
||||
settings.transfer_notices_2=- Você vai continuar tendo acesso se o novo dono é uma organização e você é um dos membros.
|
||||
settings.transfer_form_title=Informe a seguinte informação para confirmar a sua operação:
|
||||
settings.wiki_delete=Erase Wiki Data
|
||||
settings.wiki_delete_desc=Once you erase wiki data there is no going back. Please be certain.
|
||||
settings.wiki_delete_notices_1=- This will delete and disable the wiki for %s
|
||||
settings.wiki_deletion_success=Repository wiki data have been erased successfully.
|
||||
settings.wiki_delete=Apagar dados do Wiki
|
||||
settings.wiki_delete_desc=Uma vez que você apague os dados da wiki, não há volta. Por favor, certifique-se.
|
||||
settings.wiki_delete_notices_1=- Isso irá excluir e desativar o wiki para %s
|
||||
settings.wiki_deletion_success=Dados de wiki do repositório foram deletados com sucesso.
|
||||
settings.delete=Deletar Este Repositório
|
||||
settings.delete_desc=Uma vez que você deleta um repositório, não tem volta. Por favor, tenha certeza.
|
||||
settings.delete_notices_1=-Esta operação <strong>NÃO PODERÁ</strong> ser desfeita.
|
||||
@@ -613,9 +608,9 @@ settings.transfer_succeed=A posse do repositório foi transferido com sucesso.
|
||||
settings.confirm_delete=Confirmar Deleção
|
||||
settings.add_collaborator=Adicionar um Novo Colaborador
|
||||
settings.add_collaborator_success=O novo colaborador foi adicionado.
|
||||
settings.delete_collaborator=Delete
|
||||
settings.collaborator_deletion=Collaborator Deletion
|
||||
settings.collaborator_deletion_desc=This user will no longer have collaboration access to this repository after deletion. Do you want to continue?
|
||||
settings.delete_collaborator=Deletar
|
||||
settings.collaborator_deletion=Exclusão de colaborador
|
||||
settings.collaborator_deletion_desc=Este usuário não terá mais acesso de colaboração neste repositório após a deleção. Você quer continuar?
|
||||
settings.remove_collaborator_success=O colaborador foi removido.
|
||||
settings.search_user_placeholder=Pesquisar usuário...
|
||||
settings.org_not_allowed_to_be_collaborator=Organização não tem permissão para ser adicionada como um colaborador.
|
||||
@@ -763,7 +758,7 @@ members.membership_visibility=Visibilidade da associação:
|
||||
members.public=Público
|
||||
members.public_helper=tornar privado
|
||||
members.private=Privado
|
||||
members.private_helper=torar público
|
||||
members.private_helper=tornar público
|
||||
members.member_role=Categoria de membro:
|
||||
members.owner=Dono
|
||||
members.member=Membro
|
||||
@@ -950,7 +945,7 @@ auths.update=Atualizar a configuração da autenticação
|
||||
auths.delete=Excluir esta autenticação
|
||||
auths.delete_auth_title=Exclusão da autenticação
|
||||
auths.delete_auth_desc=Esta autenticação esta prestes a ser deletada, deseja continuar?
|
||||
auths.still_in_used=This authentication is still used by some users, please delete or convert these users to another login type first.
|
||||
auths.still_in_used=Esta autenticação ainda é usada por alguns usuários. Por favor delete ou converta esses usuários para outro tipo de login primeiro.
|
||||
auths.deletion_success=Autenticação deletada com sucesso!
|
||||
|
||||
config.server_config=Configuração do Servidor
|
||||
@@ -1066,8 +1061,8 @@ create_issue=`questão aberta <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`questão fechada <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
reopen_issue=`questão reaberta <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
create_pull_request=`criou o pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`closed pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`reopened pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
close_pull_request=`fechou o pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
reopen_pull_request=`reabriu o pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
comment_issue=`comentou sobre a questão <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
merge_pull_request=`mesclou o pull request <a href="%s/pulls/%s">%s#%[2]s</a>`
|
||||
transfer_repo=repositório transferido de <code>%s</code> para <a href="%s">%s</a>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
app_desc=Удобная служба для собственного Git-репозитория, написанная на языке Go
|
||||
app_desc=Удобная служба для собственного Git-репозитория
|
||||
|
||||
home=Главная
|
||||
dashboard=Панель управления
|
||||
@@ -14,7 +14,7 @@ page=Страница
|
||||
template=Шаблон
|
||||
language=Язык
|
||||
create_new=Создать...
|
||||
user_profile_and_more=Профиль и остальное
|
||||
user_profile_and_more=Профиль пользователя и прочее
|
||||
signed_in_as=Вы вошли как
|
||||
|
||||
username=Имя пользователя
|
||||
@@ -44,13 +44,6 @@ issues=Задачи
|
||||
|
||||
cancel=Отмена
|
||||
|
||||
[search]
|
||||
search=Поиск...
|
||||
repository=Репозиторий
|
||||
user=Пользователь
|
||||
issue=Задача
|
||||
code=Код
|
||||
|
||||
[install]
|
||||
install=Установка
|
||||
title=Установочные шаги для первого запуска
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=В ваших репозиториях
|
||||
|
||||
[explore]
|
||||
repos=Репозитории
|
||||
users=Пользователи
|
||||
search=Поиск
|
||||
|
||||
[auth]
|
||||
create_new_account=Создать новый аккаунт
|
||||
@@ -1060,7 +1055,7 @@ notices.delete_success=Системное уведомление успешно
|
||||
|
||||
[action]
|
||||
create_repo=создал(а) репозиторий <a href="%s"> %s</a>
|
||||
rename_repo=репозиторий переименован из <code>%[1]s</code>на <a href="%[2]s">%[3]s</a>
|
||||
rename_repo=переименовал(а) репозиторий из <code>%[1]s</code> на <a href="%[2]s">%[3]s</a>
|
||||
commit_repo=запушил(а) <a href="%[1]s/src/%[2]s">%[3]s</a> в <a href="%[1]s">%[4]s</a>
|
||||
create_issue=`открыл(а) задачу <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
close_issue=`закрыл(а) задачу <a href="%s/issues/%s">%s#%[2]s</a>`
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=工单管理
|
||||
|
||||
cancel=取消
|
||||
|
||||
[search]
|
||||
search=搜索...
|
||||
repository=仓库
|
||||
user=用户
|
||||
issue=工单
|
||||
code=代码
|
||||
|
||||
[install]
|
||||
install=安装页面
|
||||
title=首次运行安装程序
|
||||
@@ -139,7 +132,9 @@ view_home=访问 %s
|
||||
issues.in_your_repos=属于该用户仓库的
|
||||
|
||||
[explore]
|
||||
repos=探索仓库
|
||||
repos=仓库
|
||||
users=用户
|
||||
search=搜索
|
||||
|
||||
[auth]
|
||||
create_new_account=创建帐户
|
||||
|
||||
@@ -44,13 +44,6 @@ issues=問題
|
||||
|
||||
cancel=取消
|
||||
|
||||
[search]
|
||||
search=搜尋...
|
||||
repository=倉庫
|
||||
user=用戶
|
||||
issue=工單
|
||||
code=程式碼
|
||||
|
||||
[install]
|
||||
install=安裝頁面
|
||||
title=首次安裝步驟
|
||||
@@ -140,6 +133,8 @@ issues.in_your_repos=屬於該用戶倉庫的
|
||||
|
||||
[explore]
|
||||
repos=探索倉庫
|
||||
users=Users
|
||||
search=Search
|
||||
|
||||
[auth]
|
||||
create_new_account=創建帳戶
|
||||
|
||||
144
glide.lock
generated
Normal file
144
glide.lock
generated
Normal file
@@ -0,0 +1,144 @@
|
||||
hash: f2fa73b9a379e1fa12f2b48fb0b9942a545b4518a2d71cbd956ee81093347773
|
||||
updated: 2016-03-19T14:44:26.835671547-04:00
|
||||
imports:
|
||||
- name: github.com/bradfitz/gomemcache
|
||||
version: fb1f79c6b65acda83063cbc69f6bba1522558bfc
|
||||
subpackages:
|
||||
- memcache
|
||||
- name: github.com/codegangsta/cli
|
||||
version: aca5b047ed14d17224157c3434ea93bf6cdaadee
|
||||
- name: github.com/go-macaron/binding
|
||||
version: a68f34212fe257219981e43adfe4c96ab48f42cd
|
||||
- name: github.com/go-macaron/cache
|
||||
version: 56173531277692bc2925924d51fda1cd0a6b8178
|
||||
subpackages:
|
||||
- memcache
|
||||
- redis
|
||||
- name: github.com/go-macaron/captcha
|
||||
version: 8aa5919789ab301e865595eb4b1114d6b9847deb
|
||||
- name: github.com/go-macaron/csrf
|
||||
version: 6a9a7df172cc1fcd81e4585f44b09200b6087cc0
|
||||
- name: github.com/go-macaron/gzip
|
||||
version: cad1c6580a07c56f5f6bc52d66002a05985c5854
|
||||
- name: github.com/go-macaron/i18n
|
||||
version: d2d3329f13b52314f3292c4cecb601fad13f02c8
|
||||
- name: github.com/go-macaron/inject
|
||||
version: c5ab7bf3a307593cd44cb272d1a5beea473dd072
|
||||
- name: github.com/go-macaron/session
|
||||
version: 66031fcb37a0fff002a1f028eb0b3a815c78306b
|
||||
subpackages:
|
||||
- redis
|
||||
- name: github.com/go-macaron/toolbox
|
||||
version: 82b511550b0aefc36b3a28062ad3a52e812bee38
|
||||
- name: github.com/go-sql-driver/mysql
|
||||
version: 66312f7fe2678aa0f5ec770f96702f4c4ec5aa8e
|
||||
- name: github.com/go-xorm/core
|
||||
version: 502158401cde814951eae62f064d9e5ff39e13ce
|
||||
- name: github.com/go-xorm/xorm
|
||||
version: 769f6b3ae663248e8f1b1d8fecbe1eb26ac77ac7
|
||||
- name: github.com/gogits/chardet
|
||||
version: 2404f777256163ea3eadb273dada5dcb037993c0
|
||||
- name: github.com/gogits/cron
|
||||
version: 3abc0f88f2062336bcc41b43a4febbd847a390ce
|
||||
- name: github.com/gogits/git-module
|
||||
version: 76e8cce6c7ef3ba1cf75752261c721ebf14cd129
|
||||
- name: github.com/gogits/go-gogs-client
|
||||
version: 788ec59749df076b98e208909b44fdef02779deb
|
||||
- name: github.com/issue9/identicon
|
||||
version: f8c0d2ce04db79c663b1da33d3a9f62be753ee88
|
||||
- name: github.com/kardianos/minwinsvc
|
||||
version: cad6b2b879b0970e4245a20ebf1a81a756e2bb70
|
||||
- name: github.com/klauspost/compress
|
||||
version: 006acde2c5d283d2f8b8aa03d8f0cd2891c680cf
|
||||
subpackages:
|
||||
- gzip
|
||||
- flate
|
||||
- name: github.com/klauspost/cpuid
|
||||
version: 09cded8978dc9e80714c4d85b0322337b0a1e5e0
|
||||
- name: github.com/klauspost/crc32
|
||||
version: 19b0b332c9e4516a6370a0456e6182c3b5036720
|
||||
- name: github.com/lib/pq
|
||||
version: 165a3529e799da61ab10faed1fabff3662d6193f
|
||||
subpackages:
|
||||
- oid
|
||||
- name: github.com/mattn/go-sqlite3
|
||||
version: 76e335f60bbcee20755df9864f0153af1a80ad2d
|
||||
- name: github.com/mcuadros/go-version
|
||||
version: d52711f8d6bea8dc01efafdb68ad95a4e2606630
|
||||
- name: github.com/microcosm-cc/bluemonday
|
||||
version: 4ac6f27528d0a3f2a59e0b0a6f6b3ff0bb89fe20
|
||||
- name: github.com/msteinert/pam
|
||||
version: 02ccfbfaf0cc627aa3aec8ef7ed5cfeec5b43f63
|
||||
- name: github.com/nfnt/resize
|
||||
version: 4d93a29130b1b6aba503e2aa8b50f516213ea80e
|
||||
- name: github.com/russross/blackfriday
|
||||
version: b43df972fb5fdf3af8d2e90f38a69d374fe26dd0
|
||||
- name: github.com/satori/go.uuid
|
||||
version: e673fdd4dea8a7334adbbe7f57b7e4b00bdc5502
|
||||
- name: github.com/sergi/go-diff
|
||||
version: ec7fdbb58eb3e300c8595ad5ac74a5aa50019cc7
|
||||
subpackages:
|
||||
- diffmatchpatch
|
||||
- name: github.com/shurcooL/sanitized_anchor_name
|
||||
version: 10ef21a441db47d8b13ebcc5fd2310f636973c77
|
||||
- name: github.com/Unknwon/cae
|
||||
version: 7f5e046bc8a6c3cde743c233b96ee4fd84ee6ecd
|
||||
subpackages:
|
||||
- zip
|
||||
- name: github.com/Unknwon/com
|
||||
version: 28b053d5a2923b87ce8c5a08f3af779894a72758
|
||||
- name: github.com/Unknwon/i18n
|
||||
version: 3b48b6662051bed72d36efa3c1e897bdf96b2e37
|
||||
- name: github.com/Unknwon/paginater
|
||||
version: 7748a72e01415173a27d79866b984328e7b0c12b
|
||||
- name: golang.org/x/crypto
|
||||
version: c197bcf24cde29d3f73c7b4ac6fd41f4384e8af6
|
||||
subpackages:
|
||||
- ssh
|
||||
- curve25519
|
||||
- name: golang.org/x/net
|
||||
version: 35b06af0720201bc2f326773a80767387544f8c4
|
||||
subpackages:
|
||||
- html
|
||||
- html/charset
|
||||
- html/atom
|
||||
- name: golang.org/x/sys
|
||||
version: 9d4e42a20653790449273b3c85e67d6d8bae6e2e
|
||||
subpackages:
|
||||
- windows/svc
|
||||
- windows
|
||||
- name: golang.org/x/text
|
||||
version: 1b466db55e0ba5d56ef5315c728216b42f796491
|
||||
subpackages:
|
||||
- transform
|
||||
- encoding
|
||||
- encoding/charmap
|
||||
- encoding/htmlindex
|
||||
- encoding/internal/identifier
|
||||
- encoding/internal
|
||||
- encoding/japanese
|
||||
- encoding/korean
|
||||
- encoding/simplifiedchinese
|
||||
- encoding/traditionalchinese
|
||||
- encoding/unicode
|
||||
- language
|
||||
- internal/utf8internal
|
||||
- runes
|
||||
- internal/tag
|
||||
- name: gopkg.in/alexcesaro/quotedprintable.v3
|
||||
version: 2caba252f4dc53eaf6b553000885530023f54623
|
||||
- name: gopkg.in/asn1-ber.v1
|
||||
version: 4e86f4367175e39f69d9358a5f17b4dda270378d
|
||||
- name: gopkg.in/bufio.v1
|
||||
version: 567b2bfa514e796916c4747494d6ff5132a1dfce
|
||||
- name: gopkg.in/gomail.v2
|
||||
version: 060a5f4e98dbf37408cf0c745681e4001d877827
|
||||
- name: gopkg.in/ini.v1
|
||||
version: 776aa739ce9373377cd16f526cdf06cb4c89b40f
|
||||
- name: gopkg.in/ldap.v2
|
||||
version: 07a7330929b9ee80495c88a4439657d89c7dbd87
|
||||
- name: gopkg.in/macaron.v1
|
||||
version: 94a5ef7105036242f79e5e07a8eb8651d06c8533
|
||||
- name: gopkg.in/redis.v2
|
||||
version: e6179049628164864e6e84e973cfb56335748dea
|
||||
devImports: []
|
||||
56
glide.yaml
Normal file
56
glide.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
package: github.com/gogits/gogs
|
||||
import:
|
||||
- package: github.com/Unknwon/cae
|
||||
subpackages:
|
||||
- zip
|
||||
- package: github.com/Unknwon/com
|
||||
- package: github.com/Unknwon/i18n
|
||||
- package: github.com/Unknwon/paginater
|
||||
- package: github.com/codegangsta/cli
|
||||
- package: github.com/go-macaron/binding
|
||||
- package: github.com/go-macaron/cache
|
||||
subpackages:
|
||||
- memcache
|
||||
- redis
|
||||
- package: github.com/go-macaron/captcha
|
||||
- package: github.com/go-macaron/csrf
|
||||
- package: github.com/go-macaron/gzip
|
||||
- package: github.com/go-macaron/i18n
|
||||
- package: github.com/go-macaron/session
|
||||
subpackages:
|
||||
- redis
|
||||
- package: github.com/go-macaron/toolbox
|
||||
- package: github.com/go-sql-driver/mysql
|
||||
- package: github.com/go-xorm/core
|
||||
- package: github.com/go-xorm/xorm
|
||||
- package: github.com/gogits/chardet
|
||||
- package: github.com/gogits/cron
|
||||
- package: github.com/gogits/git-module
|
||||
- package: github.com/gogits/go-gogs-client
|
||||
- package: github.com/issue9/identicon
|
||||
- package: github.com/kardianos/minwinsvc
|
||||
- package: github.com/lib/pq
|
||||
- package: github.com/mattn/go-sqlite3
|
||||
- package: github.com/mcuadros/go-version
|
||||
- package: github.com/microcosm-cc/bluemonday
|
||||
- package: github.com/msteinert/pam
|
||||
- package: github.com/nfnt/resize
|
||||
- package: github.com/russross/blackfriday
|
||||
- package: github.com/satori/go.uuid
|
||||
- package: github.com/sergi/go-diff
|
||||
subpackages:
|
||||
- diffmatchpatch
|
||||
- package: golang.org/x/crypto
|
||||
subpackages:
|
||||
- ssh
|
||||
- package: golang.org/x/net
|
||||
subpackages:
|
||||
- html
|
||||
- html/charset
|
||||
- package: golang.org/x/text
|
||||
subpackages:
|
||||
- transform
|
||||
- package: gopkg.in/gomail.v2
|
||||
- package: gopkg.in/ini.v1
|
||||
- package: gopkg.in/ldap.v2
|
||||
- package: gopkg.in/macaron.v1
|
||||
2
gogs.go
2
gogs.go
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.9.0.0306"
|
||||
const APP_VER = "0.9.13.0318"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
||||
@@ -110,7 +110,7 @@ func (u *User) GetAccessibleRepositories() ([]*Repository, error) {
|
||||
repoIDs = append(repoIDs, access.RepoID)
|
||||
}
|
||||
repos := make([]*Repository, 0, len(repoIDs))
|
||||
return repos, x.Where("owner_id != ?", u.Id).In("id", repoIDs).Desc("updated").Find(&repos)
|
||||
return repos, x.Where("owner_id != ?", u.Id).In("id", repoIDs).Desc("updated_unix").Find(&repos)
|
||||
}
|
||||
|
||||
func maxAccessMode(modes ...AccessMode) AccessMode {
|
||||
|
||||
@@ -84,13 +84,18 @@ type Action struct {
|
||||
RefName string
|
||||
IsPrivate bool `xorm:"NOT NULL DEFAULT false"`
|
||||
Content string `xorm:"TEXT"`
|
||||
Created time.Time `xorm:"created"`
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (a *Action) BeforeInsert() {
|
||||
a.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (a *Action) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created":
|
||||
a.Created = regulateTimeZone(a.Created)
|
||||
case "created_unix":
|
||||
a.Created = time.Unix(a.CreatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/go-xorm/xorm"
|
||||
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
@@ -29,7 +30,19 @@ type Notice struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Type NoticeType
|
||||
Description string `xorm:"TEXT"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (n *Notice) BeforeInsert() {
|
||||
n.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (n *Notice) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created_unix":
|
||||
n.Created = time.Unix(n.CreatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
// TrStr returns a translation format string.
|
||||
|
||||
168
models/issue.go
168
models/issue.go
@@ -52,14 +52,28 @@ type Issue struct {
|
||||
RenderedContent string `xorm:"-"`
|
||||
Priority int
|
||||
NumComments int
|
||||
Deadline time.Time
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
|
||||
Deadline time.Time `xorm:"-"`
|
||||
DeadlineUnix int64
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
|
||||
Attachments []*Attachment `xorm:"-"`
|
||||
Comments []*Comment `xorm:"-"`
|
||||
}
|
||||
|
||||
func (i *Issue) BeforeInsert() {
|
||||
i.CreatedUnix = time.Now().UTC().Unix()
|
||||
i.UpdatedUnix = i.CreatedUnix
|
||||
}
|
||||
|
||||
func (i *Issue) BeforeUpdate() {
|
||||
i.UpdatedUnix = time.Now().UTC().Unix()
|
||||
i.DeadlineUnix = i.Deadline.UTC().Unix()
|
||||
}
|
||||
|
||||
func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
|
||||
var err error
|
||||
switch colName {
|
||||
@@ -74,6 +88,23 @@ func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
|
||||
log.Error(3, "GetCommentsByIssueID[%d]: %v", i.ID, err)
|
||||
}
|
||||
|
||||
i.Labels, err = GetLabelsByIssueID(i.ID)
|
||||
if err != nil {
|
||||
log.Error(3, "GetLabelsByIssueID[%d]: %v", i.ID, err)
|
||||
}
|
||||
|
||||
case "poster_id":
|
||||
i.Poster, err = GetUserByID(i.PosterID)
|
||||
if err != nil {
|
||||
if IsErrUserNotExist(err) {
|
||||
i.PosterID = -1
|
||||
i.Poster = NewFakeUser()
|
||||
} else {
|
||||
log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
case "milestone_id":
|
||||
if i.MilestoneID == 0 {
|
||||
return
|
||||
@@ -83,6 +114,7 @@ func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
|
||||
if err != nil {
|
||||
log.Error(3, "GetMilestoneById[%d]: %v", i.ID, err)
|
||||
}
|
||||
|
||||
case "assignee_id":
|
||||
if i.AssigneeID == 0 {
|
||||
return
|
||||
@@ -92,8 +124,13 @@ func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
|
||||
if err != nil {
|
||||
log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
|
||||
}
|
||||
case "created":
|
||||
i.Created = regulateTimeZone(i.Created)
|
||||
|
||||
case "deadline_unix":
|
||||
i.Deadline = time.Unix(i.DeadlineUnix, 0).Local()
|
||||
case "created_unix":
|
||||
i.Created = time.Unix(i.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
i.Updated = time.Unix(i.UpdatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,21 +139,19 @@ func (i *Issue) HashTag() string {
|
||||
return "issue-" + com.ToStr(i.ID)
|
||||
}
|
||||
|
||||
// State returns string representation of issue status.
|
||||
func (i *Issue) State() string {
|
||||
if i.IsClosed {
|
||||
return "closed"
|
||||
}
|
||||
return "open"
|
||||
}
|
||||
|
||||
// IsPoster returns true if given user by ID is the poster.
|
||||
func (i *Issue) IsPoster(uid int64) bool {
|
||||
return i.PosterID == uid
|
||||
}
|
||||
|
||||
func (i *Issue) GetPoster() (err error) {
|
||||
i.Poster, err = GetUserByID(i.PosterID)
|
||||
if IsErrUserNotExist(err) {
|
||||
i.PosterID = -1
|
||||
i.Poster = NewFakeUser()
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (i *Issue) hasLabel(e Engine, labelID int64) bool {
|
||||
return hasIssueLabel(e, i.ID, labelID)
|
||||
}
|
||||
@@ -157,11 +192,6 @@ func (i *Issue) getLabels(e Engine) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetLabels retrieves all labels of issue and assign to corresponding field.
|
||||
func (i *Issue) GetLabels() error {
|
||||
return i.getLabels(x)
|
||||
}
|
||||
|
||||
func (i *Issue) removeLabel(e *xorm.Session, label *Label) error {
|
||||
return deleteIssueLabel(e, i, label)
|
||||
}
|
||||
@@ -285,6 +315,19 @@ func (i *Issue) GetPullRequest() (err error) {
|
||||
|
||||
// It's caller's responsibility to create action.
|
||||
func newIssue(e *xorm.Session, repo *Repository, issue *Issue, labelIDs []int64, uuids []string, isPull bool) (err error) {
|
||||
issue.Name = strings.TrimSpace(issue.Name)
|
||||
issue.Index = repo.NextIssueIndex()
|
||||
|
||||
if issue.AssigneeID > 0 {
|
||||
// Silently drop invalid assignee
|
||||
valid, err := hasAccess(e, &User{Id: issue.AssigneeID}, repo, ACCESS_MODE_WRITE)
|
||||
if err != nil {
|
||||
return fmt.Errorf("hasAccess: %v", err)
|
||||
} else if !valid {
|
||||
issue.AssigneeID = 0
|
||||
}
|
||||
}
|
||||
|
||||
if _, err = e.Insert(issue); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -307,6 +350,10 @@ func newIssue(e *xorm.Session, repo *Repository, issue *Issue, labelIDs []int64,
|
||||
}
|
||||
|
||||
for _, label := range labels {
|
||||
if label.RepoID != repo.ID {
|
||||
continue
|
||||
}
|
||||
|
||||
if err = issue.addLabel(e, label); err != nil {
|
||||
return fmt.Errorf("addLabel: %v", err)
|
||||
}
|
||||
@@ -359,6 +406,10 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
|
||||
return fmt.Errorf("newIssue: %v", err)
|
||||
}
|
||||
|
||||
if err = sess.Commit(); err != nil {
|
||||
return fmt.Errorf("Commit: %v", err)
|
||||
}
|
||||
|
||||
// Notify watchers.
|
||||
act := &Action{
|
||||
ActUserID: issue.Poster.Id,
|
||||
@@ -371,11 +422,11 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
|
||||
RepoName: repo.Name,
|
||||
IsPrivate: repo.IsPrivate,
|
||||
}
|
||||
if err = notifyWatchers(sess, act); err != nil {
|
||||
return err
|
||||
if err = NotifyWatchers(act); err != nil {
|
||||
log.Error(4, "notifyWatchers: %v", err)
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetIssueByRef returns an Issue specified by a GFM reference.
|
||||
@@ -449,6 +500,10 @@ type IssuesOptions struct {
|
||||
|
||||
// Issues returns a list of issues by given conditions.
|
||||
func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
||||
if opts.Page <= 0 {
|
||||
opts.Page = 1
|
||||
}
|
||||
|
||||
sess := x.Limit(setting.IssuePagingNum, (opts.Page-1)*setting.IssuePagingNum)
|
||||
|
||||
if opts.RepoID > 0 {
|
||||
@@ -477,11 +532,11 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
||||
|
||||
switch opts.SortType {
|
||||
case "oldest":
|
||||
sess.Asc("created")
|
||||
sess.Asc("created_unix")
|
||||
case "recentupdate":
|
||||
sess.Desc("updated")
|
||||
sess.Desc("updated_unix")
|
||||
case "leastupdate":
|
||||
sess.Asc("updated")
|
||||
sess.Asc("updated_unix")
|
||||
case "mostcomment":
|
||||
sess.Desc("num_comments")
|
||||
case "leastcomment":
|
||||
@@ -489,7 +544,7 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
||||
case "priority":
|
||||
sess.Desc("priority")
|
||||
default:
|
||||
sess.Desc("created")
|
||||
sess.Desc("created_unix")
|
||||
}
|
||||
|
||||
labelIDs := base.StringsToInt64s(strings.Split(opts.Labels, ","))
|
||||
@@ -951,12 +1006,19 @@ type Milestone struct {
|
||||
IsClosed bool
|
||||
NumIssues int
|
||||
NumClosedIssues int
|
||||
NumOpenIssues int `xorm:"-"`
|
||||
Completeness int // Percentage(1-100).
|
||||
Deadline time.Time
|
||||
DeadlineString string `xorm:"-"`
|
||||
IsOverDue bool `xorm:"-"`
|
||||
ClosedDate time.Time
|
||||
NumOpenIssues int `xorm:"-"`
|
||||
Completeness int // Percentage(1-100).
|
||||
IsOverDue bool `xorm:"-"`
|
||||
|
||||
DeadlineString string `xorm:"-"`
|
||||
Deadline time.Time `xorm:"-"`
|
||||
DeadlineUnix int64
|
||||
ClosedDate time.Time `xorm:"-"`
|
||||
ClosedDateUnix int64
|
||||
}
|
||||
|
||||
func (m *Milestone) BeforeInsert() {
|
||||
m.DeadlineUnix = m.Deadline.UTC().Unix()
|
||||
}
|
||||
|
||||
func (m *Milestone) BeforeUpdate() {
|
||||
@@ -965,25 +1027,38 @@ func (m *Milestone) BeforeUpdate() {
|
||||
} else {
|
||||
m.Completeness = 0
|
||||
}
|
||||
|
||||
m.DeadlineUnix = m.Deadline.UTC().Unix()
|
||||
m.ClosedDateUnix = m.ClosedDate.UTC().Unix()
|
||||
}
|
||||
|
||||
func (m *Milestone) AfterSet(colName string, _ xorm.Cell) {
|
||||
if colName == "deadline" {
|
||||
switch colName {
|
||||
case "num_closed_issues":
|
||||
m.NumOpenIssues = m.NumIssues - m.NumClosedIssues
|
||||
|
||||
case "deadline_unix":
|
||||
m.Deadline = time.Unix(m.DeadlineUnix, 0).Local()
|
||||
if m.Deadline.Year() == 9999 {
|
||||
return
|
||||
}
|
||||
m.Deadline = regulateTimeZone(m.Deadline)
|
||||
|
||||
m.DeadlineString = m.Deadline.Format("2006-01-02")
|
||||
if time.Now().After(m.Deadline) {
|
||||
if time.Now().Local().After(m.Deadline) {
|
||||
m.IsOverDue = true
|
||||
}
|
||||
|
||||
case "closed_date_unix":
|
||||
m.ClosedDate = time.Unix(m.ClosedDateUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
// CalOpenIssues calculates the open issues of milestone.
|
||||
func (m *Milestone) CalOpenIssues() {
|
||||
m.NumOpenIssues = m.NumIssues - m.NumClosedIssues
|
||||
// State returns string representation of milestone status.
|
||||
func (m *Milestone) State() string {
|
||||
if m.IsClosed {
|
||||
return "closed"
|
||||
}
|
||||
return "open"
|
||||
}
|
||||
|
||||
// NewMilestone creates new milestone of repository.
|
||||
@@ -1252,7 +1327,20 @@ type Attachment struct {
|
||||
CommentID int64
|
||||
ReleaseID int64 `xorm:"INDEX"`
|
||||
Name string
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (a *Attachment) BeforeInsert() {
|
||||
a.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (a *Attachment) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created_unix":
|
||||
a.Created = time.Unix(a.CreatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
// AttachmentLocalPath returns where attachment is stored in local file system based on given UUID.
|
||||
|
||||
@@ -52,9 +52,11 @@ type Comment struct {
|
||||
IssueID int64 `xorm:"INDEX"`
|
||||
CommitID int64
|
||||
Line int64
|
||||
Content string `xorm:"TEXT"`
|
||||
RenderedContent string `xorm:"-"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Content string `xorm:"TEXT"`
|
||||
RenderedContent string `xorm:"-"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
|
||||
// Reference issue in commit message
|
||||
CommitSHA string `xorm:"VARCHAR(40)"`
|
||||
@@ -65,6 +67,10 @@ type Comment struct {
|
||||
ShowTag CommentTag `xorm:"-"`
|
||||
}
|
||||
|
||||
func (c *Comment) BeforeInsert() {
|
||||
c.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (c *Comment) AfterSet(colName string, _ xorm.Cell) {
|
||||
var err error
|
||||
switch colName {
|
||||
@@ -84,8 +90,8 @@ func (c *Comment) AfterSet(colName string, _ xorm.Cell) {
|
||||
log.Error(3, "GetUserByID[%d]: %v", c.ID, err)
|
||||
}
|
||||
}
|
||||
case "created":
|
||||
c.Created = regulateTimeZone(c.Created)
|
||||
case "created_unix":
|
||||
c.Created = time.Unix(c.CreatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,9 +202,11 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
|
||||
}
|
||||
}
|
||||
|
||||
// Notify watchers for whatever action comes in
|
||||
if err = notifyWatchers(e, act); err != nil {
|
||||
return nil, fmt.Errorf("notifyWatchers: %v", err)
|
||||
// Notify watchers for whatever action comes in, ignore if no action type
|
||||
if act.OpType > 0 {
|
||||
if err = notifyWatchers(e, act); err != nil {
|
||||
return nil, fmt.Errorf("notifyWatchers: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return comment, nil
|
||||
@@ -302,7 +310,7 @@ func GetCommentByID(id int64) (*Comment, error) {
|
||||
// GetCommentsByIssueID returns all comments of issue by given ID.
|
||||
func GetCommentsByIssueID(issueID int64) ([]*Comment, error) {
|
||||
comments := make([]*Comment, 0, 10)
|
||||
return comments, x.Where("issue_id=?", issueID).Asc("created").Find(&comments)
|
||||
return comments, x.Where("issue_id=?", issueID).Asc("created_unix").Find(&comments)
|
||||
}
|
||||
|
||||
// UpdateComment updates information of comment.
|
||||
|
||||
@@ -101,8 +101,20 @@ type LoginSource struct {
|
||||
Name string `xorm:"UNIQUE"`
|
||||
IsActived bool `xorm:"NOT NULL DEFAULT false"`
|
||||
Cfg core.Conversion `xorm:"TEXT"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (s *LoginSource) BeforeInsert() {
|
||||
s.CreatedUnix = time.Now().UTC().Unix()
|
||||
s.UpdatedUnix = s.CreatedUnix
|
||||
}
|
||||
|
||||
func (s *LoginSource) BeforeUpdate() {
|
||||
s.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
// Cell2Int64 converts a xorm.Cell type to int64,
|
||||
@@ -132,6 +144,15 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *LoginSource) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created_unix":
|
||||
s.Created = time.Unix(s.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
s.Updated = time.Unix(s.UpdatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
func (source *LoginSource) TypeName() string {
|
||||
return LoginNames[source.Type]
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/go-xorm/xorm"
|
||||
@@ -65,6 +66,7 @@ var migrations = []Migration{
|
||||
NewMigration("rename pull request fields", renamePullRequestFields), // V8 -> V9:v0.6.16
|
||||
NewMigration("clean up migrate repo info", cleanUpMigrateRepoInfo), // V9 -> V10:v0.6.20
|
||||
NewMigration("generate rands and salt for organizations", generateOrgRandsAndSalt), // V10 -> V11:v0.8.5
|
||||
NewMigration("convert date to unix timestamp", convertDateToUnix), // V11 -> V12:v0.9.2
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
@@ -453,3 +455,221 @@ func generateOrgRandsAndSalt(x *xorm.Engine) (err error) {
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
type TAction struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TAction) TableName() string { return "action" }
|
||||
|
||||
type TNotice struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TNotice) TableName() string { return "notice" }
|
||||
|
||||
type TComment struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TComment) TableName() string { return "comment" }
|
||||
|
||||
type TIssue struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
DeadlineUnix int64
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TIssue) TableName() string { return "issue" }
|
||||
|
||||
type TMilestone struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
DeadlineUnix int64
|
||||
ClosedDateUnix int64
|
||||
}
|
||||
|
||||
func (t *TMilestone) TableName() string { return "milestone" }
|
||||
|
||||
type TAttachment struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TAttachment) TableName() string { return "attachment" }
|
||||
|
||||
type TLoginSource struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TLoginSource) TableName() string { return "login_source" }
|
||||
|
||||
type TPull struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
MergedUnix int64
|
||||
}
|
||||
|
||||
func (t *TPull) TableName() string { return "pull_request" }
|
||||
|
||||
type TRelease struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TRelease) TableName() string { return "release" }
|
||||
|
||||
type TRepo struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TRepo) TableName() string { return "repository" }
|
||||
|
||||
type TMirror struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UpdatedUnix int64
|
||||
NextUpdateUnix int64
|
||||
}
|
||||
|
||||
func (t *TMirror) TableName() string { return "mirror" }
|
||||
|
||||
type TPublicKey struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TPublicKey) TableName() string { return "public_key" }
|
||||
|
||||
type TDeployKey struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TDeployKey) TableName() string { return "deploy_key" }
|
||||
|
||||
type TAccessToken struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TAccessToken) TableName() string { return "access_token" }
|
||||
|
||||
type TUser struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TUser) TableName() string { return "user" }
|
||||
|
||||
type TWebhook struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
CreatedUnix int64
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (t *TWebhook) TableName() string { return "webhook" }
|
||||
|
||||
func convertDateToUnix(x *xorm.Engine) (err error) {
|
||||
type Bean struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Created time.Time
|
||||
Updated time.Time
|
||||
Merged time.Time
|
||||
Deadline time.Time
|
||||
ClosedDate time.Time
|
||||
NextUpdate time.Time
|
||||
}
|
||||
|
||||
var tables = []struct {
|
||||
name string
|
||||
cols []string
|
||||
bean interface{}
|
||||
}{
|
||||
{"action", []string{"created"}, new(TAction)},
|
||||
{"notice", []string{"created"}, new(TNotice)},
|
||||
{"comment", []string{"created"}, new(TComment)},
|
||||
{"issue", []string{"deadline", "created", "updated"}, new(TIssue)},
|
||||
{"milestone", []string{"deadline", "closed_date"}, new(TMilestone)},
|
||||
{"attachment", []string{"created"}, new(TAttachment)},
|
||||
{"login_source", []string{"created", "updated"}, new(TLoginSource)},
|
||||
{"pull_request", []string{"merged"}, new(TPull)},
|
||||
{"release", []string{"created"}, new(TRelease)},
|
||||
{"repository", []string{"created", "updated"}, new(TRepo)},
|
||||
{"mirror", []string{"updated", "next_update"}, new(TMirror)},
|
||||
{"public_key", []string{"created", "updated"}, new(TPublicKey)},
|
||||
{"deploy_key", []string{"created", "updated"}, new(TDeployKey)},
|
||||
{"access_token", []string{"created", "updated"}, new(TAccessToken)},
|
||||
{"user", []string{"created", "updated"}, new(TUser)},
|
||||
{"webhook", []string{"created", "updated"}, new(TWebhook)},
|
||||
}
|
||||
|
||||
for _, table := range tables {
|
||||
log.Info("Converting table: %s", table.name)
|
||||
if err = x.Sync2(table.bean); err != nil {
|
||||
return fmt.Errorf("Sync [table: %s]: %v", table.name, err)
|
||||
}
|
||||
|
||||
offset := 0
|
||||
for {
|
||||
beans := make([]*Bean, 0, 100)
|
||||
if err = x.Sql(fmt.Sprintf("SELECT * FROM `%s` ORDER BY id ASC LIMIT 100 OFFSET %d",
|
||||
table.name, offset)).Find(&beans); err != nil {
|
||||
return fmt.Errorf("select beans [table: %s, offset: %d]: %v", table.name, offset, err)
|
||||
}
|
||||
log.Trace("Table [%s]: offset: %d, beans: %d", table.name, offset, len(beans))
|
||||
if len(beans) == 0 {
|
||||
break
|
||||
}
|
||||
offset += 100
|
||||
|
||||
baseSQL := "UPDATE `" + table.name + "` SET "
|
||||
for _, bean := range beans {
|
||||
valSQLs := make([]string, 0, len(table.cols))
|
||||
for _, col := range table.cols {
|
||||
fieldSQL := ""
|
||||
fieldSQL += col + "_unix = "
|
||||
|
||||
switch col {
|
||||
case "deadline":
|
||||
if bean.Deadline.IsZero() {
|
||||
continue
|
||||
}
|
||||
fieldSQL += com.ToStr(bean.Deadline.UTC().Unix())
|
||||
case "created":
|
||||
fieldSQL += com.ToStr(bean.Created.UTC().Unix())
|
||||
case "updated":
|
||||
fieldSQL += com.ToStr(bean.Updated.UTC().Unix())
|
||||
case "closed_date":
|
||||
fieldSQL += com.ToStr(bean.ClosedDate.UTC().Unix())
|
||||
case "merged":
|
||||
fieldSQL += com.ToStr(bean.Merged.UTC().Unix())
|
||||
case "next_update":
|
||||
fieldSQL += com.ToStr(bean.NextUpdate.UTC().Unix())
|
||||
}
|
||||
|
||||
valSQLs = append(valSQLs, fieldSQL)
|
||||
}
|
||||
|
||||
if len(valSQLs) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
if _, err = x.Exec(baseSQL + strings.Join(valSQLs, ",") + " WHERE id = " + com.ToStr(bean.ID)); err != nil {
|
||||
return fmt.Errorf("update bean [table: %s, id: %d]: %v", table.name, bean.ID, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -11,16 +11,13 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/go-xorm/core"
|
||||
"github.com/go-xorm/xorm"
|
||||
_ "github.com/lib/pq"
|
||||
|
||||
"github.com/gogits/gogs/models/migrations"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
@@ -44,27 +41,6 @@ func sessionRelease(sess *xorm.Session) {
|
||||
sess.Close()
|
||||
}
|
||||
|
||||
// Note: get back time.Time from database Go sees it at UTC where they are really Local.
|
||||
// So this function makes correct timezone offset.
|
||||
func regulateTimeZone(t time.Time) time.Time {
|
||||
if !setting.UseMySQL {
|
||||
return t
|
||||
}
|
||||
|
||||
zone := t.Local().Format("-0700")
|
||||
if len(zone) != 5 {
|
||||
log.Error(4, "Unprocessable timezone: %s - %s", t.Local(), zone)
|
||||
return t
|
||||
}
|
||||
hour := com.StrTo(zone[2:3]).MustInt()
|
||||
minutes := com.StrTo(zone[3:5]).MustInt()
|
||||
|
||||
if zone[0] == '-' {
|
||||
return t.Add(time.Duration(hour) * time.Hour).Add(time.Duration(minutes) * time.Minute)
|
||||
}
|
||||
return t.Add(-1 * time.Duration(hour) * time.Hour).Add(-1 * time.Duration(minutes) * time.Minute)
|
||||
}
|
||||
|
||||
var (
|
||||
x *xorm.Engine
|
||||
tables []interface{}
|
||||
|
||||
@@ -169,7 +169,7 @@ func GetOrgByName(name string) (*User, error) {
|
||||
}
|
||||
u := &User{
|
||||
LowerName: strings.ToLower(name),
|
||||
Type: ORGANIZATION,
|
||||
Type: USER_TYPE_ORGANIZATION,
|
||||
}
|
||||
has, err := x.Get(u)
|
||||
if err != nil {
|
||||
@@ -1071,11 +1071,10 @@ WHERE team_user.org_id = ? AND team_user.uid = ?`, org.Id, userID).Find(&teams);
|
||||
}
|
||||
|
||||
repos := make([]*Repository, 0, 5)
|
||||
if err = x.Sql(`SELECT repository.* FROM repository
|
||||
if err = x.Sql(fmt.Sprintf(`SELECT repository.* FROM repository
|
||||
INNER JOIN team_repo ON team_repo.repo_id = repository.id
|
||||
WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (?)
|
||||
GROUP BY repository.id`,
|
||||
org.Id, false, strings.Join(teamIDs, ",")).Find(&repos); err != nil {
|
||||
WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (%s)
|
||||
GROUP BY repository.id`, strings.Join(teamIDs, ",")), org.Id, false).Find(&repos); err != nil {
|
||||
return fmt.Errorf("get repositories: %v", err)
|
||||
}
|
||||
org.Repos = repos
|
||||
|
||||
@@ -58,20 +58,25 @@ type PullRequest struct {
|
||||
|
||||
HasMerged bool
|
||||
MergedCommitID string `xorm:"VARCHAR(40)"`
|
||||
Merged time.Time
|
||||
MergerID int64
|
||||
Merger *User `xorm:"-"`
|
||||
Merger *User `xorm:"-"`
|
||||
Merged time.Time `xorm:"-"`
|
||||
MergedUnix int64
|
||||
}
|
||||
|
||||
func (pr *PullRequest) BeforeUpdate() {
|
||||
pr.MergedUnix = pr.Merged.UTC().Unix()
|
||||
}
|
||||
|
||||
// Note: don't try to get Pull because will end up recursive querying.
|
||||
func (pr *PullRequest) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "merged":
|
||||
case "merged_unix":
|
||||
if !pr.HasMerged {
|
||||
return
|
||||
}
|
||||
|
||||
pr.Merged = regulateTimeZone(pr.Merged)
|
||||
pr.Merged = time.Unix(pr.MergedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,13 +33,19 @@ type Release struct {
|
||||
Note string `xorm:"TEXT"`
|
||||
IsDraft bool `xorm:"NOT NULL DEFAULT false"`
|
||||
IsPrerelease bool
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
}
|
||||
|
||||
func (r *Release) BeforeInsert() {
|
||||
r.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (r *Release) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created":
|
||||
r.Created = regulateTimeZone(r.Created)
|
||||
case "created_unix":
|
||||
r.Created = time.Unix(r.CreatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +131,7 @@ func GetReleaseByID(id int64) (*Release, error) {
|
||||
|
||||
// GetReleasesByRepoID returns a list of releases of repository.
|
||||
func GetReleasesByRepoID(repoID int64) (rels []*Release, err error) {
|
||||
err = x.Desc("created").Find(&rels, Release{RepoID: repoID})
|
||||
err = x.Desc("created_unix").Find(&rels, Release{RepoID: repoID})
|
||||
return rels, err
|
||||
}
|
||||
|
||||
|
||||
127
models/repo.go
127
models/repo.go
@@ -178,8 +178,19 @@ type Repository struct {
|
||||
ForkID int64
|
||||
BaseRepo *Repository `xorm:"-"`
|
||||
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (repo *Repository) BeforeInsert() {
|
||||
repo.CreatedUnix = time.Now().UTC().Unix()
|
||||
repo.UpdatedUnix = repo.CreatedUnix
|
||||
}
|
||||
|
||||
func (repo *Repository) BeforeUpdate() {
|
||||
repo.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
|
||||
@@ -195,8 +206,10 @@ func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
|
||||
repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
|
||||
case "num_closed_milestones":
|
||||
repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
|
||||
case "updated":
|
||||
repo.Updated = regulateTimeZone(repo.Updated)
|
||||
case "created_unix":
|
||||
repo.Created = time.Unix(repo.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
repo.Updated = time.Unix(repo.UpdatedUnix, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,16 +536,28 @@ func IsUsableName(name string) error {
|
||||
|
||||
// Mirror represents a mirror information of repository.
|
||||
type Mirror struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64
|
||||
Repo *Repository `xorm:"-"`
|
||||
Interval int // Hour.
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
NextUpdate time.Time
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64
|
||||
Repo *Repository `xorm:"-"`
|
||||
Interval int // Hour.
|
||||
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
NextUpdate time.Time `xorm:"-"`
|
||||
NextUpdateUnix int64
|
||||
|
||||
address string `xorm:"-"`
|
||||
}
|
||||
|
||||
func (m *Mirror) BeforeInsert() {
|
||||
m.NextUpdateUnix = m.NextUpdate.UTC().Unix()
|
||||
}
|
||||
|
||||
func (m *Mirror) BeforeUpdate() {
|
||||
m.UpdatedUnix = time.Now().UTC().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.UTC().Unix()
|
||||
}
|
||||
|
||||
func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
|
||||
var err error
|
||||
switch colName {
|
||||
@@ -541,6 +566,10 @@ func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
|
||||
if err != nil {
|
||||
log.Error(3, "GetRepositoryByID[%d]: %v", m.ID, err)
|
||||
}
|
||||
case "updated_unix":
|
||||
m.Updated = time.Unix(m.UpdatedUnix, 0).Local()
|
||||
case "next_updated_unix":
|
||||
m.NextUpdate = time.Unix(m.NextUpdateUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1020,11 +1049,16 @@ func CountPublicRepositories() int64 {
|
||||
return countRepositories(false)
|
||||
}
|
||||
|
||||
func Repositories(page, pageSize int) (_ []*Repository, err error) {
|
||||
repos := make([]*Repository, 0, pageSize)
|
||||
return repos, x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos)
|
||||
}
|
||||
|
||||
// RepositoriesWithUsers returns number of repos in given page.
|
||||
func RepositoriesWithUsers(page, pageSize int) (_ []*Repository, err error) {
|
||||
repos := make([]*Repository, 0, pageSize)
|
||||
if err = x.Limit(pageSize, (page-1)*pageSize).Asc("id").Find(&repos); err != nil {
|
||||
return nil, err
|
||||
repos, err := Repositories(page, pageSize)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Repositories: %v", err)
|
||||
}
|
||||
|
||||
for i := range repos {
|
||||
@@ -1435,7 +1469,8 @@ func GetRepositoryByID(id int64) (*Repository, error) {
|
||||
// GetRepositories returns a list of repositories of given user.
|
||||
func GetRepositories(uid int64, private bool) ([]*Repository, error) {
|
||||
repos := make([]*Repository, 0, 10)
|
||||
sess := x.Desc("updated")
|
||||
sess := x.Desc("updated_unix")
|
||||
|
||||
if !private {
|
||||
sess.Where("is_private=?", false)
|
||||
}
|
||||
@@ -1444,9 +1479,9 @@ func GetRepositories(uid int64, private bool) ([]*Repository, error) {
|
||||
}
|
||||
|
||||
// GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
|
||||
func GetRecentUpdatedRepositories(page int) (repos []*Repository, err error) {
|
||||
return repos, x.Limit(setting.ExplorePagingNum, (page-1)*setting.ExplorePagingNum).
|
||||
Where("is_private=?", false).Limit(setting.ExplorePagingNum).Desc("updated").Find(&repos)
|
||||
func GetRecentUpdatedRepositories(page, pageSize int) (repos []*Repository, err error) {
|
||||
return repos, x.Limit(pageSize, (page-1)*pageSize).
|
||||
Where("is_private=?", false).Limit(pageSize).Desc("updated_unix").Find(&repos)
|
||||
}
|
||||
|
||||
func getRepositoryCount(e Engine, u *User) (int64, error) {
|
||||
@@ -1458,32 +1493,52 @@ func GetRepositoryCount(u *User) (int64, error) {
|
||||
return getRepositoryCount(x, u)
|
||||
}
|
||||
|
||||
type SearchOption struct {
|
||||
Keyword string
|
||||
Uid int64
|
||||
Limit int
|
||||
Private bool
|
||||
type SearchRepoOptions struct {
|
||||
Keyword string
|
||||
OwnerID int64
|
||||
OrderBy string
|
||||
Private bool // Include private repositories in results
|
||||
Page int
|
||||
PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
|
||||
}
|
||||
|
||||
// SearchRepositoryByName returns given number of repositories whose name contains keyword.
|
||||
func SearchRepositoryByName(opt SearchOption) (repos []*Repository, err error) {
|
||||
if len(opt.Keyword) == 0 {
|
||||
return repos, nil
|
||||
// SearchRepositoryByName takes keyword and part of repository name to search,
|
||||
// it returns results in given range and number of total results.
|
||||
func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int64, _ error) {
|
||||
if len(opts.Keyword) == 0 {
|
||||
return repos, 0, nil
|
||||
}
|
||||
opt.Keyword = strings.ToLower(opt.Keyword)
|
||||
opts.Keyword = strings.ToLower(opts.Keyword)
|
||||
|
||||
repos = make([]*Repository, 0, opt.Limit)
|
||||
|
||||
// Append conditions.
|
||||
sess := x.Limit(opt.Limit)
|
||||
if opt.Uid > 0 {
|
||||
sess.Where("owner_id=?", opt.Uid)
|
||||
if opts.PageSize <= 0 || opts.PageSize > setting.ExplorePagingNum {
|
||||
opts.PageSize = setting.ExplorePagingNum
|
||||
}
|
||||
if !opt.Private {
|
||||
if opts.Page <= 0 {
|
||||
opts.Page = 1
|
||||
}
|
||||
|
||||
repos = make([]*Repository, 0, opts.PageSize)
|
||||
|
||||
// Append conditions
|
||||
sess := x.Where("LOWER(lower_name) LIKE ?", "%"+opts.Keyword+"%")
|
||||
if opts.OwnerID > 0 {
|
||||
sess.And("owner_id = ?", opts.OwnerID)
|
||||
}
|
||||
if !opts.Private {
|
||||
sess.And("is_private=?", false)
|
||||
}
|
||||
sess.And("lower_name like ?", "%"+opt.Keyword+"%").Find(&repos)
|
||||
return repos, err
|
||||
|
||||
var countSess xorm.Session
|
||||
countSess = *sess
|
||||
count, err := countSess.Count(new(Repository))
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("Count: %v", err)
|
||||
}
|
||||
|
||||
if len(opts.OrderBy) > 0 {
|
||||
sess.OrderBy(opts.OrderBy)
|
||||
}
|
||||
return repos, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&repos)
|
||||
}
|
||||
|
||||
// DeleteRepositoryArchives deletes all repositories' archives.
|
||||
|
||||
@@ -6,16 +6,14 @@ package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Collaboration represent the relation between an individual and a repository.
|
||||
type Collaboration struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||||
UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||||
Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||||
UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||||
Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"`
|
||||
}
|
||||
|
||||
func (c *Collaboration) ModeName() string {
|
||||
|
||||
@@ -45,22 +45,36 @@ const (
|
||||
|
||||
// PublicKey represents a SSH or deploy key.
|
||||
type PublicKey struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
OwnerID int64 `xorm:"INDEX NOT NULL"`
|
||||
Name string `xorm:"NOT NULL"`
|
||||
Fingerprint string `xorm:"NOT NULL"`
|
||||
Content string `xorm:"TEXT NOT NULL"`
|
||||
Mode AccessMode `xorm:"NOT NULL DEFAULT 2"`
|
||||
Type KeyType `xorm:"NOT NULL DEFAULT 1"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time // Note: Updated must below Created for AfterSet.
|
||||
HasRecentActivity bool `xorm:"-"`
|
||||
HasUsed bool `xorm:"-"`
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
OwnerID int64 `xorm:"INDEX NOT NULL"`
|
||||
Name string `xorm:"NOT NULL"`
|
||||
Fingerprint string `xorm:"NOT NULL"`
|
||||
Content string `xorm:"TEXT NOT NULL"`
|
||||
Mode AccessMode `xorm:"NOT NULL DEFAULT 2"`
|
||||
Type KeyType `xorm:"NOT NULL DEFAULT 1"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"` // Note: Updated must below Created for AfterSet.
|
||||
UpdatedUnix int64
|
||||
HasRecentActivity bool `xorm:"-"`
|
||||
HasUsed bool `xorm:"-"`
|
||||
}
|
||||
|
||||
func (k *PublicKey) BeforeInsert() {
|
||||
k.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (k *PublicKey) BeforeUpdate() {
|
||||
k.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (k *PublicKey) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created":
|
||||
case "created_unix":
|
||||
k.Created = time.Unix(k.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
k.Updated = time.Unix(k.UpdatedUnix, 0).Local()
|
||||
k.HasUsed = k.Updated.After(k.Created)
|
||||
k.HasRecentActivity = k.Updated.Add(7 * 24 * time.Hour).After(time.Now())
|
||||
}
|
||||
@@ -608,21 +622,35 @@ func RewriteAllPublicKeys() error {
|
||||
|
||||
// DeployKey represents deploy key information and its relation with repository.
|
||||
type DeployKey struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
KeyID int64 `xorm:"UNIQUE(s) INDEX"`
|
||||
RepoID int64 `xorm:"UNIQUE(s) INDEX"`
|
||||
Name string
|
||||
Fingerprint string
|
||||
Content string `xorm:"-"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time // Note: Updated must below Created for AfterSet.
|
||||
HasRecentActivity bool `xorm:"-"`
|
||||
HasUsed bool `xorm:"-"`
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
KeyID int64 `xorm:"UNIQUE(s) INDEX"`
|
||||
RepoID int64 `xorm:"UNIQUE(s) INDEX"`
|
||||
Name string
|
||||
Fingerprint string
|
||||
Content string `xorm:"-"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"` // Note: Updated must below Created for AfterSet.
|
||||
UpdatedUnix int64
|
||||
HasRecentActivity bool `xorm:"-"`
|
||||
HasUsed bool `xorm:"-"`
|
||||
}
|
||||
|
||||
func (k *DeployKey) BeforeInsert() {
|
||||
k.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (k *DeployKey) BeforeUpdate() {
|
||||
k.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (k *DeployKey) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created":
|
||||
case "created_unix":
|
||||
k.Created = time.Unix(k.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
k.Updated = time.Unix(k.UpdatedUnix, 0).Local()
|
||||
k.HasUsed = k.Updated.After(k.Created)
|
||||
k.HasRecentActivity = k.Updated.Add(7 * 24 * time.Hour).After(time.Now())
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/go-xorm/xorm"
|
||||
gouuid "github.com/satori/go.uuid"
|
||||
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
@@ -14,16 +15,38 @@ import (
|
||||
|
||||
// AccessToken represents a personal access token.
|
||||
type AccessToken struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UID int64 `xorm:"INDEX"`
|
||||
Name string
|
||||
Sha1 string `xorm:"UNIQUE VARCHAR(40)"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UID int64 `xorm:"INDEX"`
|
||||
Name string
|
||||
Sha1 string `xorm:"UNIQUE VARCHAR(40)"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"` // Note: Updated must below Created for AfterSet.
|
||||
UpdatedUnix int64
|
||||
HasRecentActivity bool `xorm:"-"`
|
||||
HasUsed bool `xorm:"-"`
|
||||
}
|
||||
|
||||
func (t *AccessToken) BeforeInsert() {
|
||||
t.CreatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (t *AccessToken) BeforeUpdate() {
|
||||
t.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (t *AccessToken) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "created_unix":
|
||||
t.Created = time.Unix(t.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
t.Updated = time.Unix(t.UpdatedUnix, 0).Local()
|
||||
t.HasUsed = t.Updated.After(t.Created)
|
||||
t.HasRecentActivity = t.Updated.Add(7 * 24 * time.Hour).After(time.Now())
|
||||
}
|
||||
}
|
||||
|
||||
// NewAccessToken creates new access token.
|
||||
func NewAccessToken(t *AccessToken) error {
|
||||
t.Sha1 = base.EncodeSha1(gouuid.NewV4().String())
|
||||
@@ -46,16 +69,7 @@ func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
|
||||
// ListAccessTokens returns a list of access tokens belongs to given user.
|
||||
func ListAccessTokens(uid int64) ([]*AccessToken, error) {
|
||||
tokens := make([]*AccessToken, 0, 5)
|
||||
err := x.Where("uid=?", uid).Desc("id").Find(&tokens)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, t := range tokens {
|
||||
t.HasUsed = t.Updated.After(t.Created)
|
||||
t.HasRecentActivity = t.Updated.Add(7 * 24 * time.Hour).After(time.Now())
|
||||
}
|
||||
return tokens, nil
|
||||
return tokens, x.Where("uid=?", uid).Desc("id").Find(&tokens)
|
||||
}
|
||||
|
||||
// UpdateAccessToken updates information of access token.
|
||||
|
||||
@@ -36,8 +36,8 @@ import (
|
||||
type UserType int
|
||||
|
||||
const (
|
||||
INDIVIDUAL UserType = iota // Historic reason to make it starts at 0.
|
||||
ORGANIZATION
|
||||
USER_TYPE_INDIVIDUAL UserType = iota // Historic reason to make it starts at 0.
|
||||
USER_TYPE_ORGANIZATION
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -68,10 +68,13 @@ type User struct {
|
||||
Repos []*Repository `xorm:"-"`
|
||||
Location string
|
||||
Website string
|
||||
Rands string `xorm:"VARCHAR(10)"`
|
||||
Salt string `xorm:"VARCHAR(10)"`
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
Rands string `xorm:"VARCHAR(10)"`
|
||||
Salt string `xorm:"VARCHAR(10)"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
|
||||
// Remember visibility choice for convenience, true for private
|
||||
LastRepoVisibility bool
|
||||
@@ -103,18 +106,26 @@ type User struct {
|
||||
Members []*User `xorm:"-"`
|
||||
}
|
||||
|
||||
func (u *User) BeforeInsert() {
|
||||
u.CreatedUnix = time.Now().UTC().Unix()
|
||||
u.UpdatedUnix = u.CreatedUnix
|
||||
}
|
||||
|
||||
func (u *User) BeforeUpdate() {
|
||||
if u.MaxRepoCreation < -1 {
|
||||
u.MaxRepoCreation = -1
|
||||
}
|
||||
u.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (u *User) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "full_name":
|
||||
u.FullName = markdown.Sanitizer.Sanitize(u.FullName)
|
||||
case "created":
|
||||
u.Created = regulateTimeZone(u.Created)
|
||||
case "created_unix":
|
||||
u.Created = time.Unix(u.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
u.Updated = time.Unix(u.UpdatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +389,7 @@ func (u *User) IsWriterOfRepo(repo *Repository) bool {
|
||||
|
||||
// IsOrganization returns true if user is actually a organization.
|
||||
func (u *User) IsOrganization() bool {
|
||||
return u.Type == ORGANIZATION
|
||||
return u.Type == USER_TYPE_ORGANIZATION
|
||||
}
|
||||
|
||||
// IsUserOrgOwner returns true if user is in the owner team of given organization.
|
||||
@@ -1103,16 +1114,47 @@ func GetUserByEmail(email string) (*User, error) {
|
||||
return nil, ErrUserNotExist{0, email}
|
||||
}
|
||||
|
||||
// SearchUserByName returns given number of users whose name contains keyword.
|
||||
func SearchUserByName(opt SearchOption) (us []*User, err error) {
|
||||
if len(opt.Keyword) == 0 {
|
||||
return us, nil
|
||||
}
|
||||
opt.Keyword = strings.ToLower(opt.Keyword)
|
||||
type SearchUserOptions struct {
|
||||
Keyword string
|
||||
Type UserType
|
||||
OrderBy string
|
||||
Page int
|
||||
PageSize int // Can be smaller than or equal to setting.ExplorePagingNum
|
||||
}
|
||||
|
||||
us = make([]*User, 0, opt.Limit)
|
||||
err = x.Limit(opt.Limit).Where("type=0").And("lower_name like ?", "%"+opt.Keyword+"%").Find(&us)
|
||||
return us, err
|
||||
// SearchUserByName takes keyword and part of user name to search,
|
||||
// it returns results in given range and number of total results.
|
||||
func SearchUserByName(opts *SearchUserOptions) (users []*User, _ int64, _ error) {
|
||||
if len(opts.Keyword) == 0 {
|
||||
return users, 0, nil
|
||||
}
|
||||
opts.Keyword = strings.ToLower(opts.Keyword)
|
||||
|
||||
if opts.PageSize <= 0 || opts.PageSize > setting.ExplorePagingNum {
|
||||
opts.PageSize = setting.ExplorePagingNum
|
||||
}
|
||||
if opts.Page <= 0 {
|
||||
opts.Page = 1
|
||||
}
|
||||
|
||||
searchQuery := "%" + opts.Keyword + "%"
|
||||
users = make([]*User, 0, opts.PageSize)
|
||||
// Append conditions
|
||||
sess := x.Where("LOWER(lower_name) LIKE ?", searchQuery).
|
||||
Or("LOWER(full_name) LIKE ?", searchQuery).
|
||||
And("type = ?", opts.Type)
|
||||
|
||||
var countSess xorm.Session
|
||||
countSess = *sess
|
||||
count, err := countSess.Count(new(User))
|
||||
if err != nil {
|
||||
return nil, 0, fmt.Errorf("Count: %v", err)
|
||||
}
|
||||
|
||||
if len(opts.OrderBy) > 0 {
|
||||
sess.OrderBy(opts.OrderBy)
|
||||
}
|
||||
return users, count, sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).Find(&users)
|
||||
}
|
||||
|
||||
// ___________ .__ .__
|
||||
|
||||
@@ -94,8 +94,20 @@ type Webhook struct {
|
||||
HookTaskType HookTaskType
|
||||
Meta string `xorm:"TEXT"` // store hook-specific attributes
|
||||
LastStatus HookStatus // Last delivery status
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
|
||||
Created time.Time `xorm:"-"`
|
||||
CreatedUnix int64
|
||||
Updated time.Time `xorm:"-"`
|
||||
UpdatedUnix int64
|
||||
}
|
||||
|
||||
func (w *Webhook) BeforeInsert() {
|
||||
w.CreatedUnix = time.Now().UTC().Unix()
|
||||
w.UpdatedUnix = w.CreatedUnix
|
||||
}
|
||||
|
||||
func (w *Webhook) BeforeUpdate() {
|
||||
w.UpdatedUnix = time.Now().UTC().Unix()
|
||||
}
|
||||
|
||||
func (w *Webhook) AfterSet(colName string, _ xorm.Cell) {
|
||||
@@ -106,8 +118,10 @@ func (w *Webhook) AfterSet(colName string, _ xorm.Cell) {
|
||||
if err = json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil {
|
||||
log.Error(3, "Unmarshal[%d]: %v", w.ID, err)
|
||||
}
|
||||
case "created":
|
||||
w.Created = regulateTimeZone(w.Created)
|
||||
case "created_unix":
|
||||
w.Created = time.Unix(w.CreatedUnix, 0).Local()
|
||||
case "updated_unix":
|
||||
w.Updated = time.Unix(w.UpdatedUnix, 0).Local()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ func GetRandomString(n int, alphabets ...byte) string {
|
||||
}
|
||||
|
||||
// http://code.google.com/p/go/source/browse/pbkdf2/pbkdf2.go?repo=crypto
|
||||
// FIXME: use https://godoc.org/golang.org/x/crypto/pbkdf2?
|
||||
func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte {
|
||||
prf := hmac.New(h, password)
|
||||
hashLen := prf.Size()
|
||||
|
||||
File diff suppressed because one or more lines are too long
71
modules/context/api.go
Normal file
71
modules/context/api.go
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package context
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/Unknwon/paginater"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
type APIContext struct {
|
||||
*Context
|
||||
}
|
||||
|
||||
// Error responses error message to client with given message.
|
||||
// If status is 500, also it prints error to log.
|
||||
func (ctx *APIContext) Error(status int, title string, obj interface{}) {
|
||||
var message string
|
||||
if err, ok := obj.(error); ok {
|
||||
message = err.Error()
|
||||
} else {
|
||||
message = obj.(string)
|
||||
}
|
||||
|
||||
if status == 500 {
|
||||
log.Error(4, "%s: %s", title, message)
|
||||
}
|
||||
|
||||
ctx.JSON(status, map[string]string{
|
||||
"message": message,
|
||||
"url": base.DOC_URL,
|
||||
})
|
||||
}
|
||||
|
||||
func (ctx *APIContext) SetLinkHeader(total, pageSize int) {
|
||||
page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0)
|
||||
links := make([]string, 0, 4)
|
||||
if page.HasNext() {
|
||||
links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"next\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Next()))
|
||||
}
|
||||
if !page.IsLast() {
|
||||
links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"last\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.TotalPages()))
|
||||
}
|
||||
if !page.IsFirst() {
|
||||
links = append(links, fmt.Sprintf("<%s%s?page=1>; rel=\"first\"", setting.AppUrl, ctx.Req.URL.Path[1:]))
|
||||
}
|
||||
if page.HasPrevious() {
|
||||
links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"prev\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Previous()))
|
||||
}
|
||||
|
||||
if len(links) > 0 {
|
||||
ctx.Header().Set("Link", strings.Join(links, ","))
|
||||
}
|
||||
}
|
||||
|
||||
func APIContexter() macaron.Handler {
|
||||
return func(c *Context) {
|
||||
ctx := &APIContext{
|
||||
Context: c,
|
||||
}
|
||||
c.Map(ctx)
|
||||
}
|
||||
}
|
||||
@@ -2,66 +2,23 @@
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package middleware
|
||||
package context
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/go-macaron/csrf"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
type ToggleOptions struct {
|
||||
SignInRequire bool
|
||||
SignOutRequire bool
|
||||
AdminRequire bool
|
||||
DisableCsrf bool
|
||||
}
|
||||
|
||||
// AutoSignIn reads cookie and try to auto-login.
|
||||
func AutoSignIn(ctx *Context) (bool, error) {
|
||||
if !models.HasEngine {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
uname := ctx.GetCookie(setting.CookieUserName)
|
||||
if len(uname) == 0 {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
isSucceed := false
|
||||
defer func() {
|
||||
if !isSucceed {
|
||||
log.Trace("auto-login cookie cleared: %s", uname)
|
||||
ctx.SetCookie(setting.CookieUserName, "", -1, setting.AppSubUrl)
|
||||
ctx.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubUrl)
|
||||
}
|
||||
}()
|
||||
|
||||
u, err := models.GetUserByName(uname)
|
||||
if err != nil {
|
||||
if !models.IsErrUserNotExist(err) {
|
||||
return false, fmt.Errorf("GetUserByName: %v", err)
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if val, _ := ctx.GetSuperSecureCookie(
|
||||
base.EncodeMD5(u.Rands+u.Passwd), setting.CookieRememberName); val != u.Name {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
isSucceed = true
|
||||
ctx.Session.Set("uid", u.Id)
|
||||
ctx.Session.Set("uname", u.Name)
|
||||
return true, nil
|
||||
SignInRequired bool
|
||||
SignOutRequired bool
|
||||
AdminRequired bool
|
||||
DisableCSRF bool
|
||||
}
|
||||
|
||||
func Toggle(options *ToggleOptions) macaron.Handler {
|
||||
@@ -79,23 +36,25 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
||||
}
|
||||
|
||||
// Redirect to dashboard if user tries to visit any non-login page.
|
||||
if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" {
|
||||
if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" {
|
||||
ctx.Redirect(setting.AppSubUrl + "/")
|
||||
return
|
||||
}
|
||||
|
||||
if !options.SignOutRequire && !options.DisableCsrf && ctx.Req.Method == "POST" && !auth.IsAPIPath(ctx.Req.URL.Path) {
|
||||
if !options.SignOutRequired && !options.DisableCSRF && ctx.Req.Method == "POST" && !auth.IsAPIPath(ctx.Req.URL.Path) {
|
||||
csrf.Validate(ctx.Context, ctx.csrf)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if options.SignInRequire {
|
||||
if options.SignInRequired {
|
||||
if !ctx.IsSigned {
|
||||
// Restrict API calls with error message.
|
||||
if auth.IsAPIPath(ctx.Req.URL.Path) {
|
||||
ctx.APIError(403, "", "Only signed in user is allowed to call APIs.")
|
||||
ctx.JSON(403, map[string]string{
|
||||
"message": "Only signed in user is allowed to call APIs.",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -109,15 +68,15 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-signin info is provided and has not signed in.
|
||||
if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) &&
|
||||
// Redirect to log in page if auto-signin info is provided and has not signed in.
|
||||
if !options.SignOutRequired && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) &&
|
||||
len(ctx.GetCookie(setting.CookieUserName)) > 0 {
|
||||
ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||
ctx.Redirect(setting.AppSubUrl + "/user/login")
|
||||
return
|
||||
}
|
||||
|
||||
if options.AdminRequire {
|
||||
if options.AdminRequired {
|
||||
if !ctx.User.IsAdmin {
|
||||
ctx.Error(403)
|
||||
return
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package middleware
|
||||
package context
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -18,8 +18,6 @@ import (
|
||||
"github.com/go-macaron/session"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"github.com/gogits/git-module"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
@@ -27,27 +25,6 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
type RepoContext struct {
|
||||
AccessMode models.AccessMode
|
||||
IsWatching bool
|
||||
IsViewBranch bool
|
||||
IsViewTag bool
|
||||
IsViewCommit bool
|
||||
Repository *models.Repository
|
||||
Owner *models.User
|
||||
Commit *git.Commit
|
||||
Tag *git.Tag
|
||||
GitRepo *git.Repository
|
||||
BranchName string
|
||||
TagName string
|
||||
TreeName string
|
||||
CommitID string
|
||||
RepoLink string
|
||||
CloneLink models.CloneLink
|
||||
CommitsCount int64
|
||||
Mirror *models.Mirror
|
||||
}
|
||||
|
||||
// Context represents context of a request.
|
||||
type Context struct {
|
||||
*macaron.Context
|
||||
@@ -60,38 +37,8 @@ type Context struct {
|
||||
IsSigned bool
|
||||
IsBasicAuth bool
|
||||
|
||||
Repo *RepoContext
|
||||
|
||||
Org struct {
|
||||
IsOwner bool
|
||||
IsMember bool
|
||||
IsTeamMember bool // Is member of team.
|
||||
IsTeamAdmin bool // In owner team or team that has admin permission level.
|
||||
Organization *models.User
|
||||
OrgLink string
|
||||
|
||||
Team *models.Team
|
||||
}
|
||||
}
|
||||
|
||||
// IsOwner returns true if current user is the owner of repository.
|
||||
func (r *RepoContext) IsOwner() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_OWNER
|
||||
}
|
||||
|
||||
// IsAdmin returns true if current user has admin or higher access of repository.
|
||||
func (r *RepoContext) IsAdmin() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_ADMIN
|
||||
}
|
||||
|
||||
// IsWriter returns true if current user has write or higher access of repository.
|
||||
func (r *RepoContext) IsWriter() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_WRITE
|
||||
}
|
||||
|
||||
// HasAccess returns true if the current user has at least read access for this repository
|
||||
func (r *RepoContext) HasAccess() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_READ
|
||||
Repo *Repository
|
||||
Org *Organization
|
||||
}
|
||||
|
||||
// HasError returns true if error occurs in form validation.
|
||||
@@ -165,25 +112,6 @@ func (ctx *Context) HandleText(status int, title string) {
|
||||
ctx.PlainText(status, []byte(title))
|
||||
}
|
||||
|
||||
// APIError logs error with title if status is 500.
|
||||
func (ctx *Context) APIError(status int, title string, obj interface{}) {
|
||||
var message string
|
||||
if err, ok := obj.(error); ok {
|
||||
message = err.Error()
|
||||
} else {
|
||||
message = obj.(string)
|
||||
}
|
||||
|
||||
if status == 500 {
|
||||
log.Error(4, "%s: %s", title, message)
|
||||
}
|
||||
|
||||
ctx.JSON(status, map[string]string{
|
||||
"message": message,
|
||||
"url": base.DOC_URL,
|
||||
})
|
||||
}
|
||||
|
||||
func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{}) {
|
||||
modtime := time.Now()
|
||||
for _, p := range params {
|
||||
@@ -211,7 +139,10 @@ func Contexter() macaron.Handler {
|
||||
csrf: x,
|
||||
Flash: f,
|
||||
Session: sess,
|
||||
Repo: &RepoContext{},
|
||||
Repo: &Repository{
|
||||
PullRequest: &PullRequest{},
|
||||
},
|
||||
Org: &Organization{},
|
||||
}
|
||||
// Compute current URL for real-time change language.
|
||||
ctx.Data["Link"] = setting.AppSubUrl + strings.TrimSuffix(ctx.Req.URL.Path, "/")
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package middleware
|
||||
package context
|
||||
|
||||
import (
|
||||
"strings"
|
||||
@@ -13,6 +13,17 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
type Organization struct {
|
||||
IsOwner bool
|
||||
IsMember bool
|
||||
IsTeamMember bool // Is member of team.
|
||||
IsTeamAdmin bool // In owner team or team that has admin permission level.
|
||||
Organization *models.User
|
||||
OrgLink string
|
||||
|
||||
Team *models.Team
|
||||
}
|
||||
|
||||
func HandleOrgAssignment(ctx *Context, args ...bool) {
|
||||
var (
|
||||
requireMember bool
|
||||
@@ -90,7 +101,7 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
|
||||
if ctx.Org.IsMember {
|
||||
if ctx.Org.IsOwner {
|
||||
if err := org.GetTeams(); err != nil {
|
||||
ctx.Handle(500, "GetUserTeams", err)
|
||||
ctx.Handle(500, "GetTeams", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package middleware
|
||||
package context
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -18,6 +18,56 @@ import (
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
type PullRequest struct {
|
||||
BaseRepo *models.Repository
|
||||
Allowed bool
|
||||
SameRepo bool
|
||||
HeadInfo string // [<user>:]<branch>
|
||||
}
|
||||
|
||||
type Repository struct {
|
||||
AccessMode models.AccessMode
|
||||
IsWatching bool
|
||||
IsViewBranch bool
|
||||
IsViewTag bool
|
||||
IsViewCommit bool
|
||||
Repository *models.Repository
|
||||
Owner *models.User
|
||||
Commit *git.Commit
|
||||
Tag *git.Tag
|
||||
GitRepo *git.Repository
|
||||
BranchName string
|
||||
TagName string
|
||||
TreeName string
|
||||
CommitID string
|
||||
RepoLink string
|
||||
CloneLink models.CloneLink
|
||||
CommitsCount int64
|
||||
Mirror *models.Mirror
|
||||
|
||||
PullRequest *PullRequest
|
||||
}
|
||||
|
||||
// IsOwner returns true if current user is the owner of repository.
|
||||
func (r *Repository) IsOwner() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_OWNER
|
||||
}
|
||||
|
||||
// IsAdmin returns true if current user has admin or higher access of repository.
|
||||
func (r *Repository) IsAdmin() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_ADMIN
|
||||
}
|
||||
|
||||
// IsWriter returns true if current user has write or higher access of repository.
|
||||
func (r *Repository) IsWriter() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_WRITE
|
||||
}
|
||||
|
||||
// HasAccess returns true if the current user has at least read access for this repository
|
||||
func (r *Repository) HasAccess() bool {
|
||||
return r.AccessMode >= models.ACCESS_MODE_READ
|
||||
}
|
||||
|
||||
func RetrieveBaseRepo(ctx *Context, repo *models.Repository) {
|
||||
// Non-fork repository will not return error in this method.
|
||||
if err := repo.GetBaseRepo(); err != nil {
|
||||
@@ -142,32 +192,6 @@ func RepoAssignment(args ...bool) macaron.Handler {
|
||||
ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin()
|
||||
ctx.Data["IsRepositoryWriter"] = ctx.Repo.IsWriter()
|
||||
|
||||
if repo.IsFork {
|
||||
RetrieveBaseRepo(ctx, repo)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// People who have push access and propose a new pull request.
|
||||
if ctx.Repo.IsWriter() {
|
||||
// Pull request is allowed if this is a fork repository
|
||||
// and base repository accepts pull requests.
|
||||
if repo.BaseRepo != nil {
|
||||
if repo.BaseRepo.AllowsPulls() {
|
||||
ctx.Data["CanPullRequest"] = true
|
||||
ctx.Data["BaseRepo"] = repo.BaseRepo
|
||||
}
|
||||
} else {
|
||||
// Or, this is repository accepts pull requests between branches.
|
||||
if repo.AllowsPulls() {
|
||||
ctx.Data["CanPullRequest"] = true
|
||||
ctx.Data["BaseRepo"] = repo
|
||||
ctx.Data["IsBetweenBranches"] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Data["DisableSSH"] = setting.SSH.Disabled
|
||||
ctx.Data["CloneLink"] = repo.CloneLink()
|
||||
ctx.Data["WikiCloneLink"] = repo.WikiCloneLink()
|
||||
@@ -209,10 +233,40 @@ func RepoAssignment(args ...bool) macaron.Handler {
|
||||
ctx.Repo.BranchName = brs[0]
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Data["BranchName"] = ctx.Repo.BranchName
|
||||
ctx.Data["CommitID"] = ctx.Repo.CommitID
|
||||
|
||||
if repo.IsFork {
|
||||
RetrieveBaseRepo(ctx, repo)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// People who have push access and propose a new pull request.
|
||||
if ctx.Repo.IsWriter() {
|
||||
// Pull request is allowed if this is a fork repository
|
||||
// and base repository accepts pull requests.
|
||||
if repo.BaseRepo != nil {
|
||||
if repo.BaseRepo.AllowsPulls() {
|
||||
ctx.Data["BaseRepo"] = repo.BaseRepo
|
||||
ctx.Repo.PullRequest.BaseRepo = repo.BaseRepo
|
||||
ctx.Repo.PullRequest.Allowed = true
|
||||
ctx.Repo.PullRequest.HeadInfo = ctx.Repo.Owner.Name + ":" + ctx.Repo.BranchName
|
||||
}
|
||||
} else {
|
||||
// Or, this is repository accepts pull requests between branches.
|
||||
if repo.AllowsPulls() {
|
||||
ctx.Data["BaseRepo"] = repo
|
||||
ctx.Repo.PullRequest.BaseRepo = repo
|
||||
ctx.Repo.PullRequest.Allowed = true
|
||||
ctx.Repo.PullRequest.SameRepo = true
|
||||
ctx.Repo.PullRequest.HeadInfo = ctx.Repo.BranchName
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.Data["PullRequestCtx"] = ctx.Repo.PullRequest
|
||||
|
||||
if ctx.Query("go-get") == "1" {
|
||||
ctx.Data["GoGetImport"] = path.Join(setting.Domain, setting.AppSubUrl, owner.Name, repo.Name)
|
||||
prefix := setting.AppUrl + path.Join(owner.Name, repo.Name, "src", ctx.Repo.BranchName)
|
||||
@@ -159,6 +159,8 @@ var (
|
||||
svgSuffixWithMark = []byte(".svg?")
|
||||
spaceBytes = []byte(" ")
|
||||
spaceEncodedBytes = []byte("%20")
|
||||
space = " "
|
||||
spaceEncoded = "%20"
|
||||
)
|
||||
|
||||
// Image defines how images should be processed to produce corresponding HTML elements.
|
||||
@@ -357,6 +359,7 @@ OUTER_LOOP:
|
||||
|
||||
// Render renders Markdown to HTML with special links.
|
||||
func Render(rawBytes []byte, urlPrefix string, metas map[string]string) []byte {
|
||||
urlPrefix = strings.Replace(urlPrefix, space, spaceEncoded, -1)
|
||||
result := RenderRaw(rawBytes, urlPrefix)
|
||||
result = PostProcess(result, urlPrefix, metas)
|
||||
result = Sanitizer.SanitizeBytes(result)
|
||||
|
||||
@@ -54,7 +54,7 @@ var (
|
||||
AppSubUrl string
|
||||
AppSubUrlDepth int // Number of slashes
|
||||
AppPath string
|
||||
AppDataPath = "data"
|
||||
AppDataPath string
|
||||
|
||||
// Server settings
|
||||
Protocol Scheme
|
||||
@@ -156,7 +156,8 @@ var (
|
||||
CacheConn string
|
||||
|
||||
// Session settings
|
||||
SessionConfig session.Options
|
||||
SessionConfig session.Options
|
||||
CSRFCookieName = "_csrf"
|
||||
|
||||
// Git settings
|
||||
Git struct {
|
||||
@@ -334,6 +335,7 @@ func NewContext() {
|
||||
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
|
||||
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
|
||||
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
|
||||
AppDataPath = sec.Key("APP_DATA_PATH").MustString("data")
|
||||
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
|
||||
|
||||
switch sec.Key("LANDING_PAGE").MustString("home") {
|
||||
|
||||
@@ -62,12 +62,12 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
|
||||
}
|
||||
case "exec":
|
||||
cmdName := strings.TrimLeft(payload, "'()")
|
||||
os.Setenv("SSH_ORIGINAL_COMMAND", cmdName)
|
||||
log.Trace("SSH: Payload: %v", cmdName)
|
||||
|
||||
args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf}
|
||||
log.Trace("SSH: Arguments: %v", args)
|
||||
cmd := exec.Command(setting.AppPath, args...)
|
||||
cmd.Env = append(os.Environ(), "SSH_ORIGINAL_COMMAND="+cmdName)
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
||||
Binary file not shown.
@@ -217,6 +217,7 @@
|
||||
.octicon-triangle-up:before { content: '\f0aa'} /* */
|
||||
.octicon-unfold:before { content: '\f039'} /* */
|
||||
.octicon-unmute:before { content: '\f0ba'} /* */
|
||||
.octicon-unverified:before { content: '\f0e8'} /* */
|
||||
.octicon-verified:before { content: '\f0e6'} /* */
|
||||
.octicon-versions:before { content: '\f064'} /* */
|
||||
.octicon-watch:before { content: '\f0e0'} /* */
|
||||
Binary file not shown.
@@ -177,7 +177,8 @@ Applies to all other files
|
||||
<glyph glyph-name="triangle-up" unicode="" d="M768 128L384 512 0 128h768z" horiz-adv-x="768" />
|
||||
<glyph glyph-name="unfold" unicode="" d="M736 288l160-160c0-35-29-64-64-64H576v64h224L672 256H224L96 128h224v-64H64c-35 0-64 29-64 64l160 160L0 448c0 35 29 64 64 64h256v-64H96l128-128h448l128 128H576v64h256c35 0 64-29 64-64L736 288z m-352 96h128V576h128L448 768 256 576h128v-192z m128-192H384v-192H256l192-192 192 192H512V192z" horiz-adv-x="896" />
|
||||
<glyph glyph-name="unmute" unicode="" d="M704 319c0-70-29-134-75-181l-43 43c35 36 57 84 57 138s-22 103-57 138l43 43c46-46 75-110 75-181zM430 686L192 448H64c-35 0-64-29-64-64v-128c0-35 29-64 64-64h128l238-238c30-30 82-9 82 34V652c0 43-52 64-82 34z m380-5l-43-43c82-82 132-194 132-319 0-124-50-237-132-319l43-43c93 93 150 221 150 362 0 142-57 270-150 362z m-90-90l-44-43c59-59 95-140 95-229s-36-170-95-228l44-43c69 69 112 165 112 271s-43 202-112 272z" horiz-adv-x="1024" />
|
||||
<glyph glyph-name="verified" unicode="" d="M1002 361l-84 64c-30 22-50 71-45 108l14 104c5 37-21 63-58 58l-104-14c-37-5-86 15-108 45l-64 84c-23 29-59 29-82 0l-64-84c-22-30-71-50-108-45l-104 14c-37 5-63-21-58-58l14-104c5-37-15-86-45-108l-84-64c-29-23-29-59 0-82l84-64c30-22 50-71 45-108l-14-104c-5-37 21-63 58-58l104 14c37 5 86-15 108-45l64-84c23-29 59-29 82 0l64 84c22 30 71 50 108 45l104-14c37-5 63 21 58 58l-14 104c-5 37 15 86 45 108l84 64c29 23 29 59 0 82z m-234-9c0-53-43-96-96-96H512v-64l-64 32v-96l-64 32v-96H256V192l192 192v96c0 53 43 96 96 96h160c35 0 64-29 64-64v-160z m-64 92v-28c0-18-14-32-32-32h-64c-18 0-32 14-32 32v64c0 18 14 32 32 32h28c37 0 68-31 68-68z" horiz-adv-x="1024" />
|
||||
<glyph glyph-name="unverified" unicode="" d="M1003 380l-69 86c-11 14-18 31-20 49l-12 109c-5 45-40 80-85 85l-109 12c-19 2-36 10-50 21l-86 69c-35 28-85 28-120 0l-86-69c-14-11-31-18-49-20l-109-12c-45-5-80-40-85-85l-12-109c-2-19-10-36-21-50l-69-86c-28-35-28-85 0-120l69-86c11-14 18-31 20-49l12-109c5-45 40-80 85-85l109-12c19-2 36-10 50-21l86-69c35-28 85-28 120 0l86 69c14 11 31 18 49 20l109 12c45 5 80 40 85 85l12 109c2 19 10 36 21 50l69 86c28 35 28 85 0 120zM576 96c0-18-14-32-32-32h-64c-17 0-32 14-32 32v64c0 18 15 32 32 32h64c18 0 32-14 32-32v-64z m100 313c-4-11-11-21-19-30-8-10-9-12-21-24-10-11-20-19-33-29-7-6-13-12-18-17s-9-11-12-17-5-12-7-19-2-8-2-16H456c0 14 0 20 2 31 2 12 5 23 9 33 4 9 9 18 16 27 7 8 15 16 26 24 17 12 23 19 31 33s13 24 13 38c0 17-4 29-13 37-8 8-20 12-37 12-6 0-12-1-19-3s-11-6-16-10-9-7-13-13-6-9-6-18H321c0 24 8 36 17 53 10 17 23 32 39 43s35 19 56 24 45 8 70 8c28 0 53-3 75-8 22-6 40-14 56-25 15-11 26-24 35-40 8-16 12-35 12-56 0-14 0-27-5-38z" horiz-adv-x="1024" />
|
||||
<glyph glyph-name="verified" unicode="" d="M1003 380l-69 86c-11 14-18 31-20 49l-12 109c-5 45-40 80-85 85l-109 12c-19 2-36 10-50 21l-86 69c-35 28-85 28-120 0l-86-69c-14-11-31-18-49-20l-109-12c-45-5-80-40-85-85l-12-109c-2-19-10-36-21-50l-69-86c-28-35-28-85 0-120l69-86c11-14 18-31 20-49l12-109c5-45 40-80 85-85l109-12c19-2 36-10 50-21l86-69c35-28 85-28 120 0l86 69c14 11 31 18 49 20l109 12c45 5 80 40 85 85l12 109c2 19 10 36 21 50l69 86c28 35 28 85 0 120zM416 64L192 288l96 96 128-128 320 320 96-99-416-413z" horiz-adv-x="1024" />
|
||||
<glyph glyph-name="versions" unicode="" d="M832 640H448c-35 0-64-29-64-64v-512c0-35 29-64 64-64h384c35 0 64 29 64 64V576c0 35-29 64-64 64z m-64-512H512V512h256v-384zM256 576h64v-64h-64v-384h64v-64h-64c-35 0-64 29-64 64V512c0 35 29 64 64 64zM64 512h64v-64H64v-256h64v-64H64c-35 0-64 29-64 64V448c0 35 29 64 64 64z" horiz-adv-x="896" />
|
||||
<glyph glyph-name="watch" unicode="" d="M384 320h128v-64H320V512h64v-192z m384 0c0-142-77-266-192-332v-116c0-35-29-64-64-64H256c-35 0-64 29-64 64V-12C77 54 0 178 0 320s77 266 192 332V768c0 35 29 64 64 64h256c35 0 64-29 64-64v-116c115-66 192-190 192-332z m-64 0c0 177-143 320-320 320S64 497 64 320s143-320 320-320 320 143 320 320z" horiz-adv-x="768" />
|
||||
<glyph glyph-name="x" unicode="" d="M479 320l240-240-95-95-240 240-240-240-95 95 240 240L49 560l95 95 240-240 240 240 95-95-240-240z" horiz-adv-x="768" />
|
||||
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 66 KiB |
Binary file not shown.
BIN
public/assets/octicons-3.5.0/octicons.woff
Normal file
BIN
public/assets/octicons-3.5.0/octicons.woff
Normal file
Binary file not shown.
@@ -441,30 +441,30 @@
|
||||
"outputStyle": 1,
|
||||
"syntaxCheckerStyle": 1
|
||||
},
|
||||
"\/plugins\/highlight-9.1.0\/default.css": {
|
||||
"\/plugins\/highlight-9.2.0\/default.css": {
|
||||
"fileType": 16,
|
||||
"ignore": 0,
|
||||
"ignoreWasSetByUser": 0,
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.1.0\/default.css",
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.2.0\/default.css",
|
||||
"outputAbbreviatedPath": "No Output Path",
|
||||
"outputPathIsOutsideProject": 0,
|
||||
"outputPathIsSetByUser": 0
|
||||
},
|
||||
"\/plugins\/highlight-9.1.0\/github.css": {
|
||||
"\/plugins\/highlight-9.2.0\/github.css": {
|
||||
"fileType": 16,
|
||||
"ignore": 0,
|
||||
"ignoreWasSetByUser": 0,
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.1.0\/github.css",
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.2.0\/github.css",
|
||||
"outputAbbreviatedPath": "No Output Path",
|
||||
"outputPathIsOutsideProject": 0,
|
||||
"outputPathIsSetByUser": 0
|
||||
},
|
||||
"\/plugins\/highlight-9.1.0\/highlight.pack.js": {
|
||||
"\/plugins\/highlight-9.2.0\/highlight.pack.js": {
|
||||
"fileType": 64,
|
||||
"ignore": 0,
|
||||
"ignoreWasSetByUser": 0,
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.1.0\/highlight.pack.js",
|
||||
"outputAbbreviatedPath": "\/plugins\/highlight-9.1.0\/min\/highlight.pack-min.js",
|
||||
"inputAbbreviatedPath": "\/plugins\/highlight-9.2.0\/highlight.pack.js",
|
||||
"outputAbbreviatedPath": "\/plugins\/highlight-9.2.0\/min\/highlight.pack-min.js",
|
||||
"outputPathIsOutsideProject": 0,
|
||||
"outputPathIsSetByUser": 0,
|
||||
"outputStyle": 1,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
background-size: contain;
|
||||
}
|
||||
body {
|
||||
font-family: "Helvetica Neue", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
|
||||
font-family: "Helvetica Neue", "Meiryo Ui", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
|
||||
background-color: #fff;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
@@ -1140,6 +1140,7 @@ footer .container .links > *:first-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.repository .filter.menu .label.color {
|
||||
border-radius: 3px;
|
||||
margin-left: 15px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
@@ -2376,6 +2377,9 @@ footer .container .links > *:first-child {
|
||||
.user.settings .email.list .item:not(:first-child) .button {
|
||||
margin-top: -10px;
|
||||
}
|
||||
.user.profile .ui.card #profile-avatar {
|
||||
height: 290px;
|
||||
}
|
||||
.user.profile .ui.card .username {
|
||||
display: block;
|
||||
}
|
||||
@@ -2594,6 +2598,10 @@ footer .container .links > *:first-child {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
.explore .navbar .octicon {
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.ui.repository.list .item {
|
||||
padding-bottom: 25px;
|
||||
}
|
||||
@@ -2620,3 +2628,26 @@ footer .container .links > *:first-child {
|
||||
font-size: 12px;
|
||||
color: #808080;
|
||||
}
|
||||
.ui.user.list .item {
|
||||
padding-bottom: 25px;
|
||||
}
|
||||
.ui.user.list .item:not(:first-child) {
|
||||
border-top: 1px solid #eee;
|
||||
padding-top: 25px;
|
||||
}
|
||||
.ui.user.list .item .ui.avatar.image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
.ui.user.list .item .description {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.ui.user.list .item .description .octicon:not(:first-child) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.ui.user.list .item .description a {
|
||||
color: #333;
|
||||
}
|
||||
.ui.user.list .item .description a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
7
public/js/libs/clipboard-1.5.5.min.js
vendored
7
public/js/libs/clipboard-1.5.5.min.js
vendored
File diff suppressed because one or more lines are too long
7
public/js/libs/clipboard-1.5.9.min.js
vendored
Executable file
7
public/js/libs/clipboard-1.5.9.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
@footer-margin: 40px;
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
|
||||
font-family: "Helvetica Neue", "Meiryo Ui", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
|
||||
background-color: #fff;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
.explore {
|
||||
padding-top: 15px;
|
||||
padding-bottom: @footer-margin * 2;
|
||||
|
||||
.navbar {
|
||||
.octicon {
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ui.repository.list {
|
||||
@@ -35,3 +42,34 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ui.user.list {
|
||||
.item {
|
||||
padding-bottom: 25px;
|
||||
|
||||
&:not(:first-child) {
|
||||
border-top: 1px solid #eee;
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
.ui.avatar.image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-top: 5px;
|
||||
|
||||
.octicon:not(:first-child) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #333;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,7 @@
|
||||
}
|
||||
.filter.menu {
|
||||
.label.color {
|
||||
border-radius: 3px;
|
||||
margin-left: 15px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
&.profile {
|
||||
.ui.card {
|
||||
#profile-avatar {
|
||||
height: 290px;
|
||||
}
|
||||
.username {
|
||||
display: block;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -11,11 +11,18 @@ Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
|
||||
/* Base color: saturation 0; */
|
||||
|
||||
.hljs,
|
||||
.hljs-subst {
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.hljs-comment {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-attribute,
|
||||
.hljs-selector-tag,
|
||||
@@ -25,23 +32,8 @@ Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-literal,
|
||||
.hljs-bullet,
|
||||
.hljs-code,
|
||||
.hljs-addition {
|
||||
color: #1F811F;
|
||||
}
|
||||
|
||||
.hljs-regexp,
|
||||
.hljs-symbol,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-link,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #BC6060;
|
||||
}
|
||||
/* User color: hue: 0 */
|
||||
|
||||
.hljs-type,
|
||||
.hljs-string,
|
||||
@@ -60,14 +52,44 @@ Original highlight.js style (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-comment {
|
||||
color: #888888;
|
||||
.hljs-regexp,
|
||||
.hljs-symbol,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-link,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #BC6060;
|
||||
}
|
||||
|
||||
.hljs-meta {
|
||||
color: #2B6EA1;
|
||||
|
||||
/* Language color: hue: 90; */
|
||||
|
||||
.hljs-literal {
|
||||
color: #78A960;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-bullet,
|
||||
.hljs-code,
|
||||
.hljs-addition {
|
||||
color: #397300;
|
||||
}
|
||||
|
||||
|
||||
/* Meta color: hue: 200 */
|
||||
|
||||
.hljs-meta {
|
||||
color: #1f7199;
|
||||
}
|
||||
|
||||
.hljs-meta-string {
|
||||
color: #4d99bf;
|
||||
}
|
||||
|
||||
|
||||
/* Misc effects */
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
4
public/plugins/highlight-9.2.0/highlight.pack.js
Normal file
4
public/plugins/highlight-9.2.0/highlight.pack.js
Normal file
File diff suppressed because one or more lines are too long
@@ -15,9 +15,9 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/cron"
|
||||
"github.com/gogits/gogs/modules/mailer"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/process"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
@@ -124,7 +124,7 @@ const (
|
||||
REINIT_MISSING_REPOSITORY
|
||||
)
|
||||
|
||||
func Dashboard(ctx *middleware.Context) {
|
||||
func Dashboard(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.dashboard")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminDashboard"] = true
|
||||
@@ -175,7 +175,7 @@ func Dashboard(ctx *middleware.Context) {
|
||||
ctx.HTML(200, DASHBOARD)
|
||||
}
|
||||
|
||||
func SendTestMail(ctx *middleware.Context) {
|
||||
func SendTestMail(ctx *context.Context) {
|
||||
email := ctx.Query("email")
|
||||
// Send a test email to the user's email address and redirect back to Config
|
||||
if err := mailer.SendTestMail(email); err != nil {
|
||||
@@ -187,7 +187,7 @@ func SendTestMail(ctx *middleware.Context) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/config")
|
||||
}
|
||||
|
||||
func Config(ctx *middleware.Context) {
|
||||
func Config(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.config")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminConfig"] = true
|
||||
@@ -236,7 +236,7 @@ func Config(ctx *middleware.Context) {
|
||||
ctx.HTML(200, CONFIG)
|
||||
}
|
||||
|
||||
func Monitor(ctx *middleware.Context) {
|
||||
func Monitor(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.monitor")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminMonitor"] = true
|
||||
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/auth/ldap"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ const (
|
||||
AUTH_EDIT base.TplName = "admin/auth/edit"
|
||||
)
|
||||
|
||||
func Authentications(ctx *middleware.Context) {
|
||||
func Authentications(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.authentication")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminAuthentications"] = true
|
||||
@@ -53,7 +53,7 @@ var authSources = []AuthSource{
|
||||
{models.LoginNames[models.LOGIN_PAM], models.LOGIN_PAM},
|
||||
}
|
||||
|
||||
func NewAuthSource(ctx *middleware.Context) {
|
||||
func NewAuthSource(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.auths.new")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminAuthentications"] = true
|
||||
@@ -102,7 +102,7 @@ func parseSMTPConfig(form auth.AuthenticationForm) *models.SMTPConfig {
|
||||
}
|
||||
}
|
||||
|
||||
func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
func NewAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.auths.new")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminAuthentications"] = true
|
||||
@@ -147,7 +147,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/auths")
|
||||
}
|
||||
|
||||
func EditAuthSource(ctx *middleware.Context) {
|
||||
func EditAuthSource(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.auths.edit")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminAuthentications"] = true
|
||||
@@ -163,7 +163,7 @@ func EditAuthSource(ctx *middleware.Context) {
|
||||
ctx.HTML(200, AUTH_EDIT)
|
||||
}
|
||||
|
||||
func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
func EditAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.auths.edit")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminAuthentications"] = true
|
||||
@@ -210,7 +210,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/auths/" + com.ToStr(form.ID))
|
||||
}
|
||||
|
||||
func DeleteAuthSource(ctx *middleware.Context) {
|
||||
func DeleteAuthSource(ctx *context.Context) {
|
||||
source, err := models.GetLoginSourceByID(ctx.ParamsInt64(":authid"))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetLoginSourceByID", err)
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ const (
|
||||
NOTICES base.TplName = "admin/notice"
|
||||
)
|
||||
|
||||
func Notices(ctx *middleware.Context) {
|
||||
func Notices(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.notices")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminNotices"] = true
|
||||
@@ -42,7 +42,7 @@ func Notices(ctx *middleware.Context) {
|
||||
ctx.HTML(200, NOTICES)
|
||||
}
|
||||
|
||||
func DeleteNotices(ctx *middleware.Context) {
|
||||
func DeleteNotices(ctx *context.Context) {
|
||||
strs := ctx.QueryStrings("ids[]")
|
||||
ids := make([]int64, 0, len(strs))
|
||||
for i := range strs {
|
||||
@@ -61,7 +61,7 @@ func DeleteNotices(ctx *middleware.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func EmptyNotices(ctx *middleware.Context) {
|
||||
func EmptyNotices(ctx *context.Context) {
|
||||
if err := models.DeleteNotices(0, 0); err != nil {
|
||||
ctx.Handle(500, "DeleteNotices", err)
|
||||
return
|
||||
|
||||
@@ -5,39 +5,28 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/Unknwon/paginater"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers"
|
||||
)
|
||||
|
||||
const (
|
||||
ORGS base.TplName = "admin/org/list"
|
||||
)
|
||||
|
||||
func Organizations(ctx *middleware.Context) {
|
||||
func Organizations(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.organizations")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminOrganizations"] = true
|
||||
|
||||
total := models.CountOrganizations()
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(int(total), setting.AdminOrgPagingNum, page, 5)
|
||||
|
||||
orgs, err := models.Organizations(page, setting.AdminOrgPagingNum)
|
||||
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Organizations", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["Orgs"] = orgs
|
||||
ctx.Data["Total"] = total
|
||||
|
||||
ctx.HTML(200, ORGS)
|
||||
routers.RenderUserSearch(ctx, &routers.UserSearchOptions{
|
||||
Type: models.USER_TYPE_ORGANIZATION,
|
||||
Counter: models.CountOrganizations,
|
||||
Ranger: models.Organizations,
|
||||
PageSize: setting.AdminOrgPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: ORGS,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -5,43 +5,34 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"github.com/Unknwon/paginater"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers"
|
||||
)
|
||||
|
||||
const (
|
||||
REPOS base.TplName = "admin/repo/list"
|
||||
)
|
||||
|
||||
func Repos(ctx *middleware.Context) {
|
||||
func Repos(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.repositories")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminRepositories"] = true
|
||||
|
||||
total := models.CountRepositories()
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(int(total), setting.AdminRepoPagingNum, page, 5)
|
||||
|
||||
repos, err := models.RepositoriesWithUsers(page, setting.AdminRepoPagingNum)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "RepositoriesWithUsers", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Repos"] = repos
|
||||
|
||||
ctx.Data["Total"] = total
|
||||
ctx.HTML(200, REPOS)
|
||||
routers.RenderRepoSearch(ctx, &routers.RepoSearchOptions{
|
||||
Counter: models.CountRepositories,
|
||||
Ranger: models.Repositories,
|
||||
Private: true,
|
||||
PageSize: setting.AdminRepoPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: REPOS,
|
||||
})
|
||||
}
|
||||
|
||||
func DeleteRepo(ctx *middleware.Context) {
|
||||
func DeleteRepo(ctx *context.Context) {
|
||||
repo, err := models.GetRepositoryByID(ctx.QueryInt64("id"))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetRepositoryByID", err)
|
||||
|
||||
@@ -8,15 +8,15 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/Unknwon/paginater"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/mailer"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,30 +25,22 @@ const (
|
||||
USER_EDIT base.TplName = "admin/user/edit"
|
||||
)
|
||||
|
||||
func Users(ctx *middleware.Context) {
|
||||
func Users(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
|
||||
total := models.CountUsers()
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
ctx.Data["Page"] = paginater.New(int(total), setting.AdminUserPagingNum, page, 5)
|
||||
|
||||
users, err := models.Users(page, setting.AdminUserPagingNum)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Users", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Users"] = users
|
||||
|
||||
ctx.Data["Total"] = total
|
||||
ctx.HTML(200, USERS)
|
||||
routers.RenderUserSearch(ctx, &routers.UserSearchOptions{
|
||||
Type: models.USER_TYPE_INDIVIDUAL,
|
||||
Counter: models.CountUsers,
|
||||
Ranger: models.Users,
|
||||
PageSize: setting.AdminUserPagingNum,
|
||||
OrderBy: "id ASC",
|
||||
TplName: USERS,
|
||||
})
|
||||
}
|
||||
|
||||
func NewUser(ctx *middleware.Context) {
|
||||
func NewUser(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.new_account")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
@@ -66,7 +58,7 @@ func NewUser(ctx *middleware.Context) {
|
||||
ctx.HTML(200, USER_NEW)
|
||||
}
|
||||
|
||||
func NewUserPost(ctx *middleware.Context, form auth.AdminCrateUserForm) {
|
||||
func NewUserPost(ctx *context.Context, form auth.AdminCrateUserForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.new_account")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
@@ -132,7 +124,7 @@ func NewUserPost(ctx *middleware.Context, form auth.AdminCrateUserForm) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/users/" + com.ToStr(u.Id))
|
||||
}
|
||||
|
||||
func prepareUserInfo(ctx *middleware.Context) *models.User {
|
||||
func prepareUserInfo(ctx *context.Context) *models.User {
|
||||
u, err := models.GetUserByID(ctx.ParamsInt64(":userid"))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetUserByID", err)
|
||||
@@ -160,7 +152,7 @@ func prepareUserInfo(ctx *middleware.Context) *models.User {
|
||||
return u
|
||||
}
|
||||
|
||||
func EditUser(ctx *middleware.Context) {
|
||||
func EditUser(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.edit_account")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
@@ -173,7 +165,7 @@ func EditUser(ctx *middleware.Context) {
|
||||
ctx.HTML(200, USER_EDIT)
|
||||
}
|
||||
|
||||
func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) {
|
||||
func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("admin.users.edit_account")
|
||||
ctx.Data["PageIsAdmin"] = true
|
||||
ctx.Data["PageIsAdminUsers"] = true
|
||||
@@ -231,7 +223,7 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) {
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid"))
|
||||
}
|
||||
|
||||
func DeleteUser(ctx *middleware.Context) {
|
||||
func DeleteUser(ctx *context.Context) {
|
||||
u, err := models.GetUserByID(ctx.ParamsInt64(":userid"))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetUserByID", err)
|
||||
|
||||
@@ -8,13 +8,13 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
"github.com/gogits/gogs/routers/api/v1/user"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization
|
||||
func CreateOrg(ctx *middleware.Context, form api.CreateOrgOption) {
|
||||
func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) {
|
||||
u := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -27,18 +27,18 @@ func CreateOrg(ctx *middleware.Context, form api.CreateOrgOption) {
|
||||
Website: form.Website,
|
||||
Location: form.Location,
|
||||
IsActive: true,
|
||||
Type: models.ORGANIZATION,
|
||||
Type: models.USER_TYPE_ORGANIZATION,
|
||||
}
|
||||
if err := models.CreateOrganization(org, u); err != nil {
|
||||
if models.IsErrUserAlreadyExist(err) ||
|
||||
models.IsErrNameReserved(err) ||
|
||||
models.IsErrNamePatternNotAllowed(err) {
|
||||
ctx.APIError(422, "CreateOrganization", err)
|
||||
ctx.Error(422, "CreateOrganization", err)
|
||||
} else {
|
||||
ctx.APIError(500, "CreateOrganization", err)
|
||||
ctx.Error(500, "CreateOrganization", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(201, convert.ToApiOrganization(org))
|
||||
ctx.JSON(201, convert.ToOrganization(org))
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ package admin
|
||||
import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/repo"
|
||||
"github.com/gogits/gogs/routers/api/v1/user"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Repositories#create-a-new-repository
|
||||
func CreateRepo(ctx *middleware.Context, form api.CreateRepoOption) {
|
||||
func CreateRepo(ctx *context.APIContext, form api.CreateRepoOption) {
|
||||
owner := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
|
||||
@@ -8,15 +8,15 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/mailer"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
"github.com/gogits/gogs/routers/api/v1/user"
|
||||
)
|
||||
|
||||
func parseLoginSource(ctx *middleware.Context, u *models.User, sourceID int64, loginName string) {
|
||||
func parseLoginSource(ctx *context.APIContext, u *models.User, sourceID int64, loginName string) {
|
||||
if sourceID == 0 {
|
||||
return
|
||||
}
|
||||
@@ -24,9 +24,9 @@ func parseLoginSource(ctx *middleware.Context, u *models.User, sourceID int64, l
|
||||
source, err := models.GetLoginSourceByID(sourceID)
|
||||
if err != nil {
|
||||
if models.IsErrAuthenticationNotExist(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "GetLoginSourceByID", err)
|
||||
ctx.Error(500, "GetLoginSourceByID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -37,7 +37,7 @@ func parseLoginSource(ctx *middleware.Context, u *models.User, sourceID int64, l
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Users#create-a-new-user
|
||||
func CreateUser(ctx *middleware.Context, form api.CreateUserOption) {
|
||||
func CreateUser(ctx *context.APIContext, form api.CreateUserOption) {
|
||||
u := &models.User{
|
||||
Name: form.Username,
|
||||
Email: form.Email,
|
||||
@@ -56,9 +56,9 @@ func CreateUser(ctx *middleware.Context, form api.CreateUserOption) {
|
||||
models.IsErrEmailAlreadyUsed(err) ||
|
||||
models.IsErrNameReserved(err) ||
|
||||
models.IsErrNamePatternNotAllowed(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "CreateUser", err)
|
||||
ctx.Error(500, "CreateUser", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -66,14 +66,14 @@ func CreateUser(ctx *middleware.Context, form api.CreateUserOption) {
|
||||
|
||||
// Send e-mail notification.
|
||||
if form.SendNotify && setting.MailService != nil {
|
||||
mailer.SendRegisterNotifyMail(ctx.Context, u)
|
||||
mailer.SendRegisterNotifyMail(ctx.Context.Context, u)
|
||||
}
|
||||
|
||||
ctx.JSON(201, convert.ToApiUser(u))
|
||||
ctx.JSON(201, convert.ToUser(u))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Users#edit-an-existing-user
|
||||
func EditUser(ctx *middleware.Context, form api.EditUserOption) {
|
||||
func EditUser(ctx *context.APIContext, form api.EditUserOption) {
|
||||
u := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -110,19 +110,19 @@ func EditUser(ctx *middleware.Context, form api.EditUserOption) {
|
||||
|
||||
if err := models.UpdateUser(u); err != nil {
|
||||
if models.IsErrEmailAlreadyUsed(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "UpdateUser", err)
|
||||
ctx.Error(500, "UpdateUser", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
log.Trace("Account profile updated by admin (%s): %s", ctx.User.Name, u.Name)
|
||||
|
||||
ctx.JSON(200, convert.ToApiUser(u))
|
||||
ctx.JSON(200, convert.ToUser(u))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Users#delete-a-user
|
||||
func DeleteUser(ctx *middleware.Context) {
|
||||
func DeleteUser(ctx *context.APIContext) {
|
||||
u := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -131,9 +131,9 @@ func DeleteUser(ctx *middleware.Context) {
|
||||
if err := models.DeleteUser(u); err != nil {
|
||||
if models.IsErrUserOwnRepos(err) ||
|
||||
models.IsErrUserHasOrgs(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "DeleteUser", err)
|
||||
ctx.Error(500, "DeleteUser", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -143,7 +143,7 @@ func DeleteUser(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Administration-Users#create-a-public-key-for-user
|
||||
func CreatePublicKey(ctx *middleware.Context, form api.CreateKeyOption) {
|
||||
func CreatePublicKey(ctx *context.APIContext, form api.CreateKeyOption) {
|
||||
u := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/admin"
|
||||
"github.com/gogits/gogs/routers/api/v1/misc"
|
||||
"github.com/gogits/gogs/routers/api/v1/org"
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
func RepoAssignment() macaron.Handler {
|
||||
return func(ctx *middleware.Context) {
|
||||
return func(ctx *context.APIContext) {
|
||||
userName := ctx.Params(":username")
|
||||
repoName := ctx.Params(":reponame")
|
||||
|
||||
@@ -39,9 +39,9 @@ func RepoAssignment() macaron.Handler {
|
||||
owner, err = models.GetUserByName(userName)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetUserByName", err)
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -52,27 +52,29 @@ func RepoAssignment() macaron.Handler {
|
||||
repo, err := models.GetRepositoryByName(owner.Id, repoName)
|
||||
if err != nil {
|
||||
if models.IsErrRepoNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetRepositoryByName", err)
|
||||
ctx.Error(500, "GetRepositoryByName", err)
|
||||
}
|
||||
return
|
||||
} else if err = repo.GetOwner(); err != nil {
|
||||
ctx.APIError(500, "GetOwner", err)
|
||||
ctx.Error(500, "GetOwner", err)
|
||||
return
|
||||
}
|
||||
|
||||
mode, err := models.AccessLevel(ctx.User, repo)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "AccessLevel", err)
|
||||
return
|
||||
if ctx.IsSigned && ctx.User.IsAdmin {
|
||||
ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER
|
||||
} else {
|
||||
mode, err := models.AccessLevel(ctx.User, repo)
|
||||
if err != nil {
|
||||
ctx.Error(500, "AccessLevel", err)
|
||||
return
|
||||
}
|
||||
ctx.Repo.AccessMode = mode
|
||||
}
|
||||
|
||||
ctx.Repo.AccessMode = mode
|
||||
|
||||
// Check access.
|
||||
if ctx.Repo.AccessMode == models.ACCESS_MODE_NONE {
|
||||
ctx.Error(404)
|
||||
if !ctx.Repo.HasAccess() {
|
||||
ctx.Status(404)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -82,7 +84,7 @@ func RepoAssignment() macaron.Handler {
|
||||
|
||||
// Contexter middleware already checks token for user sign in process.
|
||||
func ReqToken() macaron.Handler {
|
||||
return func(ctx *middleware.Context) {
|
||||
return func(ctx *context.Context) {
|
||||
if !ctx.IsSigned {
|
||||
ctx.Error(401)
|
||||
return
|
||||
@@ -91,7 +93,7 @@ func ReqToken() macaron.Handler {
|
||||
}
|
||||
|
||||
func ReqBasicAuth() macaron.Handler {
|
||||
return func(ctx *middleware.Context) {
|
||||
return func(ctx *context.Context) {
|
||||
if !ctx.IsBasicAuth {
|
||||
ctx.Error(401)
|
||||
return
|
||||
@@ -100,7 +102,7 @@ func ReqBasicAuth() macaron.Handler {
|
||||
}
|
||||
|
||||
func ReqAdmin() macaron.Handler {
|
||||
return func(ctx *middleware.Context) {
|
||||
return func(ctx *context.Context) {
|
||||
if !ctx.User.IsAdmin {
|
||||
ctx.Error(403)
|
||||
return
|
||||
@@ -181,11 +183,11 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Combo("/hooks").Get(repo.ListHooks).
|
||||
Post(bind(api.CreateHookOption{}), repo.CreateHook)
|
||||
m.Patch("/hooks/:id:int", bind(api.EditHookOption{}), repo.EditHook)
|
||||
m.Get("/raw/*", middleware.RepoRef(), repo.GetRawFile)
|
||||
m.Get("/raw/*", context.RepoRef(), repo.GetRawFile)
|
||||
m.Get("/archive/*", repo.GetArchive)
|
||||
m.Group("/branches", func() {
|
||||
m.Get("",repo.ListBranches)
|
||||
m.Get("/:branchname",repo.GetBranch)
|
||||
m.Get("", repo.ListBranches)
|
||||
m.Get("/:branchname", repo.GetBranch)
|
||||
})
|
||||
m.Group("/keys", func() {
|
||||
m.Combo("").Get(repo.ListDeployKeys).
|
||||
@@ -193,6 +195,10 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Combo("/:id").Get(repo.GetDeployKey).
|
||||
Delete(repo.DeleteDeploykey)
|
||||
})
|
||||
m.Group("/issues", func() {
|
||||
m.Combo("").Get(repo.ListIssues).Post(bind(api.CreateIssueOption{}), repo.CreateIssue)
|
||||
m.Combo("/:index").Get(repo.GetIssue).Patch(bind(api.EditIssueOption{}), repo.EditIssue)
|
||||
})
|
||||
}, RepoAssignment())
|
||||
}, ReqToken())
|
||||
|
||||
@@ -201,7 +207,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Get("/users/:username/orgs", org.ListUserOrgs)
|
||||
m.Combo("/orgs/:orgname").Get(org.Get).Patch(bind(api.EditOrgOption{}), org.Edit)
|
||||
|
||||
m.Any("/*", func(ctx *middleware.Context) {
|
||||
m.Any("/*", func(ctx *context.Context) {
|
||||
ctx.Error(404)
|
||||
})
|
||||
|
||||
@@ -218,5 +224,5 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
})
|
||||
})
|
||||
}, ReqAdmin())
|
||||
})
|
||||
}, context.APIContexter())
|
||||
}
|
||||
|
||||
@@ -9,15 +9,19 @@ import (
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
"github.com/gogits/git-module"
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
// ToApiUser converts user to its API format.
|
||||
func ToApiUser(u *models.User) *api.User {
|
||||
func ToUser(u *models.User) *api.User {
|
||||
if u == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &api.User{
|
||||
ID: u.Id,
|
||||
UserName: u.Name,
|
||||
@@ -27,7 +31,7 @@ func ToApiUser(u *models.User) *api.User {
|
||||
}
|
||||
}
|
||||
|
||||
func ToApiEmail(email *models.EmailAddress) *api.Email {
|
||||
func ToEmail(email *models.EmailAddress) *api.Email {
|
||||
return &api.Email{
|
||||
Email: email.Email,
|
||||
Verified: email.IsActivated,
|
||||
@@ -35,12 +39,11 @@ func ToApiEmail(email *models.EmailAddress) *api.Email {
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiRepository converts repository to API format.
|
||||
func ToApiRepository(owner *models.User, repo *models.Repository, permission api.Permission) *api.Repository {
|
||||
func ToRepository(owner *models.User, repo *models.Repository, permission api.Permission) *api.Repository {
|
||||
cl := repo.CloneLink()
|
||||
return &api.Repository{
|
||||
Id: repo.ID,
|
||||
Owner: *ToApiUser(owner),
|
||||
ID: repo.ID,
|
||||
Owner: ToUser(owner),
|
||||
FullName: owner.Name + "/" + repo.Name,
|
||||
Private: repo.IsPrivate,
|
||||
Fork: repo.IsFork,
|
||||
@@ -51,30 +54,27 @@ func ToApiRepository(owner *models.User, repo *models.Repository, permission api
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiBranch converts user to its API format.
|
||||
func ToApiBranch(b *models.Branch,c *git.Commit) *api.Branch {
|
||||
func ToBranch(b *models.Branch, c *git.Commit) *api.Branch {
|
||||
return &api.Branch{
|
||||
Name: b.Name,
|
||||
Commit: ToApiCommit(c),
|
||||
}
|
||||
Name: b.Name,
|
||||
Commit: ToCommit(c),
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiCommit converts user to its API format.
|
||||
func ToApiCommit(c *git.Commit) *api.PayloadCommit {
|
||||
func ToCommit(c *git.Commit) *api.PayloadCommit {
|
||||
return &api.PayloadCommit{
|
||||
ID: c.ID.String(),
|
||||
ID: c.ID.String(),
|
||||
Message: c.Message(),
|
||||
URL: "Not implemented",
|
||||
URL: "Not implemented",
|
||||
Author: &api.PayloadAuthor{
|
||||
Name: c.Committer.Name,
|
||||
Name: c.Committer.Name,
|
||||
Email: c.Committer.Email,
|
||||
/* UserName: c.Committer.UserName, */
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiPublicKey converts public key to its API format.
|
||||
func ToApiPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
|
||||
func ToPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
|
||||
return &api.PublicKey{
|
||||
ID: key.ID,
|
||||
Key: key.Content,
|
||||
@@ -84,8 +84,7 @@ func ToApiPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiHook converts webhook to its API format.
|
||||
func ToApiHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||
func ToHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||
config := map[string]string{
|
||||
"url": w.URL,
|
||||
"content_type": w.ContentType.Name(),
|
||||
@@ -110,8 +109,7 @@ func ToApiHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiDeployKey converts deploy key to its API format.
|
||||
func ToApiDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
|
||||
func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
|
||||
return &api.DeployKey{
|
||||
ID: key.ID,
|
||||
Key: key.Content,
|
||||
@@ -122,7 +120,72 @@ func ToApiDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
|
||||
}
|
||||
}
|
||||
|
||||
func ToApiOrganization(org *models.User) *api.Organization {
|
||||
func ToLabel(label *models.Label) *api.Label {
|
||||
return &api.Label{
|
||||
Name: label.Name,
|
||||
Color: label.Color,
|
||||
}
|
||||
}
|
||||
|
||||
func ToMilestone(milestone *models.Milestone) *api.Milestone {
|
||||
if milestone == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
apiMilestone := &api.Milestone{
|
||||
ID: milestone.ID,
|
||||
State: milestone.State(),
|
||||
Title: milestone.Name,
|
||||
Description: milestone.Content,
|
||||
OpenIssues: milestone.NumOpenIssues,
|
||||
ClosedIssues: milestone.NumClosedIssues,
|
||||
}
|
||||
if milestone.IsClosed {
|
||||
apiMilestone.Closed = &milestone.ClosedDate
|
||||
}
|
||||
if milestone.Deadline.Year() < 9999 {
|
||||
apiMilestone.Deadline = &milestone.Deadline
|
||||
}
|
||||
return apiMilestone
|
||||
}
|
||||
|
||||
func ToIssue(issue *models.Issue) *api.Issue {
|
||||
apiLabels := make([]*api.Label, len(issue.Labels))
|
||||
for i := range issue.Labels {
|
||||
apiLabels[i] = ToLabel(issue.Labels[i])
|
||||
}
|
||||
|
||||
apiIssue := &api.Issue{
|
||||
ID: issue.ID,
|
||||
Index: issue.Index,
|
||||
State: issue.State(),
|
||||
Title: issue.Name,
|
||||
Body: issue.Content,
|
||||
User: ToUser(issue.Poster),
|
||||
Labels: apiLabels,
|
||||
Assignee: ToUser(issue.Assignee),
|
||||
Milestone: ToMilestone(issue.Milestone),
|
||||
Comments: issue.NumComments,
|
||||
Created: issue.Created,
|
||||
Updated: issue.Updated,
|
||||
}
|
||||
if issue.IsPull {
|
||||
if err := issue.GetPullRequest(); err != nil {
|
||||
log.Error(4, "GetPullRequest", err)
|
||||
} else {
|
||||
apiIssue.PullRequest = &api.PullRequestMeta{
|
||||
HasMerged: issue.PullRequest.HasMerged,
|
||||
}
|
||||
if issue.PullRequest.HasMerged {
|
||||
apiIssue.PullRequest.Merged = &issue.PullRequest.Merged
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return apiIssue
|
||||
}
|
||||
|
||||
func ToOrganization(org *models.User) *api.Organization {
|
||||
return &api.Organization{
|
||||
ID: org.Id,
|
||||
AvatarUrl: org.AvatarLink(),
|
||||
|
||||
@@ -7,14 +7,14 @@ package misc
|
||||
import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/markdown"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Miscellaneous#render-an-arbitrary-markdown-document
|
||||
func Markdown(ctx *middleware.Context, form api.MarkdownOption) {
|
||||
func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
|
||||
if ctx.HasApiError() {
|
||||
ctx.APIError(422, "", ctx.GetErrMsg())
|
||||
ctx.Error(422, "", ctx.GetErrMsg())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -32,10 +32,10 @@ func Markdown(ctx *middleware.Context, form api.MarkdownOption) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Miscellaneous#render-a-markdown-document-in-raw-mode
|
||||
func MarkdownRaw(ctx *middleware.Context) {
|
||||
func MarkdownRaw(ctx *context.APIContext) {
|
||||
body, err := ctx.Req.Body().Bytes()
|
||||
if err != nil {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
return
|
||||
}
|
||||
ctx.Write(markdown.RenderRaw(body, ""))
|
||||
|
||||
@@ -8,31 +8,31 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
"github.com/gogits/gogs/routers/api/v1/user"
|
||||
)
|
||||
|
||||
func listUserOrgs(ctx *middleware.Context, u *models.User, all bool) {
|
||||
func listUserOrgs(ctx *context.APIContext, u *models.User, all bool) {
|
||||
if err := u.GetOrganizations(all); err != nil {
|
||||
ctx.APIError(500, "GetOrganizations", err)
|
||||
ctx.Error(500, "GetOrganizations", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiOrgs := make([]*api.Organization, len(u.Orgs))
|
||||
for i := range u.Orgs {
|
||||
apiOrgs[i] = convert.ToApiOrganization(u.Orgs[i])
|
||||
apiOrgs[i] = convert.ToOrganization(u.Orgs[i])
|
||||
}
|
||||
ctx.JSON(200, &apiOrgs)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#list-your-organizations
|
||||
func ListMyOrgs(ctx *middleware.Context) {
|
||||
func ListMyOrgs(ctx *context.APIContext) {
|
||||
listUserOrgs(ctx, ctx.User, true)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#list-user-organizations
|
||||
func ListUserOrgs(ctx *middleware.Context) {
|
||||
func ListUserOrgs(ctx *context.APIContext) {
|
||||
u := user.GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -41,23 +41,23 @@ func ListUserOrgs(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#get-an-organization
|
||||
func Get(ctx *middleware.Context) {
|
||||
func Get(ctx *context.APIContext) {
|
||||
org := user.GetUserByParamsName(ctx, ":orgname")
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.JSON(200, convert.ToApiOrganization(org))
|
||||
ctx.JSON(200, convert.ToOrganization(org))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization
|
||||
func Edit(ctx *middleware.Context, form api.EditOrgOption) {
|
||||
func Edit(ctx *context.APIContext, form api.EditOrgOption) {
|
||||
org := user.GetUserByParamsName(ctx, ":orgname")
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
if !org.IsOwnedBy(ctx.User.Id) {
|
||||
ctx.Error(403)
|
||||
ctx.Status(403)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -66,9 +66,9 @@ func Edit(ctx *middleware.Context, form api.EditOrgOption) {
|
||||
org.Website = form.Website
|
||||
org.Location = form.Location
|
||||
if err := models.UpdateUser(org); err != nil {
|
||||
ctx.APIError(500, "UpdateUser", err)
|
||||
ctx.Error(500, "UpdateUser", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, convert.ToApiOrganization(org))
|
||||
ctx.JSON(200, convert.ToOrganization(org))
|
||||
}
|
||||
|
||||
@@ -7,32 +7,32 @@ package repo
|
||||
import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#get-branch
|
||||
func GetBranch(ctx *middleware.Context) {
|
||||
func GetBranch(ctx *context.APIContext) {
|
||||
branch, err := ctx.Repo.Repository.GetBranch(ctx.Params(":branchname"))
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetBranch", err)
|
||||
ctx.Error(500, "GetBranch", err)
|
||||
return
|
||||
}
|
||||
|
||||
c, err := branch.GetCommit()
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetCommit", err)
|
||||
ctx.Error(500, "GetCommit", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, convert.ToApiBranch(branch, c))
|
||||
ctx.JSON(200, convert.ToBranch(branch, c))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-branches
|
||||
func ListBranches(ctx *middleware.Context) {
|
||||
func ListBranches(ctx *context.APIContext) {
|
||||
branches, err := ctx.Repo.Repository.GetBranches()
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetBranches", err)
|
||||
ctx.Error(500, "GetBranches", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ func ListBranches(ctx *middleware.Context) {
|
||||
for i := range branches {
|
||||
c, err := branches[i].GetCommit()
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetCommit", err)
|
||||
ctx.Error(500, "GetCommit", err)
|
||||
return
|
||||
}
|
||||
apiBranches[i] = convert.ToApiBranch(branches[i], c)
|
||||
apiBranches[i] = convert.ToBranch(branches[i], c)
|
||||
}
|
||||
|
||||
ctx.JSON(200, &apiBranches)
|
||||
|
||||
@@ -8,40 +8,40 @@ import (
|
||||
"github.com/gogits/git-module"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/repo"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Contents#download-raw-content
|
||||
func GetRawFile(ctx *middleware.Context) {
|
||||
func GetRawFile(ctx *context.APIContext) {
|
||||
if !ctx.Repo.HasAccess() {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
return
|
||||
}
|
||||
|
||||
blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreeName)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetBlobByPath", err)
|
||||
ctx.Error(500, "GetBlobByPath", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
if err = repo.ServeBlob(ctx, blob); err != nil {
|
||||
ctx.APIError(500, "ServeBlob", err)
|
||||
if err = repo.ServeBlob(ctx.Context, blob); err != nil {
|
||||
ctx.Error(500, "ServeBlob", err)
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Contents#download-archive
|
||||
func GetArchive(ctx *middleware.Context) {
|
||||
func GetArchive(ctx *context.APIContext) {
|
||||
repoPath := models.RepoPath(ctx.Params(":username"), ctx.Params(":reponame"))
|
||||
gitRepo, err := git.OpenRepository(repoPath)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "OpenRepository", err)
|
||||
ctx.Error(500, "OpenRepository", err)
|
||||
return
|
||||
}
|
||||
ctx.Repo.GitRepo = gitRepo
|
||||
|
||||
repo.Download(ctx)
|
||||
repo.Download(ctx.Context)
|
||||
}
|
||||
|
||||
@@ -12,40 +12,39 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks
|
||||
func ListHooks(ctx *middleware.Context) {
|
||||
func ListHooks(ctx *context.APIContext) {
|
||||
hooks, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetWebhooksByRepoID", err)
|
||||
ctx.Error(500, "GetWebhooksByRepoID", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiHooks := make([]*api.Hook, len(hooks))
|
||||
for i := range hooks {
|
||||
apiHooks[i] = convert.ToApiHook(ctx.Repo.RepoLink, hooks[i])
|
||||
apiHooks[i] = convert.ToHook(ctx.Repo.RepoLink, hooks[i])
|
||||
}
|
||||
|
||||
ctx.JSON(200, &apiHooks)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#create-a-hook
|
||||
func CreateHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
|
||||
if !models.IsValidHookTaskType(form.Type) {
|
||||
ctx.APIError(422, "", "Invalid hook type")
|
||||
ctx.Error(422, "", "Invalid hook type")
|
||||
return
|
||||
}
|
||||
for _, name := range []string{"url", "content_type"} {
|
||||
if _, ok := form.Config[name]; !ok {
|
||||
ctx.APIError(422, "", "Missing config option: "+name)
|
||||
ctx.Error(422, "", "Missing config option: "+name)
|
||||
return
|
||||
}
|
||||
}
|
||||
if !models.IsValidHookContentType(form.Config["content_type"]) {
|
||||
ctx.APIError(422, "", "Invalid content type")
|
||||
ctx.Error(422, "", "Invalid content type")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -70,7 +69,7 @@ func CreateHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
if w.HookTaskType == models.SLACK {
|
||||
channel, ok := form.Config["channel"]
|
||||
if !ok {
|
||||
ctx.APIError(422, "", "Missing config option: channel")
|
||||
ctx.Error(422, "", "Missing config option: channel")
|
||||
return
|
||||
}
|
||||
meta, err := json.Marshal(&models.SlackMeta{
|
||||
@@ -80,31 +79,31 @@ func CreateHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
Color: form.Config["color"],
|
||||
})
|
||||
if err != nil {
|
||||
ctx.APIError(500, "slack: JSON marshal failed", err)
|
||||
ctx.Error(500, "slack: JSON marshal failed", err)
|
||||
return
|
||||
}
|
||||
w.Meta = string(meta)
|
||||
}
|
||||
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
ctx.APIError(500, "UpdateEvent", err)
|
||||
ctx.Error(500, "UpdateEvent", err)
|
||||
return
|
||||
} else if err := models.CreateWebhook(w); err != nil {
|
||||
ctx.APIError(500, "CreateWebhook", err)
|
||||
ctx.Error(500, "CreateWebhook", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(201, convert.ToApiHook(ctx.Repo.RepoLink, w))
|
||||
ctx.JSON(201, convert.ToHook(ctx.Repo.RepoLink, w))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#edit-a-hook
|
||||
func EditHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
func EditHook(ctx *context.APIContext, form api.EditHookOption) {
|
||||
w, err := models.GetWebhookByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrWebhookNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetWebhookByID", err)
|
||||
ctx.Error(500, "GetWebhookByID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -115,7 +114,7 @@ func EditHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
}
|
||||
if ct, ok := form.Config["content_type"]; ok {
|
||||
if !models.IsValidHookContentType(ct) {
|
||||
ctx.APIError(422, "", "Invalid content type")
|
||||
ctx.Error(422, "", "Invalid content type")
|
||||
return
|
||||
}
|
||||
w.ContentType = models.ToHookContentType(ct)
|
||||
@@ -130,7 +129,7 @@ func EditHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
Color: form.Config["color"],
|
||||
})
|
||||
if err != nil {
|
||||
ctx.APIError(500, "slack: JSON marshal failed", err)
|
||||
ctx.Error(500, "slack: JSON marshal failed", err)
|
||||
return
|
||||
}
|
||||
w.Meta = string(meta)
|
||||
@@ -148,7 +147,7 @@ func EditHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
w.Create = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE))
|
||||
w.Push = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH))
|
||||
if err = w.UpdateEvent(); err != nil {
|
||||
ctx.APIError(500, "UpdateEvent", err)
|
||||
ctx.Error(500, "UpdateEvent", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -157,9 +156,9 @@ func EditHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
}
|
||||
|
||||
if err := models.UpdateWebhook(w); err != nil {
|
||||
ctx.APIError(500, "UpdateWebhook", err)
|
||||
ctx.Error(500, "UpdateWebhook", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, convert.ToApiHook(ctx.Repo.RepoLink, w))
|
||||
ctx.JSON(200, convert.ToHook(ctx.Repo.RepoLink, w))
|
||||
}
|
||||
|
||||
165
routers/api/v1/repo/issue.go
Normal file
165
routers/api/v1/repo/issue.go
Normal file
@@ -0,0 +1,165 @@
|
||||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package repo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
"github.com/gogits/gogs/routers/repo"
|
||||
)
|
||||
|
||||
func ListIssues(ctx *context.APIContext) {
|
||||
issues, err := models.Issues(&models.IssuesOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Page: ctx.QueryInt("page"),
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Error(500, "Issues", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiIssues := make([]*api.Issue, len(issues))
|
||||
for i := range issues {
|
||||
apiIssues[i] = convert.ToIssue(issues[i])
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(ctx.Repo.Repository.NumIssues, setting.IssuePagingNum)
|
||||
ctx.JSON(200, &apiIssues)
|
||||
}
|
||||
|
||||
func GetIssue(ctx *context.APIContext) {
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
if models.IsErrIssueNotExist(err) {
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.Error(500, "GetIssueByIndex", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, convert.ToIssue(issue))
|
||||
}
|
||||
|
||||
func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
|
||||
issue := &models.Issue{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Name: form.Title,
|
||||
PosterID: ctx.User.Id,
|
||||
Poster: ctx.User,
|
||||
Content: form.Body,
|
||||
}
|
||||
|
||||
if ctx.Repo.IsWriter() {
|
||||
if len(form.Assignee) > 0 {
|
||||
assignee, err := models.GetUserByName(form.Assignee)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(422, "", fmt.Sprintf("Assignee does not exist: [name: %s]", form.Assignee))
|
||||
} else {
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
issue.AssigneeID = assignee.Id
|
||||
}
|
||||
issue.MilestoneID = form.Milestone
|
||||
} else {
|
||||
form.Labels = nil
|
||||
}
|
||||
|
||||
if err := models.NewIssue(ctx.Repo.Repository, issue, form.Labels, nil); err != nil {
|
||||
ctx.Error(500, "NewIssue", err)
|
||||
return
|
||||
} else if err := repo.MailWatchersAndMentions(ctx.Context, issue); err != nil {
|
||||
ctx.Error(500, "MailWatchersAndMentions", err)
|
||||
return
|
||||
}
|
||||
|
||||
// Refetch from database to assign some automatic values
|
||||
var err error
|
||||
issue, err = models.GetIssueByID(issue.ID)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetIssueByID", err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(201, convert.ToIssue(issue))
|
||||
}
|
||||
|
||||
func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
if models.IsErrIssueNotExist(err) {
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.Error(500, "GetIssueByIndex", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if !issue.IsPoster(ctx.User.Id) && !ctx.Repo.IsWriter() {
|
||||
ctx.Status(403)
|
||||
return
|
||||
}
|
||||
|
||||
if len(form.Title) > 0 {
|
||||
issue.Name = form.Title
|
||||
}
|
||||
if form.Body != nil {
|
||||
issue.Content = *form.Body
|
||||
}
|
||||
|
||||
if ctx.Repo.IsWriter() && form.Assignee != nil &&
|
||||
(issue.Assignee == nil || issue.Assignee.LowerName != strings.ToLower(*form.Assignee)) {
|
||||
if len(*form.Assignee) == 0 {
|
||||
issue.AssigneeID = 0
|
||||
} else {
|
||||
assignee, err := models.GetUserByName(*form.Assignee)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(422, "", fmt.Sprintf("Assignee does not exist: [name: %s]", *form.Assignee))
|
||||
} else {
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
issue.AssigneeID = assignee.Id
|
||||
}
|
||||
|
||||
if err = models.UpdateIssueUserByAssignee(issue); err != nil {
|
||||
ctx.Error(500, "UpdateIssueUserByAssignee", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if ctx.Repo.IsWriter() && form.Milestone != nil &&
|
||||
issue.MilestoneID != *form.Milestone {
|
||||
oldMid := issue.MilestoneID
|
||||
issue.MilestoneID = *form.Milestone
|
||||
if err = models.ChangeMilestoneAssign(oldMid, issue); err != nil {
|
||||
ctx.Error(500, "ChangeMilestoneAssign", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err = models.UpdateIssue(issue); err != nil {
|
||||
ctx.Error(500, "UpdateIssue", err)
|
||||
return
|
||||
}
|
||||
|
||||
// Refetch from database to assign some automatic values
|
||||
issue, err = models.GetIssueByID(issue.ID)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetIssueByID", err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(201, convert.ToIssue(issue))
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
@@ -20,10 +20,10 @@ func composeDeployKeysAPILink(repoPath string) string {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Deploy-Keys#list-deploy-keys
|
||||
func ListDeployKeys(ctx *middleware.Context) {
|
||||
func ListDeployKeys(ctx *context.APIContext) {
|
||||
keys, err := models.ListDeployKeys(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "ListDeployKeys", err)
|
||||
ctx.Error(500, "ListDeployKeys", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -31,57 +31,57 @@ func ListDeployKeys(ctx *middleware.Context) {
|
||||
apiKeys := make([]*api.DeployKey, len(keys))
|
||||
for i := range keys {
|
||||
if err = keys[i].GetContent(); err != nil {
|
||||
ctx.APIError(500, "GetContent", err)
|
||||
ctx.Error(500, "GetContent", err)
|
||||
return
|
||||
}
|
||||
apiKeys[i] = convert.ToApiDeployKey(apiLink, keys[i])
|
||||
apiKeys[i] = convert.ToDeployKey(apiLink, keys[i])
|
||||
}
|
||||
|
||||
ctx.JSON(200, &apiKeys)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Deploy-Keys#get-a-deploy-key
|
||||
func GetDeployKey(ctx *middleware.Context) {
|
||||
func GetDeployKey(ctx *context.APIContext) {
|
||||
key, err := models.GetDeployKeyByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrDeployKeyNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.Handle(500, "GetDeployKeyByID", err)
|
||||
ctx.Error(500, "GetDeployKeyByID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if err = key.GetContent(); err != nil {
|
||||
ctx.APIError(500, "GetContent", err)
|
||||
ctx.Error(500, "GetContent", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiLink := composeDeployKeysAPILink(ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name)
|
||||
ctx.JSON(200, convert.ToApiDeployKey(apiLink, key))
|
||||
ctx.JSON(200, convert.ToDeployKey(apiLink, key))
|
||||
}
|
||||
|
||||
func HandleCheckKeyStringError(ctx *middleware.Context, err error) {
|
||||
func HandleCheckKeyStringError(ctx *context.APIContext, err error) {
|
||||
if models.IsErrKeyUnableVerify(err) {
|
||||
ctx.APIError(422, "", "Unable to verify key content")
|
||||
ctx.Error(422, "", "Unable to verify key content")
|
||||
} else {
|
||||
ctx.APIError(422, "", fmt.Errorf("Invalid key content: %v", err))
|
||||
ctx.Error(422, "", fmt.Errorf("Invalid key content: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
func HandleAddKeyError(ctx *middleware.Context, err error) {
|
||||
func HandleAddKeyError(ctx *context.APIContext, err error) {
|
||||
switch {
|
||||
case models.IsErrKeyAlreadyExist(err):
|
||||
ctx.APIError(422, "", "Key content has been used as non-deploy key")
|
||||
ctx.Error(422, "", "Key content has been used as non-deploy key")
|
||||
case models.IsErrKeyNameAlreadyUsed(err):
|
||||
ctx.APIError(422, "", "Key title has been used")
|
||||
ctx.Error(422, "", "Key title has been used")
|
||||
default:
|
||||
ctx.APIError(500, "AddKey", err)
|
||||
ctx.Error(500, "AddKey", err)
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Deploy-Keys#add-a-new-deploy-key
|
||||
func CreateDeployKey(ctx *middleware.Context, form api.CreateKeyOption) {
|
||||
func CreateDeployKey(ctx *context.APIContext, form api.CreateKeyOption) {
|
||||
content, err := models.CheckPublicKeyString(form.Key)
|
||||
if err != nil {
|
||||
HandleCheckKeyStringError(ctx, err)
|
||||
@@ -96,16 +96,16 @@ func CreateDeployKey(ctx *middleware.Context, form api.CreateKeyOption) {
|
||||
|
||||
key.Content = content
|
||||
apiLink := composeDeployKeysAPILink(ctx.Repo.Owner.Name + "/" + ctx.Repo.Repository.Name)
|
||||
ctx.JSON(201, convert.ToApiDeployKey(apiLink, key))
|
||||
ctx.JSON(201, convert.ToDeployKey(apiLink, key))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories-Deploy-Keys#remove-a-deploy-key
|
||||
func DeleteDeploykey(ctx *middleware.Context) {
|
||||
func DeleteDeploykey(ctx *context.APIContext) {
|
||||
if err := models.DeleteDeployKey(ctx.User, ctx.ParamsInt64(":id")); err != nil {
|
||||
if models.IsErrKeyAccessDenied(err) {
|
||||
ctx.APIError(403, "", "You do not have access to this key")
|
||||
ctx.Error(403, "", "You do not have access to this key")
|
||||
} else {
|
||||
ctx.APIError(500, "DeleteDeployKey", err)
|
||||
ctx.Error(500, "DeleteDeployKey", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -13,29 +13,29 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#search-repositories
|
||||
func Search(ctx *middleware.Context) {
|
||||
opt := models.SearchOption{
|
||||
Keyword: path.Base(ctx.Query("q")),
|
||||
Uid: com.StrTo(ctx.Query("uid")).MustInt64(),
|
||||
Limit: com.StrTo(ctx.Query("limit")).MustInt(),
|
||||
func Search(ctx *context.APIContext) {
|
||||
opts := &models.SearchRepoOptions{
|
||||
Keyword: path.Base(ctx.Query("q")),
|
||||
OwnerID: com.StrTo(ctx.Query("uid")).MustInt64(),
|
||||
PageSize: com.StrTo(ctx.Query("limit")).MustInt(),
|
||||
}
|
||||
if opt.Limit == 0 {
|
||||
opt.Limit = 10
|
||||
if opts.PageSize == 0 {
|
||||
opts.PageSize = 10
|
||||
}
|
||||
|
||||
// Check visibility.
|
||||
if ctx.IsSigned && opt.Uid > 0 {
|
||||
if ctx.User.Id == opt.Uid {
|
||||
opt.Private = true
|
||||
if ctx.IsSigned && opts.OwnerID > 0 {
|
||||
if ctx.User.Id == opts.OwnerID {
|
||||
opts.Private = true
|
||||
} else {
|
||||
u, err := models.GetUserByID(opt.Uid)
|
||||
u, err := models.GetUserByID(opts.OwnerID)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
"ok": false,
|
||||
@@ -44,13 +44,13 @@ func Search(ctx *middleware.Context) {
|
||||
return
|
||||
}
|
||||
if u.IsOrganization() && u.IsOwnedBy(ctx.User.Id) {
|
||||
opt.Private = true
|
||||
opts.Private = true
|
||||
}
|
||||
// FIXME: how about collaborators?
|
||||
}
|
||||
}
|
||||
|
||||
repos, err := models.SearchRepositoryByName(opt)
|
||||
repos, _, err := models.SearchRepositoryByName(opts)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
"ok": false,
|
||||
@@ -69,7 +69,7 @@ func Search(ctx *middleware.Context) {
|
||||
return
|
||||
}
|
||||
results[i] = &api.Repository{
|
||||
Id: repos[i].ID,
|
||||
ID: repos[i].ID,
|
||||
FullName: path.Join(repos[i].Owner.Name, repos[i].Name),
|
||||
}
|
||||
}
|
||||
@@ -81,28 +81,28 @@ func Search(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-your-repositories
|
||||
func ListMyRepos(ctx *middleware.Context) {
|
||||
func ListMyRepos(ctx *context.APIContext) {
|
||||
ownRepos, err := models.GetRepositories(ctx.User.Id, true)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetRepositories", err)
|
||||
ctx.Error(500, "GetRepositories", err)
|
||||
return
|
||||
}
|
||||
numOwnRepos := len(ownRepos)
|
||||
|
||||
accessibleRepos, err := ctx.User.GetRepositoryAccesses()
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetRepositoryAccesses", err)
|
||||
ctx.Error(500, "GetRepositoryAccesses", err)
|
||||
return
|
||||
}
|
||||
|
||||
repos := make([]*api.Repository, numOwnRepos+len(accessibleRepos))
|
||||
for i := range ownRepos {
|
||||
repos[i] = convert.ToApiRepository(ctx.User, ownRepos[i], api.Permission{true, true, true})
|
||||
repos[i] = convert.ToRepository(ctx.User, ownRepos[i], api.Permission{true, true, true})
|
||||
}
|
||||
i := numOwnRepos
|
||||
|
||||
for repo, access := range accessibleRepos {
|
||||
repos[i] = convert.ToApiRepository(repo.Owner, repo, api.Permission{
|
||||
repos[i] = convert.ToRepository(repo.Owner, repo, api.Permission{
|
||||
Admin: access >= models.ACCESS_MODE_ADMIN,
|
||||
Push: access >= models.ACCESS_MODE_WRITE,
|
||||
Pull: true,
|
||||
@@ -113,7 +113,7 @@ func ListMyRepos(ctx *middleware.Context) {
|
||||
ctx.JSON(200, &repos)
|
||||
}
|
||||
|
||||
func CreateUserRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoOption) {
|
||||
func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateRepoOption) {
|
||||
repo, err := models.CreateRepository(owner, models.CreateRepoOptions{
|
||||
Name: opt.Name,
|
||||
Description: opt.Description,
|
||||
@@ -127,51 +127,51 @@ func CreateUserRepo(ctx *middleware.Context, owner *models.User, opt api.CreateR
|
||||
if models.IsErrRepoAlreadyExist(err) ||
|
||||
models.IsErrNameReserved(err) ||
|
||||
models.IsErrNamePatternNotAllowed(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
if repo != nil {
|
||||
if err = models.DeleteRepository(ctx.User.Id, repo.ID); err != nil {
|
||||
log.Error(4, "DeleteRepository: %v", err)
|
||||
}
|
||||
}
|
||||
ctx.APIError(500, "CreateRepository", err)
|
||||
ctx.Error(500, "CreateRepository", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(201, convert.ToApiRepository(owner, repo, api.Permission{true, true, true}))
|
||||
ctx.JSON(201, convert.ToRepository(owner, repo, api.Permission{true, true, true}))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#create
|
||||
func Create(ctx *middleware.Context, opt api.CreateRepoOption) {
|
||||
func Create(ctx *context.APIContext, opt api.CreateRepoOption) {
|
||||
// Shouldn't reach this condition, but just in case.
|
||||
if ctx.User.IsOrganization() {
|
||||
ctx.APIError(422, "", "not allowed creating repository for organization")
|
||||
ctx.Error(422, "", "not allowed creating repository for organization")
|
||||
return
|
||||
}
|
||||
CreateUserRepo(ctx, ctx.User, opt)
|
||||
}
|
||||
|
||||
func CreateOrgRepo(ctx *middleware.Context, opt api.CreateRepoOption) {
|
||||
func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
|
||||
org, err := models.GetOrgByName(ctx.Params(":org"))
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "GetOrgByName", err)
|
||||
ctx.Error(500, "GetOrgByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if !org.IsOwnedBy(ctx.User.Id) {
|
||||
ctx.APIError(403, "", "Given user is not owner of organization.")
|
||||
ctx.Error(403, "", "Given user is not owner of organization.")
|
||||
return
|
||||
}
|
||||
CreateUserRepo(ctx, org, opt)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#migrate
|
||||
func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
func Migrate(ctx *context.APIContext, form auth.MigrateRepoForm) {
|
||||
ctxUser := ctx.User
|
||||
// Not equal means context user is an organization,
|
||||
// or is another user/organization if current user is admin.
|
||||
@@ -179,9 +179,9 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
org, err := models.GetUserByID(form.Uid)
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "GetUserByID", err)
|
||||
ctx.Error(500, "GetUserByID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -189,14 +189,14 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
}
|
||||
|
||||
if ctx.HasError() {
|
||||
ctx.APIError(422, "", ctx.GetErrMsg())
|
||||
ctx.Error(422, "", ctx.GetErrMsg())
|
||||
return
|
||||
}
|
||||
|
||||
if ctxUser.IsOrganization() && !ctx.User.IsAdmin {
|
||||
// Check ownership of organization.
|
||||
if !ctxUser.IsOwnedBy(ctx.User.Id) {
|
||||
ctx.APIError(403, "", "Given user is not owner of organization.")
|
||||
ctx.Error(403, "", "Given user is not owner of organization.")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -207,16 +207,16 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
addrErr := err.(models.ErrInvalidCloneAddr)
|
||||
switch {
|
||||
case addrErr.IsURLError:
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
case addrErr.IsPermissionDenied:
|
||||
ctx.APIError(422, "", "You are not allowed to import local repositories.")
|
||||
ctx.Error(422, "", "You are not allowed to import local repositories.")
|
||||
case addrErr.IsInvalidPath:
|
||||
ctx.APIError(422, "", "Invalid local path, it does not exist or not a directory.")
|
||||
ctx.Error(422, "", "Invalid local path, it does not exist or not a directory.")
|
||||
default:
|
||||
ctx.APIError(500, "ParseRemoteAddr", "Unknown error type (ErrInvalidCloneAddr): "+err.Error())
|
||||
ctx.Error(500, "ParseRemoteAddr", "Unknown error type (ErrInvalidCloneAddr): "+err.Error())
|
||||
}
|
||||
} else {
|
||||
ctx.APIError(500, "ParseRemoteAddr", err)
|
||||
ctx.Error(500, "ParseRemoteAddr", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -234,21 +234,21 @@ func Migrate(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
log.Error(4, "DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
ctx.APIError(500, "MigrateRepository", models.HandleCloneUserCredentials(err.Error(), true))
|
||||
ctx.Error(500, "MigrateRepository", models.HandleCloneUserCredentials(err.Error(), true))
|
||||
return
|
||||
}
|
||||
|
||||
log.Trace("Repository migrated: %s/%s", ctxUser.Name, form.RepoName)
|
||||
ctx.JSON(201, convert.ToApiRepository(ctxUser, repo, api.Permission{true, true, true}))
|
||||
ctx.JSON(201, convert.ToRepository(ctxUser, repo, api.Permission{true, true, true}))
|
||||
}
|
||||
|
||||
func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repository) {
|
||||
func parseOwnerAndRepo(ctx *context.APIContext) (*models.User, *models.Repository) {
|
||||
owner, err := models.GetUserByName(ctx.Params(":username"))
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.APIError(422, "", err)
|
||||
ctx.Error(422, "", err)
|
||||
} else {
|
||||
ctx.APIError(500, "GetUserByName", err)
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
@@ -256,9 +256,9 @@ func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repositor
|
||||
repo, err := models.GetRepositoryByName(owner.Id, ctx.Params(":reponame"))
|
||||
if err != nil {
|
||||
if models.IsErrRepoNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetRepositoryByName", err)
|
||||
ctx.Error(500, "GetRepositoryByName", err)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
@@ -267,29 +267,29 @@ func parseOwnerAndRepo(ctx *middleware.Context) (*models.User, *models.Repositor
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#get
|
||||
func Get(ctx *middleware.Context) {
|
||||
func Get(ctx *context.APIContext) {
|
||||
owner, repo := parseOwnerAndRepo(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, convert.ToApiRepository(owner, repo, api.Permission{true, true, true}))
|
||||
ctx.JSON(200, convert.ToRepository(owner, repo, api.Permission{true, true, true}))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#delete
|
||||
func Delete(ctx *middleware.Context) {
|
||||
func Delete(ctx *context.APIContext) {
|
||||
owner, repo := parseOwnerAndRepo(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
||||
if owner.IsOrganization() && !owner.IsOwnedBy(ctx.User.Id) {
|
||||
ctx.APIError(403, "", "Given user is not owner of organization.")
|
||||
ctx.Error(403, "", "Given user is not owner of organization.")
|
||||
return
|
||||
}
|
||||
|
||||
if err := models.DeleteRepository(owner.Id, repo.ID); err != nil {
|
||||
ctx.APIError(500, "DeleteRepository", err)
|
||||
ctx.Error(500, "DeleteRepository", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#list-access-tokens-for-a-user
|
||||
func ListAccessTokens(ctx *middleware.Context) {
|
||||
func ListAccessTokens(ctx *context.APIContext) {
|
||||
tokens, err := models.ListAccessTokens(ctx.User.Id)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "ListAccessTokens", err)
|
||||
ctx.Error(500, "ListAccessTokens", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -27,13 +27,13 @@ func ListAccessTokens(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#create-a-access-token
|
||||
func CreateAccessToken(ctx *middleware.Context, form api.CreateAccessTokenOption) {
|
||||
func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption) {
|
||||
t := &models.AccessToken{
|
||||
UID: ctx.User.Id,
|
||||
Name: form.Name,
|
||||
}
|
||||
if err := models.NewAccessToken(t); err != nil {
|
||||
ctx.APIError(500, "NewAccessToken", err)
|
||||
ctx.Error(500, "NewAccessToken", err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(201, &api.AccessToken{t.Name, t.Sha1})
|
||||
|
||||
@@ -8,27 +8,27 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Emails#list-email-addresses-for-a-user
|
||||
func ListEmails(ctx *middleware.Context) {
|
||||
func ListEmails(ctx *context.APIContext) {
|
||||
emails, err := models.GetEmailAddresses(ctx.User.Id)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetEmailAddresses", err)
|
||||
ctx.Error(500, "GetEmailAddresses", err)
|
||||
return
|
||||
}
|
||||
apiEmails := make([]*api.Email, len(emails))
|
||||
for i := range emails {
|
||||
apiEmails[i] = convert.ToApiEmail(emails[i])
|
||||
apiEmails[i] = convert.ToEmail(emails[i])
|
||||
}
|
||||
ctx.JSON(200, &apiEmails)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Emails#add-email-addresses
|
||||
func AddEmail(ctx *middleware.Context, form api.CreateEmailOption) {
|
||||
func AddEmail(ctx *context.APIContext, form api.CreateEmailOption) {
|
||||
if len(form.Emails) == 0 {
|
||||
ctx.Status(422)
|
||||
return
|
||||
@@ -45,22 +45,22 @@ func AddEmail(ctx *middleware.Context, form api.CreateEmailOption) {
|
||||
|
||||
if err := models.AddEmailAddresses(emails); err != nil {
|
||||
if models.IsErrEmailAlreadyUsed(err) {
|
||||
ctx.APIError(422, "", "Email address has been used: "+err.(models.ErrEmailAlreadyUsed).Email)
|
||||
ctx.Error(422, "", "Email address has been used: "+err.(models.ErrEmailAlreadyUsed).Email)
|
||||
} else {
|
||||
ctx.APIError(500, "AddEmailAddresses", err)
|
||||
ctx.Error(500, "AddEmailAddresses", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
apiEmails := make([]*api.Email, len(emails))
|
||||
for i := range emails {
|
||||
apiEmails[i] = convert.ToApiEmail(emails[i])
|
||||
apiEmails[i] = convert.ToEmail(emails[i])
|
||||
}
|
||||
ctx.JSON(201, &apiEmails)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Emails#delete-email-addresses
|
||||
func DeleteEmail(ctx *middleware.Context, form api.CreateEmailOption) {
|
||||
func DeleteEmail(ctx *context.APIContext, form api.CreateEmailOption) {
|
||||
if len(form.Emails) == 0 {
|
||||
ctx.Status(204)
|
||||
return
|
||||
@@ -74,7 +74,7 @@ func DeleteEmail(ctx *middleware.Context, form api.CreateEmailOption) {
|
||||
}
|
||||
|
||||
if err := models.DeleteEmailAddresses(emails); err != nil {
|
||||
ctx.APIError(500, "DeleteEmailAddresses", err)
|
||||
ctx.Error(500, "DeleteEmailAddresses", err)
|
||||
return
|
||||
}
|
||||
ctx.Status(204)
|
||||
|
||||
@@ -8,33 +8,33 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
func responseApiUsers(ctx *middleware.Context, users []*models.User) {
|
||||
func responseApiUsers(ctx *context.APIContext, users []*models.User) {
|
||||
apiUsers := make([]*api.User, len(users))
|
||||
for i := range users {
|
||||
apiUsers[i] = convert.ToApiUser(users[i])
|
||||
apiUsers[i] = convert.ToUser(users[i])
|
||||
}
|
||||
ctx.JSON(200, &apiUsers)
|
||||
}
|
||||
|
||||
func listUserFollowers(ctx *middleware.Context, u *models.User) {
|
||||
func listUserFollowers(ctx *context.APIContext, u *models.User) {
|
||||
users, err := u.GetFollowers(ctx.QueryInt("page"))
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetUserFollowers", err)
|
||||
ctx.Error(500, "GetUserFollowers", err)
|
||||
return
|
||||
}
|
||||
responseApiUsers(ctx, users)
|
||||
}
|
||||
|
||||
func ListMyFollowers(ctx *middleware.Context) {
|
||||
func ListMyFollowers(ctx *context.APIContext) {
|
||||
listUserFollowers(ctx, ctx.User)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#list-followers-of-a-user
|
||||
func ListFollowers(ctx *middleware.Context) {
|
||||
func ListFollowers(ctx *context.APIContext) {
|
||||
u := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -42,21 +42,21 @@ func ListFollowers(ctx *middleware.Context) {
|
||||
listUserFollowers(ctx, u)
|
||||
}
|
||||
|
||||
func listUserFollowing(ctx *middleware.Context, u *models.User) {
|
||||
func listUserFollowing(ctx *context.APIContext, u *models.User) {
|
||||
users, err := u.GetFollowing(ctx.QueryInt("page"))
|
||||
if err != nil {
|
||||
ctx.APIError(500, "GetFollowing", err)
|
||||
ctx.Error(500, "GetFollowing", err)
|
||||
return
|
||||
}
|
||||
responseApiUsers(ctx, users)
|
||||
}
|
||||
|
||||
func ListMyFollowing(ctx *middleware.Context) {
|
||||
func ListMyFollowing(ctx *context.APIContext) {
|
||||
listUserFollowing(ctx, ctx.User)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#list-users-followed-by-another-user
|
||||
func ListFollowing(ctx *middleware.Context) {
|
||||
func ListFollowing(ctx *context.APIContext) {
|
||||
u := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -64,16 +64,16 @@ func ListFollowing(ctx *middleware.Context) {
|
||||
listUserFollowing(ctx, u)
|
||||
}
|
||||
|
||||
func checkUserFollowing(ctx *middleware.Context, u *models.User, followID int64) {
|
||||
func checkUserFollowing(ctx *context.APIContext, u *models.User, followID int64) {
|
||||
if u.IsFollowing(followID) {
|
||||
ctx.Status(204)
|
||||
} else {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#check-if-you-are-following-a-user
|
||||
func CheckMyFollowing(ctx *middleware.Context) {
|
||||
func CheckMyFollowing(ctx *context.APIContext) {
|
||||
target := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -82,7 +82,7 @@ func CheckMyFollowing(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#check-if-one-user-follows-another
|
||||
func CheckFollowing(ctx *middleware.Context) {
|
||||
func CheckFollowing(ctx *context.APIContext) {
|
||||
u := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -95,26 +95,26 @@ func CheckFollowing(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#follow-a-user
|
||||
func Follow(ctx *middleware.Context) {
|
||||
func Follow(ctx *context.APIContext) {
|
||||
target := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
if err := models.FollowUser(ctx.User.Id, target.Id); err != nil {
|
||||
ctx.APIError(500, "FollowUser", err)
|
||||
ctx.Error(500, "FollowUser", err)
|
||||
return
|
||||
}
|
||||
ctx.Status(204)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Followers#unfollow-a-user
|
||||
func Unfollow(ctx *middleware.Context) {
|
||||
func Unfollow(ctx *context.APIContext) {
|
||||
target := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
if err := models.UnfollowUser(ctx.User.Id, target.Id); err != nil {
|
||||
ctx.APIError(500, "UnfollowUser", err)
|
||||
ctx.Error(500, "UnfollowUser", err)
|
||||
return
|
||||
}
|
||||
ctx.Status(204)
|
||||
|
||||
@@ -8,19 +8,19 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
"github.com/gogits/gogs/routers/api/v1/repo"
|
||||
)
|
||||
|
||||
func GetUserByParamsName(ctx *middleware.Context, name string) *models.User {
|
||||
func GetUserByParamsName(ctx *context.APIContext, name string) *models.User {
|
||||
user, err := models.GetUserByName(ctx.Params(name))
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetUserByName", err)
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func GetUserByParamsName(ctx *middleware.Context, name string) *models.User {
|
||||
}
|
||||
|
||||
// GetUserByParams returns user whose name is presented in URL paramenter.
|
||||
func GetUserByParams(ctx *middleware.Context) *models.User {
|
||||
func GetUserByParams(ctx *context.APIContext) *models.User {
|
||||
return GetUserByParamsName(ctx, ":username")
|
||||
}
|
||||
|
||||
@@ -36,29 +36,29 @@ func composePublicKeysAPILink() string {
|
||||
return setting.AppUrl + "api/v1/user/keys/"
|
||||
}
|
||||
|
||||
func listPublicKeys(ctx *middleware.Context, uid int64) {
|
||||
func listPublicKeys(ctx *context.APIContext, uid int64) {
|
||||
keys, err := models.ListPublicKeys(uid)
|
||||
if err != nil {
|
||||
ctx.APIError(500, "ListPublicKeys", err)
|
||||
ctx.Error(500, "ListPublicKeys", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiLink := composePublicKeysAPILink()
|
||||
apiKeys := make([]*api.PublicKey, len(keys))
|
||||
for i := range keys {
|
||||
apiKeys[i] = convert.ToApiPublicKey(apiLink, keys[i])
|
||||
apiKeys[i] = convert.ToPublicKey(apiLink, keys[i])
|
||||
}
|
||||
|
||||
ctx.JSON(200, &apiKeys)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#list-your-public-keys
|
||||
func ListMyPublicKeys(ctx *middleware.Context) {
|
||||
func ListMyPublicKeys(ctx *context.APIContext) {
|
||||
listPublicKeys(ctx, ctx.User.Id)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#list-public-keys-for-a-user
|
||||
func ListPublicKeys(ctx *middleware.Context) {
|
||||
func ListPublicKeys(ctx *context.APIContext) {
|
||||
user := GetUserByParams(ctx)
|
||||
if ctx.Written() {
|
||||
return
|
||||
@@ -67,23 +67,23 @@ func ListPublicKeys(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#get-a-single-public-key
|
||||
func GetPublicKey(ctx *middleware.Context) {
|
||||
func GetPublicKey(ctx *context.APIContext) {
|
||||
key, err := models.GetPublicKeyByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrKeyNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.Handle(500, "GetPublicKeyByID", err)
|
||||
ctx.Error(500, "GetPublicKeyByID", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
apiLink := composePublicKeysAPILink()
|
||||
ctx.JSON(200, convert.ToApiPublicKey(apiLink, key))
|
||||
ctx.JSON(200, convert.ToPublicKey(apiLink, key))
|
||||
}
|
||||
|
||||
// CreateUserPublicKey creates new public key to given user by ID.
|
||||
func CreateUserPublicKey(ctx *middleware.Context, form api.CreateKeyOption, uid int64) {
|
||||
func CreateUserPublicKey(ctx *context.APIContext, form api.CreateKeyOption, uid int64) {
|
||||
content, err := models.CheckPublicKeyString(form.Key)
|
||||
if err != nil {
|
||||
repo.HandleCheckKeyStringError(ctx, err)
|
||||
@@ -96,21 +96,21 @@ func CreateUserPublicKey(ctx *middleware.Context, form api.CreateKeyOption, uid
|
||||
return
|
||||
}
|
||||
apiLink := composePublicKeysAPILink()
|
||||
ctx.JSON(201, convert.ToApiPublicKey(apiLink, key))
|
||||
ctx.JSON(201, convert.ToPublicKey(apiLink, key))
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#create-a-public-key
|
||||
func CreatePublicKey(ctx *middleware.Context, form api.CreateKeyOption) {
|
||||
func CreatePublicKey(ctx *context.APIContext, form api.CreateKeyOption) {
|
||||
CreateUserPublicKey(ctx, form, ctx.User.Id)
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users-Public-Keys#delete-a-public-key
|
||||
func DeletePublicKey(ctx *middleware.Context) {
|
||||
func DeletePublicKey(ctx *context.APIContext) {
|
||||
if err := models.DeletePublicKey(ctx.User, ctx.ParamsInt64(":id")); err != nil {
|
||||
if models.IsErrKeyAccessDenied(err) {
|
||||
ctx.APIError(403, "", "You do not have access to this key")
|
||||
ctx.Error(403, "", "You do not have access to this key")
|
||||
} else {
|
||||
ctx.APIError(500, "DeletePublicKey", err)
|
||||
ctx.Error(500, "DeletePublicKey", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -10,20 +10,21 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
)
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#search-users
|
||||
func Search(ctx *middleware.Context) {
|
||||
opt := models.SearchOption{
|
||||
Keyword: ctx.Query("q"),
|
||||
Limit: com.StrTo(ctx.Query("limit")).MustInt(),
|
||||
func Search(ctx *context.APIContext) {
|
||||
opts := &models.SearchUserOptions{
|
||||
Keyword: ctx.Query("q"),
|
||||
Type: models.USER_TYPE_INDIVIDUAL,
|
||||
PageSize: com.StrTo(ctx.Query("limit")).MustInt(),
|
||||
}
|
||||
if opt.Limit == 0 {
|
||||
opt.Limit = 10
|
||||
if opts.PageSize == 0 {
|
||||
opts.PageSize = 10
|
||||
}
|
||||
|
||||
us, err := models.SearchUserByName(opt)
|
||||
users, _, err := models.SearchUserByName(opts)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
"ok": false,
|
||||
@@ -32,16 +33,16 @@ func Search(ctx *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
results := make([]*api.User, len(us))
|
||||
for i := range us {
|
||||
results := make([]*api.User, len(users))
|
||||
for i := range users {
|
||||
results[i] = &api.User{
|
||||
ID: us[i].Id,
|
||||
UserName: us[i].Name,
|
||||
AvatarUrl: us[i].AvatarLink(),
|
||||
FullName: us[i].FullName,
|
||||
ID: users[i].Id,
|
||||
UserName: users[i].Name,
|
||||
AvatarUrl: users[i].AvatarLink(),
|
||||
FullName: users[i].FullName,
|
||||
}
|
||||
if ctx.IsSigned {
|
||||
results[i].Email = us[i].Email
|
||||
results[i].Email = users[i].Email
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,13 +53,13 @@ func Search(ctx *middleware.Context) {
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Users#get-a-single-user
|
||||
func GetInfo(ctx *middleware.Context) {
|
||||
func GetInfo(ctx *context.APIContext) {
|
||||
u, err := models.GetUserByName(ctx.Params(":username"))
|
||||
if err != nil {
|
||||
if models.IsErrUserNotExist(err) {
|
||||
ctx.Error(404)
|
||||
ctx.Status(404)
|
||||
} else {
|
||||
ctx.APIError(500, "GetUserByName", err)
|
||||
ctx.Error(500, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ package dev
|
||||
import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
func TemplatePreview(ctx *middleware.Context) {
|
||||
func TemplatePreview(ctx *context.Context) {
|
||||
ctx.Data["User"] = models.User{Name: "Unknown"}
|
||||
ctx.Data["AppName"] = setting.AppName
|
||||
ctx.Data["AppVer"] = setting.AppVer
|
||||
|
||||
135
routers/home.go
135
routers/home.go
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/routers/user"
|
||||
)
|
||||
@@ -19,9 +19,10 @@ import (
|
||||
const (
|
||||
HOME base.TplName = "home"
|
||||
EXPLORE_REPOS base.TplName = "explore/repos"
|
||||
EXPLORE_USERS base.TplName = "explore/users"
|
||||
)
|
||||
|
||||
func Home(ctx *middleware.Context) {
|
||||
func Home(ctx *context.Context) {
|
||||
if ctx.IsSigned {
|
||||
if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {
|
||||
ctx.Data["Title"] = ctx.Tr("auth.active_your_account")
|
||||
@@ -43,23 +44,52 @@ func Home(ctx *middleware.Context) {
|
||||
ctx.HTML(200, HOME)
|
||||
}
|
||||
|
||||
func Explore(ctx *middleware.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("explore")
|
||||
ctx.Data["PageIsExplore"] = true
|
||||
ctx.Data["PageIsExploreRepositories"] = true
|
||||
type RepoSearchOptions struct {
|
||||
Counter func() int64
|
||||
Ranger func(int, int) ([]*models.Repository, error)
|
||||
Private bool
|
||||
PageSize int
|
||||
OrderBy string
|
||||
TplName base.TplName
|
||||
}
|
||||
|
||||
func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
|
||||
ctx.Data["Page"] = paginater.New(int(models.CountPublicRepositories()), setting.ExplorePagingNum, page, 5)
|
||||
var (
|
||||
repos []*models.Repository
|
||||
count int64
|
||||
err error
|
||||
)
|
||||
|
||||
repos, err := models.GetRecentUpdatedRepositories(page)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetRecentUpdatedRepositories", err)
|
||||
return
|
||||
keyword := ctx.Query("q")
|
||||
if len(keyword) == 0 {
|
||||
repos, err = opts.Ranger(page, opts.PageSize)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "opts.Ranger", err)
|
||||
return
|
||||
}
|
||||
count = opts.Counter()
|
||||
} else {
|
||||
repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
|
||||
Keyword: keyword,
|
||||
OrderBy: opts.OrderBy,
|
||||
Private: opts.Private,
|
||||
Page: page,
|
||||
PageSize: opts.PageSize,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Handle(500, "SearchRepositoryByName", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Total"] = count
|
||||
ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5)
|
||||
|
||||
for _, repo := range repos {
|
||||
if err = repo.GetOwner(); err != nil {
|
||||
ctx.Handle(500, "GetOwner", fmt.Errorf("%d: %v", repo.ID, err))
|
||||
@@ -68,10 +98,89 @@ func Explore(ctx *middleware.Context) {
|
||||
}
|
||||
ctx.Data["Repos"] = repos
|
||||
|
||||
ctx.HTML(200, EXPLORE_REPOS)
|
||||
ctx.HTML(200, opts.TplName)
|
||||
}
|
||||
|
||||
func NotFound(ctx *middleware.Context) {
|
||||
func ExploreRepos(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("explore")
|
||||
ctx.Data["PageIsExplore"] = true
|
||||
ctx.Data["PageIsExploreRepositories"] = true
|
||||
|
||||
RenderRepoSearch(ctx, &RepoSearchOptions{
|
||||
Counter: models.CountPublicRepositories,
|
||||
Ranger: models.GetRecentUpdatedRepositories,
|
||||
PageSize: setting.ExplorePagingNum,
|
||||
OrderBy: "updated_unix DESC",
|
||||
TplName: EXPLORE_REPOS,
|
||||
})
|
||||
}
|
||||
|
||||
type UserSearchOptions struct {
|
||||
Type models.UserType
|
||||
Counter func() int64
|
||||
Ranger func(int, int) ([]*models.User, error)
|
||||
PageSize int
|
||||
OrderBy string
|
||||
TplName base.TplName
|
||||
}
|
||||
|
||||
func RenderUserSearch(ctx *context.Context, opts *UserSearchOptions) {
|
||||
page := ctx.QueryInt("page")
|
||||
if page <= 1 {
|
||||
page = 1
|
||||
}
|
||||
|
||||
var (
|
||||
users []*models.User
|
||||
count int64
|
||||
err error
|
||||
)
|
||||
|
||||
keyword := ctx.Query("q")
|
||||
if len(keyword) == 0 {
|
||||
users, err = opts.Ranger(page, opts.PageSize)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "opts.Ranger", err)
|
||||
return
|
||||
}
|
||||
count = opts.Counter()
|
||||
} else {
|
||||
users, count, err = models.SearchUserByName(&models.SearchUserOptions{
|
||||
Keyword: keyword,
|
||||
Type: opts.Type,
|
||||
OrderBy: opts.OrderBy,
|
||||
Page: page,
|
||||
PageSize: opts.PageSize,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Handle(500, "SearchUserByName", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Total"] = count
|
||||
ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5)
|
||||
ctx.Data["Users"] = users
|
||||
|
||||
ctx.HTML(200, opts.TplName)
|
||||
}
|
||||
|
||||
func ExploreUsers(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("explore")
|
||||
ctx.Data["PageIsExplore"] = true
|
||||
ctx.Data["PageIsExploreUsers"] = true
|
||||
|
||||
RenderUserSearch(ctx, &UserSearchOptions{
|
||||
Type: models.USER_TYPE_INDIVIDUAL,
|
||||
Counter: models.CountUsers,
|
||||
Ranger: models.Users,
|
||||
PageSize: setting.ExplorePagingNum,
|
||||
OrderBy: "updated_unix DESC",
|
||||
TplName: EXPLORE_USERS,
|
||||
})
|
||||
}
|
||||
|
||||
func NotFound(ctx *context.Context) {
|
||||
ctx.Data["Title"] = "Page Not Found"
|
||||
ctx.Handle(404, "home.NotFound", nil)
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/cron"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/mailer"
|
||||
"github.com/gogits/gogs/modules/markdown"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
"github.com/gogits/gogs/modules/ssh"
|
||||
"github.com/gogits/gogs/modules/template/highlight"
|
||||
@@ -97,7 +97,7 @@ func GlobalInit() {
|
||||
markdown.BuildSanitizer()
|
||||
}
|
||||
|
||||
func InstallInit(ctx *middleware.Context) {
|
||||
func InstallInit(ctx *context.Context) {
|
||||
if setting.InstallLock {
|
||||
ctx.Handle(404, "Install", errors.New("Installation is prohibited"))
|
||||
return
|
||||
@@ -116,7 +116,7 @@ func InstallInit(ctx *middleware.Context) {
|
||||
ctx.Data["DbOptions"] = dbOpts
|
||||
}
|
||||
|
||||
func Install(ctx *middleware.Context) {
|
||||
func Install(ctx *context.Context) {
|
||||
form := auth.InstallForm{}
|
||||
|
||||
// Database settings
|
||||
@@ -177,7 +177,7 @@ func Install(ctx *middleware.Context) {
|
||||
ctx.HTML(200, INSTALL)
|
||||
}
|
||||
|
||||
func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
||||
func InstallPost(ctx *context.Context, form auth.InstallForm) {
|
||||
ctx.Data["CurDbOption"] = form.DbType
|
||||
|
||||
if ctx.HasError() {
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ const (
|
||||
MEMBER_INVITE base.TplName = "org/member/invite"
|
||||
)
|
||||
|
||||
func Members(ctx *middleware.Context) {
|
||||
func Members(ctx *context.Context) {
|
||||
org := ctx.Org.Organization
|
||||
ctx.Data["Title"] = org.FullName
|
||||
ctx.Data["PageIsOrgMembers"] = true
|
||||
@@ -33,7 +33,7 @@ func Members(ctx *middleware.Context) {
|
||||
ctx.HTML(200, MEMBERS)
|
||||
}
|
||||
|
||||
func MembersAction(ctx *middleware.Context) {
|
||||
func MembersAction(ctx *context.Context) {
|
||||
uid := com.StrTo(ctx.Query("uid")).MustInt64()
|
||||
if uid == 0 {
|
||||
ctx.Redirect(ctx.Org.OrgLink + "/members")
|
||||
@@ -91,7 +91,7 @@ func MembersAction(ctx *middleware.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func Invitation(ctx *middleware.Context) {
|
||||
func Invitation(ctx *context.Context) {
|
||||
org := ctx.Org.Organization
|
||||
ctx.Data["Title"] = org.FullName
|
||||
ctx.Data["PageIsOrgMembers"] = true
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/auth"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
@@ -17,12 +17,12 @@ const (
|
||||
CREATE base.TplName = "org/create"
|
||||
)
|
||||
|
||||
func Create(ctx *middleware.Context) {
|
||||
func Create(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("new_org")
|
||||
ctx.HTML(200, CREATE)
|
||||
}
|
||||
|
||||
func CreatePost(ctx *middleware.Context, form auth.CreateOrgForm) {
|
||||
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("new_org")
|
||||
|
||||
if ctx.HasError() {
|
||||
@@ -33,7 +33,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateOrgForm) {
|
||||
org := &models.User{
|
||||
Name: form.OrgName,
|
||||
IsActive: true,
|
||||
Type: models.ORGANIZATION,
|
||||
Type: models.USER_TYPE_ORGANIZATION,
|
||||
}
|
||||
|
||||
if err := models.CreateOrganization(org, ctx.User); err != nil {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user