From 84feb016f5934d271bd00f965841072e56e580e3 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Tue, 9 Jan 2018 19:40:05 +0100 Subject: [PATCH 01/10] Remove useless fmt.Errorf("%v", err) (#3337) --- routers/user/home.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/user/home.go b/routers/user/home.go index 01a106813..9d42bb0ae 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -310,7 +310,7 @@ func Issues(ctx *context.Context) { showRepos := models.RepositoryListOfMap(showReposMap) sort.Sort(showRepos) if err = showRepos.LoadAttributes(); err != nil { - ctx.Handle(500, "LoadAttributes", fmt.Errorf("%v", err)) + ctx.Handle(500, "LoadAttributes", err) return } From 6070c9a5b8f6a15b1ebcc807d7311d7e0f2f251c Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Tue, 9 Jan 2018 18:41:13 +0000 Subject: [PATCH 02/10] [skip ci] Updated translations via Crowdin --- options/locale/locale_zh-HK.ini | 37 +++++++++++++++------------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/options/locale/locale_zh-HK.ini b/options/locale/locale_zh-HK.ini index eeab50e45..b5824510c 100644 --- a/options/locale/locale_zh-HK.ini +++ b/options/locale/locale_zh-HK.ini @@ -18,11 +18,8 @@ template=樣板 language=語言 notifications=訊息 create_new=建立... -user_profile_and_more=用戶訊息及更多 -signed_in_as=已登入用戶 enable_javascript=本網站在啟用 JavaScript 的情況下可以運作的更好。 -username=用戶名稱 email=電子郵件 password=密碼 re_type=確認密碼 @@ -45,7 +42,7 @@ account_settings=帳號設定 settings=設定 your_profile=個人資料 your_starred=個人收藏 -your_settings=用戶設定 +your_settings=使用者設定 all=所有 sources=來源 @@ -87,7 +84,7 @@ repo_path_helper=所有遠端 Git 儲存庫會儲存到此目錄。 lfs_path=LFS 根目錄 lfs_path_helper=以 Git LFS 儲存檔案時會被儲存在此目錄中。請留空以停用 LFS 功能。 run_user=執行使用者 -run_user_helper=該用戶必須具有對儲存庫根目錄和執行 Gitea 的操作權限。 +run_user_helper=該使用者必須具有對儲存庫根目錄和執行 Gitea 的操作權限。 domain=域名 domain_helper=該設定影響 SSH 複製地址。 ssh_port=SSH 連接埠 @@ -112,11 +109,11 @@ server_service_title=伺服器和其他服務設定 offline_mode=啓用離線模式 offline_mode_popup=停用 CDN 讓所有資源檔案都從本地伺服器提供。 disable_gravatar=禁用 Gravatar 服務 -disable_gravatar_popup=禁用 Gravatar 和自定義源,僅使用由用戶上傳或默認的頭像。 +disable_gravatar_popup=禁用 Gravatar 和自訂圖片,僅使用由用戶上傳或默認的大頭貼。 federated_avatar_lookup=開啟聯合頭像查詢 federated_avatar_lookup_popup=開啟聯合頭像查詢並使用基於開放源碼的 libravatar 服務 -disable_registration=禁止用戶自主註冊 -disable_registration_popup=禁止用戶自主註冊功能,只有管理員可以新增帳號。 +disable_registration=禁止用戶自行註冊 +disable_registration_popup=禁止用戶自行註冊功能,只有管理員可以新增帳號。 enable_captcha=啟用驗證碼服務 enable_captcha_popup=要求在用戶註冊時輸入驗證碼 require_sign_in_view=啓用登錄訪問限制 @@ -142,10 +139,10 @@ default_keep_email_private_popup=這是使用者電子郵件地址是否顯示 default_allow_create_organization=新使用者建立組織的權限的預設值 default_allow_create_organization_popup=這是分配給新使用者的預設權限。如過設為 true 則新使用者將被允許建立新的組織。 no_reply_address=不可回復的郵件地址 -no_reply_address_helper=關於git日誌中紀錄用戶電子郵件地址的域名,如果使用者留的E-mail 刻意採用非公開的,例如名字是'Joe'和域名是'noreply.example.org' ,那麼會被記為 'joe@noreply.example.org' +no_reply_address_helper=關於 git 日誌中紀錄用戶電子郵件地址的域名,如果使用者留的 E-mail 刻意採用非公開的,例如名字是 'Joe' 和域名是 'noreply.example.org' ,那麼會被記為 'joe@noreply.example.org' [home] -uname_holder=用戶名或郵箱 +uname_holder=使用者名稱或電郵地址 password_holder=密碼 switch_dashboard_context=切換控制面版用戶 my_repos=我的儲存庫 @@ -160,7 +157,7 @@ issues.in_your_repos=屬於該用戶儲存庫的 [explore] repos=儲存庫 -users=用戶 +users=使用者 organizations=組織 search=搜尋 repo_no_results=未發現相符儲存庫。 @@ -220,7 +217,7 @@ no=取消操作 modify=確認修改 [form] -UserName=用戶名 +UserName=使用者名稱 RepoName=儲存庫名稱 Email=郵箱地址 Password=密碼 @@ -253,7 +250,7 @@ unknown_error=未知錯誤: captcha_incorrect=CAPTCHA 驗證碼不正確。 password_not_match=您設定的密碼不匹配。 -username_been_taken=用戶名稱已被使用 +username_been_taken=使用者名稱已被使用 repo_name_been_taken=儲存庫名稱已被使用。 org_name_been_taken=組織名稱已被使用。 team_name_been_taken=團隊名稱已被使用。 @@ -264,7 +261,7 @@ username_password_incorrect=帳戶名稱或密碼有誤 enterred_invalid_repo_name=請檢查您輸入的儲存庫名稱是否正確。 enterred_invalid_owner_name=請檢查您輸入的擁有者名稱是否正確。 enterred_invalid_password=請檢查您輸入的密碼是否正確。 -user_not_exist=該用戶名不存在 +user_not_exist=該使用者名稱並不存在 last_org_owner=無法移除群組內唯一的管理員 cannot_add_org_to_team=組織不能被新增為團隊成員。 @@ -290,8 +287,8 @@ following=關註中 follow=關注 unfollow=取消關注 -form.name_reserved=用戶名 '%s' 是被保留的。 -form.name_pattern_not_allowed=用戶名不允許 '%s' 的格式。 +form.name_reserved=這個使用者名稱已被系統保留,請改用其他名稱。 +form.name_pattern_not_allowed=使用者名稱並不允許包含「 %s 」字符。 [settings] profile=個人訊息 @@ -305,7 +302,7 @@ delete=刪除帳戶 twofa=兩步驟驗證 account_link=外部帳戶 organization=組織 -uid=用戶 ID +uid=使用者 ID public_profile=公開訊息 profile_desc=您的郵件地址將會被公開,並被用於接收帳戶的所有提醒和通知。 @@ -315,7 +312,7 @@ website=個人網站 location=所在地區 update_profile=更新訊息 update_profile_success=您的個人資料已被更新 -change_username=用戶名將被修改 +change_username=使用者名稱將會被更改 change_username_prompt=此更動將會更改你所連結的帳戶 continue=繼續操作 cancel=取消操作 @@ -335,7 +332,7 @@ new_password=新的密碼 retype_new_password=重新輸入新的密碼 password_incorrect=當前密碼不正確! change_password_success=密碼修改成功!您現在可以使用新的密碼登入。 -password_change_disabled=非本地用戶不允許透過 Web 介面變更密碼。 +password_change_disabled=非註冊使用者無法透過網頁介面變更密碼。 emails=電子郵件地址 manage_emails=管理電子郵件地址 @@ -358,7 +355,7 @@ add_email_confirmation_sent=一封新的確認郵件已經被發送至 %s,請 add_email_success=新的電子郵件新增成功。 add_openid_success=你的 OpenID 位址已成功新增。 keep_email_private=不公開 Email 地址 -keep_email_private_popup=設定此選項會使得其他用戶看不到您的電子郵件信箱 +keep_email_private_popup=設定此選項會使到其他使用者看不到您的電郵地址 openid_desc=您的 OpenID 位址將讓您的身份驗證委派到選擇的供應商 manage_ssh_keys=管理 SSH 金鑰 From b5fba4cd426a84927aeac1fac1af3b3c713203ac Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Wed, 10 Jan 2018 00:11:01 +0100 Subject: [PATCH 03/10] Fix organization profile on mobile devices (#3332) --- templates/org/home.tmpl | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index caef9034b..0b5ae0fac 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -1,21 +1,18 @@ {{template "base/head" .}}
-
-
-
- -
-
- {{.Org.DisplayName}} - {{if .IsOrganizationOwner}}{{end}} -
- {{if .Org.Description}}

{{.Org.Description}}

{{end}} -
- {{if .Org.Location}}
{{.Org.Location}}
{{end}} - {{if .Org.Website}}{{end}} -
-
- + {{/* overflow: auto is the clearfix - this avoids the image going beyond + the container where it is supposed to stay inside. */}} +
+ +
+
+ {{.Org.DisplayName}} + {{if .IsOrganizationOwner}}{{end}} +
+ {{if .Org.Description}}

{{.Org.Description}}

{{end}} +
+ {{if .Org.Location}}
{{.Org.Location}}
{{end}} + {{if .Org.Website}}{{end}}
@@ -23,7 +20,7 @@
-
+
{{if .IsOrganizationOwner}}
From 88a3bb6d42536d0458b48269b26d821d59055fe2 Mon Sep 17 00:00:00 2001 From: Morgan Bazalgette Date: Wed, 10 Jan 2018 05:58:08 +0100 Subject: [PATCH 04/10] Make the default action for the gitea executable that of running the webserver (#3331) --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index ec7324ee0..c9cea713d 100644 --- a/main.go +++ b/main.go @@ -35,6 +35,8 @@ func main() { app := cli.NewApp() app.Name = "Gitea" app.Usage = "A painless self-hosted Git service" + app.Description = `By default, gitea will start serving using the webserver with no +arguments - which can alternatively be run by running the subcommand web.` app.Version = Version + formatBuiltWith(Tags) app.Commands = []cli.Command{ cmd.CmdWeb, @@ -45,6 +47,7 @@ func main() { cmd.CmdAdmin, } app.Flags = append(app.Flags, []cli.Flag{}...) + app.Action = cmd.CmdWeb.Action err := app.Run(os.Args) if err != nil { log.Fatal(4, "Failed to run app with %s: %v", os.Args, err) From 45c264f681e3f7e1a22a191029836a690959aac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Wed, 10 Jan 2018 07:19:50 +0100 Subject: [PATCH 05/10] Templates for extra links in top navbar and repo tool tabs. (#3308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These templates add content to the top navbar and to the repository page. This way we do not have to copy and modify the whole template, and re-modify it after upgrading Gitea if it changes. Signed-off-by: Alberto González Palomo --- docs/content/doc/advanced/customizing-gitea.en-us.md | 2 ++ templates/base/head.tmpl | 3 +++ templates/custom/extra_links.tmpl | 0 templates/custom/extra_tabs.tmpl | 0 templates/repo/header.tmpl | 2 ++ 5 files changed, 7 insertions(+) create mode 100644 templates/custom/extra_links.tmpl create mode 100644 templates/custom/extra_tabs.tmpl diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 5be30740c..55e47d020 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -66,6 +66,8 @@ To add custom HTML to the header or the footer of the page, in the `templates/cu directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be a useful place to add custom CSS files or additional Javascript. +If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `extra_links.tmpl` and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory. + ## Customizing gitignores, labels, licenses, locales, and readmes. Place custom files in corresponding sub-folder under `custom/options`. diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 04c5a43e4..a486d9b9b 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -158,6 +158,9 @@ {{end}} {{.i18n.Tr "explore"}} + + {{template "custom/extra_links" .}} + {{/*
diff --git a/templates/custom/extra_links.tmpl b/templates/custom/extra_links.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/templates/custom/extra_tabs.tmpl b/templates/custom/extra_tabs.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c83505ac9..db5b6c7f0 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -89,6 +89,8 @@ {{end}} + {{template "custom/extra_tabs" .}} + {{if .IsRepositoryAdmin}}