Skip to content

Commit 188e164

Browse files
committed
Merge branch 'master' of github.com:go-gitea/gitea
2 parents 6f55d1e + d958b9d commit 188e164

File tree

13 files changed

+127
-17
lines changed

13 files changed

+127
-17
lines changed

docs/content/doc/advanced/external-renderers.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ In order to get file rendering through external binaries, their associated packa
2828
If you're using a Docker image, your `Dockerfile` should contain something along this lines:
2929

3030
```
31-
FROM gitea/gitea:1.6.0
31+
FROM gitea/gitea:{{< version >}}
3232
[...]
3333
3434
COPY custom/app.ini /data/gitea/conf/app.ini
3535
[...]
3636
37-
RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng python-dev py-pip python3-dev py3-pip
37+
RUN apk --no-cache add asciidoctor freetype freetype-dev gcc g++ libpng python-dev py-pip python3-dev py3-pip py3-zmq
3838
# install any other package you need for your external renderers
3939
4040
RUN pip3 install --upgrade pip

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/go-redis/redis v6.15.2+incompatible
4949
github.com/go-sql-driver/mysql v1.4.1
5050
github.com/go-swagger/go-swagger v0.20.1
51-
github.com/go-xorm/xorm v0.7.8-0.20190924080535-59ed80ce1a67
51+
github.com/go-xorm/xorm v0.7.8-0.20190925172902-71947cf034b6
5252
github.com/gobwas/glob v0.2.3
5353
github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561
5454
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.m
250250
github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y=
251251
github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
252252
github.com/go-xorm/xorm v0.7.6/go.mod h1:nqz2TAsuOHWH2yk4FYWtacCGgdbrcdZ5mF1XadqEHls=
253-
github.com/go-xorm/xorm v0.7.8-0.20190924080535-59ed80ce1a67 h1:mB5RWONyATkQ48+iQZ1lCZNPG3tABilyaEOxDm1QWyU=
254-
github.com/go-xorm/xorm v0.7.8-0.20190924080535-59ed80ce1a67/go.mod h1:RSsmsVARCy4sayuKWFPaVNQMPYGLNRIK71YIVvgImL0=
253+
github.com/go-xorm/xorm v0.7.8-0.20190925172902-71947cf034b6 h1:kwKsKxuD8cUIOHWaMk5nuBU9ZUTnGpN2c/e4Mt6RTAo=
254+
github.com/go-xorm/xorm v0.7.8-0.20190925172902-71947cf034b6/go.mod h1:RSsmsVARCy4sayuKWFPaVNQMPYGLNRIK71YIVvgImL0=
255255
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
256256
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
257257
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=

models/action_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func TestPushCommits_AvatarLink(t *testing.T) {
173173
pushCommits.Len = len(pushCommits.Commits)
174174

175175
assert.Equal(t,
176-
"https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon",
176+
"/suburl/user/avatar/user2/-1",
177177
pushCommits.AvatarLink("[email protected]"))
178178

179179
assert.Equal(t,

models/user.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"image/png"
1818
"os"
1919
"path/filepath"
20+
"strconv"
2021
"strings"
2122
"time"
2223
"unicode/utf8"
@@ -374,9 +375,20 @@ func (u *User) generateRandomAvatar(e Engine) error {
374375
return nil
375376
}
376377

377-
// SizedRelAvatarLink returns a relative link to the user's avatar. When
378-
// applicable, the link is for an avatar of the indicated size (in pixels).
378+
// SizedRelAvatarLink returns a link to the user's avatar via
379+
// the local explore page. Function returns immediately.
380+
// When applicable, the link is for an avatar of the indicated size (in pixels).
379381
func (u *User) SizedRelAvatarLink(size int) string {
382+
return strings.TrimRight(setting.AppSubURL, "/") + "/user/avatar/" + u.Name + "/" + strconv.Itoa(size)
383+
}
384+
385+
// RealSizedAvatarLink returns a link to the user's avatar. When
386+
// applicable, the link is for an avatar of the indicated size (in pixels).
387+
//
388+
// This function make take time to return when federated avatars
389+
// are in use, due to a DNS lookup need
390+
//
391+
func (u *User) RealSizedAvatarLink(size int) string {
380392
if u.ID == -1 {
381393
return base.DefaultAvatarLink()
382394
}

options/locale/TRANSLATORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file lists all PUBLIC individuals having contributed content to the translation.
22
# Entries are in alphabetical order.
33

4+
Adam Jurkiewicz <a DOT jurkiewicz5 AT gmail DOT com>
45
Adam Strzelecki <ono AT java DOT pl>
56
Adrian Verde <me AT adrianverde DOT com>
67
Akihiro YAGASAKI <yaggytter AT momiage DOT com>

options/locale/locale_zh-CN.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ enterred_invalid_repo_name=输入的仓库名称不正确
318318
enterred_invalid_owner_name=新的所有者名称无效。
319319
enterred_invalid_password=输入的密码不正确
320320
user_not_exist=该用户名不存在
321+
team_not_exist=团队不存在
321322
last_org_owner=您不能从 "所有者" 团队中删除最后一个用户。在任何给定的团队中必须至少有一个所有者。
322323
cannot_add_org_to_team=组织不能被加入到团队中。
323324
@@ -1135,6 +1136,7 @@ settings.collaboration=协作者
11351136
settings.collaboration.admin=管理员
11361137
settings.collaboration.write=可写权限
11371138
settings.collaboration.read=可读权限
1139+
settings.collaboration.owner=所有者
11381140
settings.collaboration.undefined=未定义
11391141
settings.hooks=管理 Web 钩子
11401142
settings.githooks=管理 Git 钩子
@@ -1216,6 +1218,11 @@ settings.collaborator_deletion_desc=删除协作者后他将无法再对此仓
12161218
settings.remove_collaborator_success=协作者删除成功!
12171219
settings.search_user_placeholder=搜索用户...
12181220
settings.org_not_allowed_to_be_collaborator=组织不允许被添加为仓库协作者!
1221+
settings.change_team_access_not_allowed=更改仓库的团队访问权限仅限于组织所有者
1222+
settings.team_not_in_organization=团队不在与仓库相同的组织中
1223+
settings.add_team_duplicate=团队已经拥有仓库
1224+
settings.add_team_success=团队现在可以访问仓库。
1225+
settings.remove_team_success=团队访问仓库的权限已被删除。
12191226
settings.add_webhook=添加 Web 钩子
12201227
settings.add_webhook.invalid_channel_name=Webhook 通道名称不能为空且不能仅包含一个 # 字符。
12211228
settings.hooks_desc=当Gitea事件发生时,Web钩子自动发出HTTP POST请求。在 <a target="_blank" rel="noopener noreferrer" href="%s"> 指南</a> 中阅读更多内容。
@@ -1474,6 +1481,8 @@ settings.options=组织
14741481
settings.full_name=组织全名
14751482
settings.website=官方网站
14761483
settings.location=所在地区
1484+
settings.permission=权限
1485+
settings.repoadminchangeteam=仓库管理员可以添加或移除团队的访问权限
14771486
settings.visibility=可见性
14781487
settings.visibility.public=公开
14791488
settings.visibility.limited=受限 (仅对登录用户可见)
@@ -1871,7 +1880,7 @@ monitor.name=任务名称
18711880
monitor.schedule=任务安排
18721881
monitor.next=下次执行时间
18731882
monitor.previous=上次执行时间
1874-
monitor.execute_times=执行时长
1883+
monitor.execute_times=执行次数
18751884
monitor.process=运行中进程
18761885
monitor.desc=进程描述
18771886
monitor.start=开始时间

routers/routes/routes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ func RegisterRoutes(m *macaron.Macaron) {
404404
// r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
405405
m.Any("/activate", user.Activate, reqSignIn)
406406
m.Any("/activate_email", user.ActivateEmail)
407+
m.Get("/avatar/:username/:size", user.Avatar)
407408
m.Get("/email2user", user.Email2User)
408409
m.Get("/recover_account", user.ResetPasswd)
409410
m.Post("/recover_account", user.ResetPasswdPost)

routers/user/avatar.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package user
6+
7+
import (
8+
"strconv"
9+
10+
"code.gitea.io/gitea/models"
11+
"code.gitea.io/gitea/modules/context"
12+
"code.gitea.io/gitea/modules/log"
13+
)
14+
15+
// Avatar redirect browser to user avatar of requested size
16+
func Avatar(ctx *context.Context) {
17+
userName := ctx.Params(":username")
18+
size, err := strconv.Atoi(ctx.Params(":size"))
19+
if err != nil {
20+
ctx.ServerError("Invalid avatar size", err)
21+
return
22+
}
23+
24+
log.Debug("Asked avatar for user %v and size %v", userName, size)
25+
26+
user, err := models.GetUserByName(userName)
27+
if err != nil {
28+
if models.IsErrUserNotExist(err) {
29+
ctx.ServerError("Requested avatar for invalid user", err)
30+
} else {
31+
ctx.ServerError("Retrieving user by name", err)
32+
}
33+
return
34+
}
35+
36+
ctx.Redirect(user.RealSizedAvatarLink(size))
37+
}

vendor/github.com/go-xorm/xorm/dialect_mssql.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/go-xorm/xorm/session_insert.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/go-xorm/xorm/statement_args.go

Lines changed: 48 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ github.com/go-swagger/go-swagger/cmd/swagger/commands/initcmd
198198
github.com/go-swagger/go-swagger/codescan
199199
github.com/go-swagger/go-swagger/generator
200200
github.com/go-swagger/go-swagger/scan
201-
# github.com/go-xorm/xorm v0.7.8-0.20190924080535-59ed80ce1a67
201+
# github.com/go-xorm/xorm v0.7.8-0.20190925172902-71947cf034b6
202202
github.com/go-xorm/xorm
203203
# github.com/gobwas/glob v0.2.3
204204
github.com/gobwas/glob

0 commit comments

Comments
 (0)