From 5d5d774e03ea02b29ff2bd25e1bf63ce82851fc5 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 10 Mar 2015 03:08:17 +0000 Subject: [PATCH 01/36] Handle submodules without a .gitmodules entry - fix #1023 --- modules/git/commit.go | 4 ++-- modules/git/submodule.go | 4 ++++ routers/repo/view.go | 6 +++++- templates/repo/view_list.tmpl | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/git/commit.go b/modules/git/commit.go index d2d373da12..4e254dcec1 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -88,11 +88,11 @@ func (c *Commit) GetCommitOfRelPath(relPath string) (*Commit, error) { } func (c *Commit) GetSubModule(entryname string) (*SubModule, error) { - moduels, err := c.GetSubModules() + modules, err := c.GetSubModules() if err != nil { return nil, err } - return moduels[entryname], nil + return modules[entryname], nil } func (c *Commit) GetSubModules() (map[string]*SubModule, error) { diff --git a/modules/git/submodule.go b/modules/git/submodule.go index 6927f8cbad..0c7c2696c3 100644 --- a/modules/git/submodule.go +++ b/modules/git/submodule.go @@ -31,6 +31,10 @@ func NewSubModuleFile(c *Commit, refUrl, refId string) *SubModuleFile { // RefUrl guesses and returns reference URL. func (sf *SubModuleFile) RefUrl() string { + if sf.refUrl == "" { + return "" + } + url := strings.TrimSuffix(sf.refUrl, ".git") // git://xxx/user/repo diff --git a/routers/repo/view.go b/routers/repo/view.go index cfe0fa010c..2a36db6b42 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -141,13 +141,17 @@ func Home(ctx *middleware.Context) { ctx.Handle(500, "GetSubModule", err) return } + smUrl := "" + if sm != nil { + smUrl = sm.Url + } c, err := ctx.Repo.Commit.GetCommitOfRelPath(filepath.Join(treePath, te.Name())) if err != nil { ctx.Handle(500, "GetCommitOfRelPath", err) return } - files = append(files, []interface{}{te, git.NewSubModuleFile(c, sm.Url, te.Id.String())}) + files = append(files, []interface{}{te, git.NewSubModuleFile(c, smUrl, te.Id.String())}) } } ctx.Data["Files"] = files diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 06536b4728..f51c10025a 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -39,7 +39,11 @@ + {{if $commit.RefUrl}} {{$entry.Name}} @ {{ShortSha $commit.RefId}} + {{else}} + {{$entry.Name}} @ {{ShortSha $commit.RefId}} + {{end}} {{else}} From 406efbf3f543f6f5911a6c6d4da3b9f002d5023a Mon Sep 17 00:00:00 2001 From: Joshua Delsman Date: Tue, 10 Mar 2015 07:06:10 -0700 Subject: [PATCH 02/36] Adding a project-level Dockerfile & docker-compose script --- Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..bb2ed8d307 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM google/golang:latest + +ENV TAGS="sqlite redis memcache cert" USER="git" HOME="/home/git" + +COPY . /gopath/src/github.com/gogits/gogs/ +WORKDIR /gopath/src/github.com/gogits/gogs/ + +RUN go get -v -tags="$TAGS" github.com/gogits/gogs \ + && go build -tags="$TAGS" \ + && useradd -d $HOME -m $USER \ + && chown -R $USER . + +USER $USER + +ENTRYPOINT [ "./gogs" ] + +CMD [ "web" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..4e33089531 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +web: + build: . + links: + - mysql + ports: + - "3000:3000" + +mysql: + image: mysql + environment: + - MYSQL_ROOT_PASSWORD=gogs + - MYSQL_DATABASE=gogs From 34102f788945b1c73a845f7916d01d216baa56ad Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 11 Mar 2015 09:21:05 -0400 Subject: [PATCH 03/36] remove unused scripts and simplify migrate form definition --- .gobuild.yml | 22 ---------------------- gogs.go | 2 +- modules/auth/repo_form.go | 14 +++++++------- routers/api/v1/repo.go | 6 +++--- routers/repo/repo.go | 6 +++--- templates/.VERSION | 2 +- templates/repo/migrate.tmpl | 4 ++-- wercker.yml | 1 - 8 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 .gobuild.yml delete mode 100644 wercker.yml diff --git a/.gobuild.yml b/.gobuild.yml deleted file mode 100644 index f1b9b691c3..0000000000 --- a/.gobuild.yml +++ /dev/null @@ -1,22 +0,0 @@ -filesets: - includes: - - conf - - etc - - public - - scripts - - templates - - LICENSE - - README.md - - README_ZH.md - excludes: - - \.git - depth: 5 -settings: - build: | - if test "$GOOS" = "windows" -a "$GOARCH" = "386" - then - go install -v - else - go get -v -tags "sqlite redis memcache cert" github.com/gogits/gogs - go install -v -tags "sqlite redis memcache cert" - fi diff --git a/gogs.go b/gogs.go index 7b212b72fd..2d34178d50 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.16.0301 Beta" +const APP_VER = "0.5.16.0311 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 2902a92f2e..a092830188 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -32,13 +32,13 @@ func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) bin type MigrateRepoForm struct { CloneAddr string `binding:"Required"` - AuthUserName string `form:"auth_username"` - AuthPasswd string `form:"auth_password"` - Uid int64 `form:"uid" binding:"Required"` - RepoName string `form:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` - Mirror bool `form:"mirror"` - Private bool `form:"private"` - Description string `form:"desc" binding:"MaxSize(255)"` + AuthUsername string + AuthPassword string + Uid int64 `binding:"Required"` + RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` + Mirror bool + Private bool + Description string `binding:"MaxSize(255)"` } func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index eb9908911f..6bb78ba018 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -196,7 +196,7 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - // Remote address can be HTTPS URL or local path. + // Remote address can be HTTP/HTTPS URL or local path. remoteAddr := form.CloneAddr if strings.HasPrefix(form.CloneAddr, "http") { u, err := url.Parse(form.CloneAddr) @@ -204,8 +204,8 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.HandleAPI(422, err) return } - if len(form.AuthUserName) > 0 || len(form.AuthPasswd) > 0 { - u.User = url.UserPassword(form.AuthUserName, form.AuthPasswd) + if len(form.AuthUsername) > 0 || len(form.AuthPassword) > 0 { + u.User = url.UserPassword(form.AuthUsername, form.AuthPassword) } remoteAddr = u.String() } else if !com.IsDir(remoteAddr) { diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 6b84a389d5..37d07c563f 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -181,7 +181,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { } } - // Remote address can be HTTPS URL or local path. + // Remote address can be HTTP/HTTPS URL or local path. remoteAddr := form.CloneAddr if strings.HasPrefix(form.CloneAddr, "http") { u, err := url.Parse(form.CloneAddr) @@ -190,8 +190,8 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.RenderWithErr(ctx.Tr("form.url_error"), MIGRATE, &form) return } - if len(form.AuthUserName) > 0 || len(form.AuthPasswd) > 0 { - u.User = url.UserPassword(form.AuthUserName, form.AuthPasswd) + if len(form.AuthUsername) > 0 || len(form.AuthPassword) > 0 { + u.User = url.UserPassword(form.AuthUsername, form.AuthPassword) } remoteAddr = u.String() } else if !com.IsDir(remoteAddr) { diff --git a/templates/.VERSION b/templates/.VERSION index bc7ed7d030..cd8bf82a6b 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.16.0301 Beta \ No newline at end of file +0.5.16.0311 Beta \ No newline at end of file diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl index 5869be1558..cc23888db2 100644 --- a/templates/repo/migrate.tmpl +++ b/templates/repo/migrate.tmpl @@ -68,8 +68,8 @@ {{.i18n.Tr "repo.migrate_type_helper" | Str2html}}
- - + +
diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 7c64bf0a91..0000000000 --- a/wercker.yml +++ /dev/null @@ -1 +0,0 @@ -box: wercker/default From 4aafeace230a35e80fb443739c2642d23fc93e51 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 01:15:01 -0400 Subject: [PATCH 04/36] fix HTTP/HTTPS push update func call panic #1037 and `http: multiple response.WriteHeader calls` --- gogs.go | 2 +- models/login.go | 6 ++---- models/publickey.go | 7 ++++--- routers/repo/http.go | 45 +++++++++++++++++++++++--------------------- templates/.VERSION | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/gogs.go b/gogs.go index 2d34178d50..fd303fa28f 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.16.0311 Beta" +const APP_VER = "0.5.16.0312 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/login.go b/models/login.go index e00d59b0ed..5e5fbf43fa 100644 --- a/models/login.go +++ b/models/login.go @@ -215,11 +215,9 @@ func UserSignIn(uname, passwd string) (*User, error) { switch u.LoginType { case LDAP: - return LoginUserLdapSource(u, u.LoginName, passwd, - source.Id, source.Cfg.(*LDAPConfig), false) + return LoginUserLdapSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*LDAPConfig), false) case SMTP: - return LoginUserSMTPSource(u, u.LoginName, passwd, - source.Id, source.Cfg.(*SMTPConfig), false) + return LoginUserSMTPSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*SMTPConfig), false) } return nil, ErrUnsupportedLoginType } diff --git a/models/publickey.go b/models/publickey.go index 6bec1139b8..c8098748b2 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -254,15 +254,16 @@ func saveAuthorizedKeyFile(keys ...*PublicKey) error { } defer f.Close() - finfo, err := f.Stat() + fi, err := f.Stat() if err != nil { return err } // FIXME: following command does not support in Windows. if !setting.IsWindows { - if finfo.Mode().Perm() > 0600 { - log.Error(4, "authorized_keys file has unusual permission flags: %s - setting to -rw-------", finfo.Mode().Perm().String()) + // .ssh directory should have mode 700, and authorized_keys file should have mode 600. + if fi.Mode().Perm() > 0600 { + log.Error(4, "authorized_keys file has unusual permission flags: %s - setting to -rw-------", fi.Mode().Perm().String()) if err = f.Chmod(0600); err != nil { return err } diff --git a/routers/repo/http.go b/routers/repo/http.go index 3cfc065999..f5dc00b8df 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -105,7 +105,7 @@ func Http(ctx *middleware.Context) { return } - authUser, err := models.UserSignIn(authUsername, authPasswd) + authUser, err = models.UserSignIn(authUsername, authPasswd) if err != nil { if err != models.ErrUserNotExist { ctx.Handle(500, "UserSignIn error: %v", err) @@ -160,7 +160,7 @@ func Http(ctx *middleware.Context) { } } - var f = func(rpc string, input []byte) { + callback := func(rpc string, input []byte) { if rpc == "receive-pack" { var lastLine int64 = 0 @@ -189,6 +189,7 @@ func Http(ctx *middleware.Context) { newCommitId := fields[1] refName := fields[2] + // FIXME: handle error. models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id) } lastLine = lastLine + size @@ -199,25 +200,23 @@ func Http(ctx *middleware.Context) { } } - config := Config{setting.RepoRootPath, "git", true, true, f} + HTTPBackend(&Config{ + RepoRootPath: setting.RepoRootPath, + GitBinPath: "git", + UploadPack: true, + ReceivePack: true, + OnSucceed: callback, + })(ctx.Resp, ctx.Req.Request) - handler := HttpBackend(&config) - handler(ctx.Resp, ctx.Req.Request) runtime.GC() } -type route struct { - cr *regexp.Regexp - method string - handler func(handler) -} - type Config struct { - ReposRoot string - GitBinPath string - UploadPack bool - ReceivePack bool - OnSucceed func(rpc string, input []byte) + RepoRootPath string + GitBinPath string + UploadPack bool + ReceivePack bool + OnSucceed func(rpc string, input []byte) } type handler struct { @@ -228,6 +227,12 @@ type handler struct { File string } +type route struct { + cr *regexp.Regexp + method string + handler func(handler) +} + var routes = []route{ {regexp.MustCompile("(.*?)/git-upload-pack$"), "POST", serviceUploadPack}, {regexp.MustCompile("(.*?)/git-receive-pack$"), "POST", serviceReceivePack}, @@ -243,7 +248,7 @@ var routes = []route{ } // Request handling function -func HttpBackend(config *Config) http.HandlerFunc { +func HTTPBackend(config *Config) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { for _, route := range routes { r.URL.Path = strings.ToLower(r.URL.Path) // blue: In case some repo name has upper case name @@ -285,8 +290,7 @@ func serviceReceivePack(hr handler) { func serviceRpc(rpc string, hr handler) { w, r, dir := hr.w, hr.r, hr.Dir - access := hasAccess(r, hr.Config, dir, rpc, true) - if access == false { + if !hasAccess(r, hr.Config, dir, rpc, true) { renderNoAccess(w) return } @@ -337,7 +341,6 @@ func serviceRpc(rpc string, hr handler) { if hr.Config.OnSucceed != nil { hr.Config.OnSucceed(rpc, input) } - w.WriteHeader(http.StatusOK) } func getInfoRefs(hr handler) { @@ -408,7 +411,7 @@ func sendFile(contentType string, hr handler) { } func getGitDir(config *Config, fPath string) (string, error) { - root := config.ReposRoot + root := config.RepoRootPath if root == "" { cwd, err := os.Getwd() diff --git a/templates/.VERSION b/templates/.VERSION index cd8bf82a6b..7bc05ce057 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.16.0311 Beta \ No newline at end of file +0.5.16.0312 Beta \ No newline at end of file From 98674b2a21e95f9843274d6ca79e06b7070389fe Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 12 Mar 2015 12:25:28 -0500 Subject: [PATCH 05/36] registeration -> registration --- conf/app.ini | 2 +- modules/setting/setting.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index ad38c42e71..8c33aff917 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -82,7 +82,7 @@ ENABLE_CACHE_AVATAR = false ENABLE_NOTIFY_MAIL = false ; More detail: https://github.com/gogits/gogs/issues/165 ENABLE_REVERSE_PROXY_AUTHENTICATION = false -ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = false +ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false [webhook] ; Cron task interval in minutes diff --git a/modules/setting/setting.go b/modules/setting/setting.go index fd07c17f23..9c1b0ad3c0 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -341,7 +341,7 @@ func newService() { Service.RequireSignInView = Cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").MustBool() Service.EnableCacheAvatar = Cfg.Section("service").Key("ENABLE_CACHE_AVATAR").MustBool() Service.EnableReverseProxyAuth = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() - Service.EnableReverseProxyAutoRegister = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTO_REGISTERATION").MustBool() + Service.EnableReverseProxyAutoRegister = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() } var logLevels = map[string]string{ From 6b70a0c0d926fd128063ab387820cee31890e556 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 15:09:40 -0400 Subject: [PATCH 06/36] #1032: legacy code can have duplicated IDs for same repository --- models/migrations/migrations.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 8d2d5b40a1..4b5f5a6975 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -341,12 +341,15 @@ func teamToTeamRepo(x *xorm.Engine) error { orgID := com.StrTo(team["org_id"]).MustInt64() teamID := com.StrTo(team["id"]).MustInt64() + // #1032: legacy code can have duplicated IDs for same repository. + mark := make(map[int64]bool) for _, idStr := range strings.Split(string(team["repo_ids"]), "|") { repoID := com.StrTo(strings.TrimPrefix(idStr, "$")).MustInt64() - if repoID == 0 { + if repoID == 0 || mark[repoID] { continue } + mark[repoID] = true teamRepos = append(teamRepos, &TeamRepo{ OrgID: orgID, TeamID: teamID, From 0720d3988f3e088e527dd857756d6598694494a7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 16:01:23 -0400 Subject: [PATCH 07/36] #988: GetRepoLink already contains AppSubUrl --- conf/locale/locale_de-DE.ini | 21 ++++++++++++--------- conf/locale/locale_en-US.ini | 12 ++++++------ conf/locale/locale_es-ES.ini | 21 ++++++++++++--------- conf/locale/locale_fr-CA.ini | 21 ++++++++++++--------- conf/locale/locale_ja-JP.ini | 21 ++++++++++++--------- conf/locale/locale_lv-LV.ini | 21 ++++++++++++--------- conf/locale/locale_nl-NL.ini | 21 ++++++++++++--------- conf/locale/locale_ru-RU.ini | 21 ++++++++++++--------- conf/locale/locale_zh-CN.ini | 21 ++++++++++++--------- conf/locale/locale_zh-HK.ini | 21 ++++++++++++--------- models/action.go | 9 ++++++++- templates/user/dashboard/feeds.tmpl | 12 ++++++------ 12 files changed, 128 insertions(+), 94 deletions(-) diff --git a/conf/locale/locale_de-DE.ini b/conf/locale/locale_de-DE.ini index 0254207fc6..8d1b2de1b1 100755 --- a/conf/locale/locale_de-DE.ini +++ b/conf/locale/locale_de-DE.ini @@ -281,13 +281,13 @@ init_readme=Repository mit README.md initialisieren create_repo=Repository erstellen default_branch=Standard-Branch mirror_interval=Spiegel-Intervall (in Stunden) -goget_meta=Go-Get Meta -goget_meta_helper=Dieses Repository wird man mit go get klonen können. need_auth=Authorisierung benötigt migrate_type=Migrationstyp migrate_type_helper=Dieses Repository wird ein Spiegel migrate_repo=Repository migrieren +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=Kopieren click_to_copy=In Zwischenablage kopieren @@ -595,7 +595,10 @@ auths.domain=Domain auths.host=Host auths.port=Port auths.base_dn=Base DN -auths.attributes=Suchattribute +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=Suchfilter auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP-Authentifizierungstyp @@ -693,12 +696,12 @@ notices.op=Op. notices.delete_success=System-Mitteilung erfolgreich gelöscht. [action] -create_repo=hat Repository %s erstellt -commit_repo=hat nach %s in %s gepusht -create_issue=`hat Issue %[1]s#%[2]s eröffnet` -comment_issue=`hat Issue %[1]s#%[2]s kommentiert` -transfer_repo=hat Repository %s transferiert an %s -push_tag=hat nach %s in %s gepusht +create_repo=hat Repository %s erstellt +commit_repo=hat nach %[2]s in %[3]s gepusht +create_issue=`hat Issue %s#%[2]s eröffnet` +comment_issue=`hat Issue %s#%[2]s kommentiert` +transfer_repo=hat Repository %s transferiert an %s +push_tag=hat nach %[2]s in %[3]s gepusht compare_2_commits=Zeige Vergleich dieser 2 Commits [tool] diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index 7e32a21eec..c2fec7d9e8 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -696,12 +696,12 @@ notices.op = Op. notices.delete_success = System notice has been deleted successfully. [action] -create_repo = created repository %s -commit_repo = pushed to %s at %s -create_issue = `opened issue %[1]s#%[2]s` -comment_issue = `commented on issue %[1]s#%[2]s` -transfer_repo = transfered repository %s to %s -push_tag = pushed tag %s to %s +create_repo = created repository %s +commit_repo = pushed to %[2]s at %[3]s +create_issue = `opened issue %s#%[2]s` +comment_issue = `commented on issue %s#%[2]s` +transfer_repo = transfered repository %s to %s +push_tag = pushed tag %[2]s to %[3]s compare_2_commits = View comparison for these 2 commits [tool] diff --git a/conf/locale/locale_es-ES.ini b/conf/locale/locale_es-ES.ini index fc235f1530..124548a30e 100755 --- a/conf/locale/locale_es-ES.ini +++ b/conf/locale/locale_es-ES.ini @@ -281,13 +281,13 @@ init_readme=Crear este repositorio con un fichero README.md create_repo=Crear Repositorio default_branch=Rama por defecto mirror_interval=Intervalo de mirror(en horas) -goget_meta=Go-Get Meta -goget_meta_helper=Este repositorio será Go-Getable need_auth=Requiere Autorización migrate_type=Tipo de Migración migrate_type_helper=Este repositorio será un Mirror migrate_repo=Migrar Repositorio +migrate.clone_address=Clonar Dirección +migrate.invalid_local_path=Rutal local inválida, no existe o no es un directorio. copy_link=Copiar click_to_copy=Copiar al portapapeles @@ -595,7 +595,10 @@ auths.domain=Dominio auths.host=Host auths.port=Puerto auths.base_dn=Base DN -auths.attributes=Atributos de búsqueda +auths.attribute_username=Atributo username +auths.attribute_name=Atributo nombre +auths.attribute_surname=Atributo apellido +auths.attribute_mail=Atributo correo electrónico auths.filter=Filtro de Búsqueda auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=Tipo de Autorización SMTP @@ -693,12 +696,12 @@ notices.op=Op. notices.delete_success=La notificación del sistema se ha eliminado correctamente. [action] -create_repo=Repositorio creado %s -commit_repo=hizo push a %s en %s -create_issue=`incidencia abierta %[1]s#%[2]s` -comment_issue=`comentó en la incidencia %[1]s#%[2]s` -transfer_repo=transfirió el repositorio %s a %s -push_tag=hizo push del tag %s a %s +create_repo=Repositorio creado %s +commit_repo=hizo push a %[2]s en %[3]s +create_issue=`incidencia abierta %s#%[2]s` +comment_issue=`comentó en la incidencia %s#%[2]s` +transfer_repo=transfirió el repositorio %s a %s +push_tag=hizo push del tag %[2]s a %[3]s compare_2_commits=Ver la comparación de estos 2 commits [tool] diff --git a/conf/locale/locale_fr-CA.ini b/conf/locale/locale_fr-CA.ini index e744b9d97c..b388884d33 100755 --- a/conf/locale/locale_fr-CA.ini +++ b/conf/locale/locale_fr-CA.ini @@ -281,13 +281,13 @@ init_readme=Initialiser ce Référentiel avec un README.md create_repo=Créer un Référentiel default_branch=Branche par défaut mirror_interval=Intervalle du miroir (heure) -goget_meta=Méta Go-Get -goget_meta_helper=Ce Référentiel sera Go-Getable need_auth=Nécessite une Autorisation migrate_type=Type de Migration migrate_type_helper=Ce Référentiel sera un Miroir migrate_repo=Migrer le Référentiel +migrate.clone_address=Adresse du clone +migrate.invalid_local_path=Chemin local non valide, non existant ou n'étant pas un dossier. copy_link=Copier click_to_copy=Copier dans le presse-papier @@ -595,7 +595,10 @@ auths.domain=Domaine auths.host=Hôte auths.port=Port auths.base_dn=Base DN (Nom Distingué) -auths.attributes=Rechercher les Attributs +auths.attribute_username=Attribut du nom d'utilisateur +auths.attribute_name=Attribut du prénom +auths.attribute_surname=Attribut du nom de famille +auths.attribute_mail=Attribut de l'e-mail auths.filter=Filtre de recherche auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=Type d'Autorisation SMTP @@ -693,12 +696,12 @@ notices.op=Auteur notices.delete_success=Note système supprimée avec succès. [action] -create_repo=a crée le Référentiel %s -commit_repo=a soumis à %s chez %s -create_issue=`a ouvert un problème %[1]s#%[2]s` -comment_issue=`a commenté le problème %[1]s#%[2]s` -transfer_repo=a transféré le Référentiel %s à %s -push_tag=a tagé %s à %s +create_repo=a crée le Référentiel %s +commit_repo=a soumis à %[2]s chez %[3]s +create_issue=`a ouvert un problème %s#%[2]s` +comment_issue=`a commenté le problème %s#%[2]s` +transfer_repo=a transféré le Référentiel %s à %s +push_tag=a tagé %[2]s à %[3]s compare_2_commits=Comparer ces 2 commissions [tool] diff --git a/conf/locale/locale_ja-JP.ini b/conf/locale/locale_ja-JP.ini index 441da8feb8..ef43362149 100755 --- a/conf/locale/locale_ja-JP.ini +++ b/conf/locale/locale_ja-JP.ini @@ -281,13 +281,13 @@ init_readme=README.md 付きでリポジトリを初期化 create_repo=リポジトリを作成 default_branch=デフォルトのブランチ mirror_interval=ミラー 間隔(時) -goget_meta=Go-Get メタ -goget_meta_helper=このリポジトリは Go-Getable になります need_auth=認証が必要 migrate_type=マイグレーションの種類 migrate_type_helper=このリポジトリは ミラー になります migrate_repo=リポジトリを移行 +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=コピー click_to_copy=クリップボードにコピー @@ -595,7 +595,10 @@ auths.domain=ドメイン auths.host=ホスト auths.port=ポート auths.base_dn=ベースのドメイン名 -auths.attributes=属性検索 +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=検索フィルター auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP 認証の種類 @@ -693,12 +696,12 @@ notices.op=Op。 notices.delete_success=システム通知が正常に削除されました。 [action] -create_repo=リポジトリ %sを作成しました -commit_repo=%s%sにプッシュしました -create_issue=`問題 %[1]s#%[2]s を開きました` -comment_issue=`問題 %[1]s#%[2]s のコメント` -transfer_repo=リポジトリ %s%s へ転送しました -push_tag=%s に タグ %s をプッシュしました +create_repo=リポジトリ %sを作成しました +commit_repo=%[3]s%[2]sにプッシュしました +create_issue=`問題 %s#%[2]s を開きました` +comment_issue=`問題 %s#%[2]s のコメント` +transfer_repo=リポジトリ %s%s へ転送しました +push_tag=%[3]s に タグ %[2]s をプッシュしました compare_2_commits=これら 2 のコミットの比較を閲覧する [tool] diff --git a/conf/locale/locale_lv-LV.ini b/conf/locale/locale_lv-LV.ini index 23276b4655..35cdd3a830 100755 --- a/conf/locale/locale_lv-LV.ini +++ b/conf/locale/locale_lv-LV.ini @@ -281,13 +281,13 @@ init_readme=Inicializēt šo repozitoriju ar README.md failu create_repo=Izveidot repozitoriju default_branch=Noklusējuma atzars mirror_interval=Spoguļošanas intervāls (stundās) -goget_meta=Go-Get metadati -goget_meta_helper=Šis repozitorijs saturēs Go-Get metadatus need_auth=Nepieciešama autorizācija migrate_type=Migrācijas veids migrate_type_helper=Šis repozitorijs būs Spoguļots migrate_repo=Migrēt repozitoriju +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=Kopēt click_to_copy=Kopēt uz starpliktuvi @@ -595,7 +595,10 @@ auths.domain=Domēns auths.host=Resursdators auths.port=Ports auths.base_dn=Pamata DN -auths.attributes=Meklēšanas atribūti +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=Meklēšanas filtrs auths.ms_ad_sa=MS Ad SA auths.smtp_auth=SMTP autorizācijas veids @@ -693,12 +696,12 @@ notices.op=Op. notices.delete_success=Sistēmas paziņojums tika veiksmīgi izdzēsts. [action] -create_repo=izveidoja repozitoriju %s -commit_repo=veica izmaiņu nosūtīšanu atzaram %s repozitorijā %s -create_issue=`reģistrēja problēmu %[1]s#%[2]s` -comment_issue=`pievienoja komentāru problēmai %[1]s#%[2]s` -transfer_repo=mainīja repozitorija %s īpašnieku uz %s -push_tag=pievienoja tagu %s repozitorijam %s +create_repo=izveidoja repozitoriju %s +commit_repo=veica izmaiņu nosūtīšanu atzaram %[2]s repozitorijā %[3]s +create_issue=`reģistrēja problēmu %s#%[2]s` +comment_issue=`pievienoja komentāru problēmai %s#%[2]s` +transfer_repo=mainīja repozitorija %s īpašnieku uz %s +push_tag=pievienoja tagu %[2]s repozitorijam %[3]s compare_2_commits=Veikt salīdzināšanu starp šīm 2 revīzijām [tool] diff --git a/conf/locale/locale_nl-NL.ini b/conf/locale/locale_nl-NL.ini index 0a4ecb43a7..c1bc6c3439 100755 --- a/conf/locale/locale_nl-NL.ini +++ b/conf/locale/locale_nl-NL.ini @@ -281,13 +281,13 @@ init_readme=Initialiseer deze repositorie met een README.md create_repo=Nieuwe Repositorie default_branch=Standaard branch mirror_interval=Mirror interval(uur) -goget_meta=Go-Get Meta -goget_meta_helper=Deze repositorie is nu beschikbaar voor Go-Get need_auth=Autorisatie vereist migrate_type=Migratie type migrate_type_helper=Deze repositorie zal een mirror worden migrate_repo=Migreer repositorie +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=Kopieer click_to_copy=Kopieer link naar plakbord @@ -595,7 +595,10 @@ auths.domain=Domein auths.host=Host auths.port=Poort auths.base_dn=Base DN -auths.attributes=Zoek attributen +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=Zoek filter auths.ms_ad_sa=MS Ad SA auths.smtp_auth=SMTP authenticatietype @@ -693,12 +696,12 @@ notices.op=Op. notices.delete_success=Systeem bericht is met succes verwijderd. [action] -create_repo=repositorie aangemaakt in %s -commit_repo=push update naar %s in %s%[1]s#%[2]s` -comment_issue=`reactie op issue %[1]s#%[2]s` -transfer_repo=repositorie verplaatst naar %s naar %s -push_tag=geduwd label %s naar %s +create_repo=repositorie aangemaakt in %s +commit_repo=push update naar %[2]s in %[3]s +create_issue=`opende issue in %s#%[2]s` +comment_issue=`reactie op issue %s#%[2]s` +transfer_repo=repositorie verplaatst naar %s naar %s +push_tag=geduwd label %[2]s naar %[3]s compare_2_commits=Weergave vergelijking voor deze 2 commits [tool] diff --git a/conf/locale/locale_ru-RU.ini b/conf/locale/locale_ru-RU.ini index 731ba469ce..c2a50b9da8 100755 --- a/conf/locale/locale_ru-RU.ini +++ b/conf/locale/locale_ru-RU.ini @@ -281,13 +281,13 @@ init_readme=Создать репозиторий с файлом README.md create_repo=Создание репозитория default_branch=Ветка по умолчанию mirror_interval=Интервал зеркалирования (час) -goget_meta=Meta-тег для go get -goget_meta_helper=Репозиторий будет доступен для go get need_auth=Требуется авторизация migrate_type=Тип миграции migrate_type_helper=Этот репозиторий будет зеркалом migrate_repo=Перенос репозитория +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=Копировать click_to_copy=Скопировать в буфер обмена @@ -595,7 +595,10 @@ auths.domain=Домен auths.host=Хост auths.port=Порт auths.base_dn=Base DN -auths.attributes=Search Attributes +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=Фильтр поиска auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=Тип авторизации SMTP @@ -693,12 +696,12 @@ notices.op=Op. notices.delete_success=Системное уведомление успешно удалено. [action] -create_repo=создан репозиторий %s -commit_repo=pushed to %s at %s -create_issue=`opened issue %[1]s#%[2]s` -comment_issue=`commented on issue %[1]s#%[2]s` -transfer_repo=transfered repository %s to %s -push_tag=pushed tag %s to %s +create_repo=создан репозиторий %s +commit_repo=pushed to %[2]s at %[3]s +create_issue=`opened issue %s#%[2]s` +comment_issue=`commented on issue %s#%[2]s` +transfer_repo=transfered repository %s to %s +push_tag=pushed tag %[2]s to %[3]s compare_2_commits=Просмотреть сравнение двух коммитов [tool] diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index 3537068228..0e418e254a 100755 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -281,13 +281,13 @@ init_readme=使用 README.md 文件初始化仓库 create_repo=创建仓库 default_branch=默认分支 mirror_interval=镜像同步周期(小时) -goget_meta=Go-Get 支持 -goget_meta_helper=本仓库将可以通过 Go Get 获取 need_auth=需要授权验证 migrate_type=迁移类型 migrate_type_helper=本仓库将是 镜像 migrate_repo=迁移仓库 +migrate.clone_address=克隆地址 +migrate.invalid_local_path=无效的本地路径,不存在或不是一个目录! copy_link=复制链接 click_to_copy=复制到剪切板 @@ -595,7 +595,10 @@ auths.domain=域名 auths.host=主机地址 auths.port=主机端口 auths.base_dn=Base DN -auths.attributes=Search Attributes +auths.attribute_username=用户名属性 +auths.attribute_name=名字属性 +auths.attribute_surname=姓氏属性 +auths.attribute_mail=邮箱属性 auths.filter=Search Filter auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP 授权类型 @@ -693,12 +696,12 @@ notices.op=操作 notices.delete_success=系统提示删除成功! [action] -create_repo=创建了仓库 %s -commit_repo=推送了 %s 分支的代码到 %s -create_issue=`创建了工单 %[1]s#%[2]s` -comment_issue=`评论了工单 %[1]s#%[2]s` -transfer_repo=将仓库 %s 转移至 %s -push_tag=推送了标签 %s%s +create_repo=创建了仓库 %s +commit_repo=推送了 %[2]s 分支的代码到 %[3]s +create_issue=`创建了工单 %s#%[2]s` +comment_issue=`评论了工单 %s#%[2]s` +transfer_repo=将仓库 %s 转移至 %s +push_tag=推送了标签 %[2]s%[3]s compare_2_commits=查看 2 次提交的内容对比 [tool] diff --git a/conf/locale/locale_zh-HK.ini b/conf/locale/locale_zh-HK.ini index a9b51a5b0c..8447e60912 100755 --- a/conf/locale/locale_zh-HK.ini +++ b/conf/locale/locale_zh-HK.ini @@ -281,13 +281,13 @@ init_readme=使用 README.md 文件初始化倉庫 create_repo=創建倉庫 default_branch=默認分支 mirror_interval=鏡像同步周期(小時) -goget_meta=Go-Get 支持 -goget_meta_helper=本倉庫將可以通過 Go Get 獲取 need_auth=需要授權驗證 migrate_type=遷移類型 migrate_type_helper=本倉庫將是 鏡像 migrate_repo=遷移倉庫 +migrate.clone_address=Clone Address +migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. copy_link=複製連結 click_to_copy=複製到剪切簿 @@ -595,7 +595,10 @@ auths.domain=域名 auths.host=主機地址 auths.port=主機端口 auths.base_dn=Base DN -auths.attributes=搜尋屬性 +auths.attribute_username=Username attribute +auths.attribute_name=First name attribute +auths.attribute_surname=Surname attribute +auths.attribute_mail=E-mail attribute auths.filter=搜尋過濾 auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP 授權類型 @@ -693,12 +696,12 @@ notices.op=操作 notices.delete_success=系統提示刪除成功! [action] -create_repo=創建了倉庫 %s -commit_repo=推送了 %s 分支的代碼到 %s -create_issue=`創建了問題 %[1]s#%[2]s` -comment_issue=`評論了問題 %[1]s#%[2]s` -transfer_repo=將倉庫 %s 轉移至 %s -push_tag=推送了標籤 %s%s +create_repo=創建了倉庫 %s +commit_repo=推送了 %[2]s 分支的代碼到 %[3]s +create_issue=`創建了問題 %s#%[2]s` +comment_issue=`評論了問題 %s#%[2]s` +transfer_repo=將倉庫 %s 轉移至 %s +push_tag=推送了標籤 %[2]s%[3]s compare_2_commits=查看 2 次提交的內容對比 [tool] diff --git a/models/action.go b/models/action.go index f872104eb2..f97ecfcde3 100644 --- a/models/action.go +++ b/models/action.go @@ -97,8 +97,15 @@ func (a Action) GetRepoName() string { return a.RepoName } +func (a Action) GetRepoPath() string { + return path.Join(a.RepoUserName, a.RepoName) +} + func (a Action) GetRepoLink() string { - return path.Join(setting.AppSubUrl, a.RepoUserName, a.RepoName) + if len(setting.AppSubUrl) > 0 { + return path.Join(setting.AppSubUrl, a.GetRepoPath()) + } + return "/" + a.GetRepoPath() } func (a Action) GetBranch() string { diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 8acf228963..88fb407536 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -7,19 +7,19 @@

{{.GetActUserName}} {{if eq .GetOpType 1}} - {{$.i18n.Tr "action.create_repo" AppSubUrl .GetRepoLink .GetRepoLink | Str2html}} + {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}} {{else if eq .GetOpType 5}} - {{$.i18n.Tr "action.commit_repo" AppSubUrl .GetRepoLink .GetBranch .GetBranch AppSubUrl .GetRepoLink .GetRepoLink | Str2html}} + {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} {{else if eq .GetOpType 6}} {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.create_issue" .GetRepoLink $index | Str2html}} + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}} {{else if eq .GetOpType 8}} - {{$.i18n.Tr "action.transfer_repo" .GetContent AppSubUrl .GetRepoLink .GetRepoLink | Str2html}} + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}} {{else if eq .GetOpType 9}} - {{$.i18n.Tr "action.push_tag" AppSubUrl .GetRepoLink .GetBranch .GetBranch AppSubUrl .GetRepoLink .GetRepoLink | Str2html}} + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}} {{else if eq .GetOpType 10}} {{ $index := index .GetIssueInfos 0}} - {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index | Str2html}} + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}} {{end}}

{{if eq .GetOpType 5}} From b668fc7aadb928b86336655e2fa0b37ed4d9733d Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 20:18:42 -0400 Subject: [PATCH 08/36] #876: Update hooks is missing for forked repository --- models/repo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/repo.go b/models/repo.go index 65cd368640..7abb793e5f 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1377,5 +1377,9 @@ func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Reposit return nil, fmt.Errorf("git update-server-info: %v", err) } + if err = createUpdateHook(repoPath); err != nil { + return nil, fmt.Errorf("createUpdateHook: %v", err) + } + return repo, sess.Commit() } From b72e75e522dda88dcbf7b064b8af3c495deb0595 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 20:32:38 -0400 Subject: [PATCH 09/36] #1024: OFFLINE_MODE Still Uses Gravatar --- models/user.go | 2 +- modules/base/tool.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/user.go b/models/user.go index ea5041bdff..f3a6c38f62 100644 --- a/models/user.go +++ b/models/user.go @@ -124,7 +124,7 @@ func (u *User) AvatarLink() string { switch { case u.UseCustomAvatar: return setting.AppSubUrl + "/avatars/" + com.ToStr(u.Id) - case setting.DisableGravatar: + case setting.DisableGravatar, setting.OfflineMode: return setting.AppSubUrl + "/img/avatar_default.jpg" case setting.Service.EnableCacheAvatar: return setting.AppSubUrl + "/avatar/" + u.Avatar diff --git a/modules/base/tool.go b/modules/base/tool.go index 55e6dffd96..92f493afe2 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -171,7 +171,7 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string // AvatarLink returns avatar link by given e-mail. func AvatarLink(email string) string { - if setting.DisableGravatar { + if setting.DisableGravatar || setting.OfflineMode { return setting.AppSubUrl + "/img/avatar_default.jpg" } From 2bfe2ddb6dcc9ed3e8e4ca7f04f1b86a3d106a6d Mon Sep 17 00:00:00 2001 From: Tomcat Date: Sat, 14 Mar 2015 02:21:47 +0800 Subject: [PATCH 10/36] Add mysql unix socket support. If the host setting looks like a unix socket (leading by char '/'), will use unix(host) as connection string --- models/models.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/models/models.go b/models/models.go index a9436fca85..b7986fed11 100644 --- a/models/models.go +++ b/models/models.go @@ -89,8 +89,13 @@ func getEngine() (*xorm.Engine, error) { cnnstr := "" switch DbCfg.Type { case "mysql": - cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", - DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name) + if DbCfg.Host[0] == '/' { // looks like a unix socket + cnnstr = fmt.Sprintf("%s:%s@unix(%s)/%s?charset=utf8", + DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name) + } else { + cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", + DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name) + } case "postgres": var host, port = "127.0.0.1", "5432" fields := strings.Split(DbCfg.Host, ":") From d0e34c57ccbc738bcfa28d35524d43ca47eeeeb4 Mon Sep 17 00:00:00 2001 From: Sternik Date: Fri, 13 Mar 2015 17:01:42 +0100 Subject: [PATCH 11/36] Fix for deleting user when gogs instalation is on http://hostname/gogs --- templates/admin/auth/edit.tmpl | 2 +- templates/admin/user/edit.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index e1bbd23d03..70bee6b43a 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -12,7 +12,7 @@
{{.i18n.Tr "admin.auths.edit"}}
-
+ {{.CsrfTokenHtml}} {{$type := .Source.Type}} diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 317349935e..bdc0e3343f 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -12,7 +12,7 @@
{{.i18n.Tr "admin.users.edit_account"}}
- + {{.CsrfTokenHtml}}
From 96a95e9dfd36084752dd769394c6f4103e50af6e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 13 Mar 2015 15:41:51 -0400 Subject: [PATCH 12/36] #988: fix one missing duplicated prefix - update some locale files --- conf/locale/locale_de-DE.ini | 12 ++++++------ conf/locale/locale_ja-JP.ini | 12 ++++++------ conf/locale/locale_ru-RU.ini | 10 +++++----- templates/user/dashboard/feeds.tmpl | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/conf/locale/locale_de-DE.ini b/conf/locale/locale_de-DE.ini index 8d1b2de1b1..228817ee2c 100755 --- a/conf/locale/locale_de-DE.ini +++ b/conf/locale/locale_de-DE.ini @@ -286,8 +286,8 @@ need_auth=Authorisierung benötigt migrate_type=Migrationstyp migrate_type_helper=Dieses Repository wird ein Spiegel migrate_repo=Repository migrieren -migrate.clone_address=Clone Address -migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. +migrate.clone_address=Adresse kopieren +migrate.invalid_local_path=Lokaler Pfad ist ungültig, er existiert nicht oder ist kein Ordner. copy_link=Kopieren click_to_copy=In Zwischenablage kopieren @@ -595,10 +595,10 @@ auths.domain=Domain auths.host=Host auths.port=Port auths.base_dn=Base DN -auths.attribute_username=Username attribute -auths.attribute_name=First name attribute -auths.attribute_surname=Surname attribute -auths.attribute_mail=E-mail attribute +auths.attribute_username=Benutzername Attribut +auths.attribute_name=Vorname Attribut +auths.attribute_surname=Nachname Attribut +auths.attribute_mail=E-Mail Attribut auths.filter=Suchfilter auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP-Authentifizierungstyp diff --git a/conf/locale/locale_ja-JP.ini b/conf/locale/locale_ja-JP.ini index ef43362149..ecea91c87b 100755 --- a/conf/locale/locale_ja-JP.ini +++ b/conf/locale/locale_ja-JP.ini @@ -286,8 +286,8 @@ need_auth=認証が必要 migrate_type=マイグレーションの種類 migrate_type_helper=このリポジトリは ミラー になります migrate_repo=リポジトリを移行 -migrate.clone_address=Clone Address -migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. +migrate.clone_address=クローンアドレス +migrate.invalid_local_path=ローカルパスが無効です。存在しないかディレクトリではありません。 copy_link=コピー click_to_copy=クリップボードにコピー @@ -595,10 +595,10 @@ auths.domain=ドメイン auths.host=ホスト auths.port=ポート auths.base_dn=ベースのドメイン名 -auths.attribute_username=Username attribute -auths.attribute_name=First name attribute -auths.attribute_surname=Surname attribute -auths.attribute_mail=E-mail attribute +auths.attribute_username=ユーザー名属性 +auths.attribute_name=名前属性 +auths.attribute_surname=名字属性 +auths.attribute_mail=Eメール属性 auths.filter=検索フィルター auths.ms_ad_sa=Ms Ad SA auths.smtp_auth=SMTP 認証の種類 diff --git a/conf/locale/locale_ru-RU.ini b/conf/locale/locale_ru-RU.ini index c2a50b9da8..596c7c945f 100755 --- a/conf/locale/locale_ru-RU.ini +++ b/conf/locale/locale_ru-RU.ini @@ -286,8 +286,8 @@ need_auth=Требуется авторизация migrate_type=Тип миграции migrate_type_helper=Этот репозиторий будет зеркалом migrate_repo=Перенос репозитория -migrate.clone_address=Clone Address -migrate.invalid_local_path=Invalid local path, it does not exist or not a directory. +migrate.clone_address=Скопировать адрес +migrate.invalid_local_path=Недопустимый локальный путь. Возможно он не существует или является не папкой. copy_link=Копировать click_to_copy=Скопировать в буфер обмена @@ -343,18 +343,18 @@ settings.transfer_desc=Передать репозиторий другому п settings.new_owner_has_same_repo=У нового владельца уже есть хранилище с таким названием. settings.delete=Удалить этот репозиторий settings.delete_desc=Как только вы удалите репозиторий — пути назад не будет. Удостоверьтесь, что вам это точно нужно. -settings.transfer_notices=

- You will lose access if new owner is a individual user.

- You will remain access if new owner is an organization and you're one of the owners.

+settings.transfer_notices=

- Вы потеряете доступ, если новый владелец является индивидуальным пользователем.

- У Вас останется доступ, если новый владелец является организацией, и вы один из её владельцев.

settings.update_settings_success=Настройка репозитория обновлена успешно. settings.transfer_owner=Новый владелец settings.make_transfer=Выполнить передачу -settings.transfer_succeed=Repository ownership has been transferred successfully. +settings.transfer_succeed=Владение репозиторием было успешно передано. settings.confirm_delete=Подтвердить удаление settings.add_collaborator=Добавить нового соавтора settings.add_collaborator_success=Был добавлен новый соавтор. settings.remove_collaborator_success=Соавтор был удален. settings.user_is_org_member=Пользователь является членом организации, члены которой не могут быть добавлены в качестве соавтора. settings.add_webhook=Добавить Webhook -settings.hooks_desc=Webhooks allow external services to be notified when certain events happen on Gogs. When the specified events happen, we'll send a POST request to each of the URLs you provide. Learn more in our Webhooks Guide. +settings.hooks_desc=Webhooks позволяют внешним службам получать уведомления при возникновении определенных событий на Gogs. При возникновении указанных событий мы отправим запрос POST на каждый заданный вами URL. Узнать больше можно в нашем Руководстве по Webhooks. settings.githooks_desc=Git Hooks are powered by Git itself, you can edit files of supported hooks in the list below to apply custom operations. settings.githook_edit_desc=If hook is not active, sample content will be presented. Leave content to be blank will disable this hook. settings.githook_name=Название Hook'a diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 88fb407536..54b4a95e90 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -28,7 +28,7 @@ {{ $push := ActionContent2Commits .}} {{ $repoLink := .GetRepoLink}} {{range $push.Commits}} -
  • {{ShortSha .Sha1}} {{.Message}}
  • +
  • {{ShortSha .Sha1}} {{.Message}}
  • {{end}} {{if $push.CompareUrl}}
  • {{$.i18n.Tr "action.compare_2_commits"}} »
  • {{end}} From 27491031ba497dfd32313d0fa4b64bf6f917620c Mon Sep 17 00:00:00 2001 From: James Cracknell Date: Fri, 13 Mar 2015 21:20:08 -0600 Subject: [PATCH 13/36] Added .editorconfig --- .editorconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..75ba9dacb5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = tab + +[*.yml] +indent_style = space +indent_size = 2 From 37ab32b6139504640a843b0ddd6204c0ca5880c0 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sat, 14 Mar 2015 09:55:04 -0500 Subject: [PATCH 14/36] Various accessibility fixes, mostly labeling icons. --- conf/locale/locale_en-US.ini | 9 +++++++++ templates/base/navbar.tmpl | 8 ++++---- templates/ng/base/footer.tmpl | 8 ++++---- templates/ng/base/header.tmpl | 8 ++++---- templates/user/dashboard/dashboard.tmpl | 1 + 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index c2fec7d9e8..0a7e3591c6 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -24,6 +24,7 @@ captcha = Captcha repository = Repository organization = Organization mirror = Mirror +new = New new_repo = New Repository new_migrate = New Migration new_fork = New Fork Repository @@ -38,6 +39,7 @@ pull_requests = Pull Requests issues = Issues cancel = Cancel +more = More [install] install = Installation @@ -724,3 +726,10 @@ months = %d months %s years = %d years %s raw_seconds = seconds raw_minutes = minutes + + +[footer] +github = GitHub +twitter = Twitter +gplus = Google+ +weibo = Weibo diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl index b69e9dc4a0..a3055f0fa0 100644 --- a/templates/base/navbar.tmpl +++ b/templates/base/navbar.tmpl @@ -22,16 +22,16 @@
    --> {{end}} - + Sign Out user-avatar - + Settings {{if .IsAdmin}} - + Admin {{end}}