mirror of https://github.com/go-gitea/gitea
commit
8d2a6fc484
@ -0,0 +1,34 @@ |
|||||||
|
// +build !cert
|
||||||
|
|
||||||
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
|
// Copyright 2014 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 cmd |
||||||
|
|
||||||
|
import ( |
||||||
|
"fmt" |
||||||
|
"time" |
||||||
|
|
||||||
|
"github.com/codegangsta/cli" |
||||||
|
) |
||||||
|
|
||||||
|
var CmdCert = cli.Command{ |
||||||
|
Name: "cert", |
||||||
|
Usage: "Generate self-signed certificate", |
||||||
|
Description: `Generate a self-signed X.509 certificate for a TLS server.
|
||||||
|
Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.`, |
||||||
|
Action: runCert, |
||||||
|
Flags: []cli.Flag{ |
||||||
|
cli.StringFlag{"host", "", "Comma-separated hostnames and IPs to generate a certificate for", ""}, |
||||||
|
cli.StringFlag{"ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521", ""}, |
||||||
|
cli.IntFlag{"rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set", ""}, |
||||||
|
cli.StringFlag{"start-date", "", "Creation date formatted as Jan 1 15:04:05 2011", ""}, |
||||||
|
cli.DurationFlag{"duration", 365 * 24 * time.Hour, "Duration that certificate is valid for", ""}, |
||||||
|
cli.BoolFlag{"ca", "whether this cert should be its own Certificate Authority", ""}, |
||||||
|
}, |
||||||
|
} |
||||||
|
|
||||||
|
func runCert(ctx *cli.Context) { |
||||||
|
fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.") |
||||||
|
} |
@ -0,0 +1,642 @@ |
|||||||
|
app_desc = 基於 Go 語言的自助 Git 服務 |
||||||
|
|
||||||
|
home = 首頁 |
||||||
|
dashboard = 控制面版 |
||||||
|
explore = 探索 |
||||||
|
help = 幫助 |
||||||
|
sign_in = 登錄 |
||||||
|
social_sign_in = 社交帳號登錄:第 2 步 <small>關聯帳號</small> |
||||||
|
sign_out = 退出 |
||||||
|
sign_up = 註冊 |
||||||
|
register = 註冊 |
||||||
|
website = 官方網站 |
||||||
|
version = 當前版本 |
||||||
|
page = 頁面 |
||||||
|
template = 模版 |
||||||
|
language = 語言選項 |
||||||
|
|
||||||
|
username = 用戶名 |
||||||
|
email = 郵箱 |
||||||
|
password = 密碼 |
||||||
|
re_type = 確認密碼 |
||||||
|
captcha = 驗證碼 |
||||||
|
|
||||||
|
repository = 倉庫 |
||||||
|
organization = 組織 |
||||||
|
mirror = 鏡像 |
||||||
|
new_repo = 創建新的倉庫 |
||||||
|
new_migrate = 遷移外部倉庫 |
||||||
|
new_org = 創建新的組織 |
||||||
|
manage_org = 管理我的組織 |
||||||
|
admin_panel = 管理面版 |
||||||
|
account_settings = 帳戶設置 |
||||||
|
settings = 帳戶設置 |
||||||
|
|
||||||
|
news_feed = 最新活動 |
||||||
|
pull_requests = 合併請求 |
||||||
|
issues = 問題管理 |
||||||
|
|
||||||
|
cancel = 取消 |
||||||
|
|
||||||
|
[install] |
||||||
|
install = 安裝頁面 |
||||||
|
title = 首次執行安裝程序 |
||||||
|
requite_db_desc = Gogs 允許後端數據庫為 MySQL、PostgreSQL 或 SQLite3,但是 SQLite3 一般只有官方二進制發行版才支持。 |
||||||
|
db_type = 數據庫類型 |
||||||
|
host = 數據庫主機 |
||||||
|
user = 數據庫用戶 |
||||||
|
password = 數據庫用戶密碼 |
||||||
|
db_name = 數據庫名稱 |
||||||
|
db_helper = 如果您使用 MySQL,請使用 INNODB 引擎以及 utf8_general_ci 字符集。 |
||||||
|
ssl_mode = SSL 模式 |
||||||
|
path = 數據庫文件路徑 |
||||||
|
sqlite_helper = SQLite3 數據庫的文件路徑。 |
||||||
|
general_title = 應用基本設置 |
||||||
|
repo_path = 倉庫根目錄 |
||||||
|
repo_path_helper = 所有 Git 遠程倉庫都將被存放於該目錄。 |
||||||
|
run_user = 執行系統用戶 |
||||||
|
run_user_helper = 該用戶必須具有對倉庫根目錄和執行 Gogs 的操作權限。 |
||||||
|
domain = 域名 |
||||||
|
domain_helper = 該設置影響 SSH 克隆地址。 |
||||||
|
app_url = 應用 URL |
||||||
|
app_url_helper = 該設置影響 HTTP/HTTPS 克隆地址和一些郵箱中的鏈接。 |
||||||
|
email_title = 郵件服務設置(可選) |
||||||
|
smtp_host = SMTP 主機 |
||||||
|
mailer_user = 發送郵箱 |
||||||
|
mailer_password = 發送郵箱密碼 |
||||||
|
notify_title = 通知提醒設置(可選) |
||||||
|
register_confirm = 啟用註冊郵箱確認 |
||||||
|
mail_notify = 啟用郵件通知提醒 |
||||||
|
admin_title = 管理員帳號設置 |
||||||
|
admin_name = 管理員用戶名 |
||||||
|
admin_password = 管理員密碼 |
||||||
|
confirm_password = 確認密碼 |
||||||
|
admin_email = 管理員郵箱 |
||||||
|
install_gogs = 立即安裝 |
||||||
|
test_git_failed = 無法識別 'git' 命令:%v |
||||||
|
sqlite3_not_available = 您所使用的發行版本不支持 SQLite3,請從 http://gogs.io/docs/installation/install_from_binary.html 下載官方二進制發行版本,而不是 gobuild 版本。 |
||||||
|
invalid_db_setting = 數據庫設置不正確:%v |
||||||
|
invalid_repo_path = 倉庫根目錄設置不正確:%v |
||||||
|
run_user_not_match = 執行系統用戶非當前用戶:%s -> %s |
||||||
|
save_config_failed = 應用配置保存失敗:%v |
||||||
|
invalid_admin_setting = 管理員帳戶設置不正確:%v |
||||||
|
install_success = 您好!我們很高興您選擇使用 Gogs,祝您使用愉快,代碼從此無 BUG! |
||||||
|
|
||||||
|
[home] |
||||||
|
uname_holder = 用戶名或郵箱 |
||||||
|
password_holder = 密碼 |
||||||
|
switch_dashboard_context = 切換控制面版用戶 |
||||||
|
my_repos = 我的倉庫 |
||||||
|
collaborative_repos = 參與協作的倉庫 |
||||||
|
my_orgs = 我的組織 |
||||||
|
my_mirrors = 我的鏡像 |
||||||
|
|
||||||
|
[explore] |
||||||
|
repos = 探索倉庫 |
||||||
|
|
||||||
|
[auth] |
||||||
|
create_new_account = 創建帳戶 |
||||||
|
register_hepler_msg = 已經註冊?立即登錄! |
||||||
|
social_register_hepler_msg = 已經註冊?立即綁定! |
||||||
|
disable_register_prompt = 對不起,註冊功能已被關閉。請聯系網站管理員。 |
||||||
|
disable_register_mail = 對不起,註冊郵箱確認功能已被關閉。 |
||||||
|
remember_me = 記住登錄 |
||||||
|
forgot_password = 忘記密碼 |
||||||
|
forget_password = 忘記密碼? |
||||||
|
sign_up_now = 還沒帳戶?馬上註冊。 |
||||||
|
confirmation_mail_sent_prompt = 一封新的確認郵件已經被發送至 <b>%s</b>,請檢查您的收件箱並在 %d 小時內完成確認註冊操作。 |
||||||
|
sign_in_email = 登錄到您的郵箱 |
||||||
|
active_your_account = 激活您的帳戶 |
||||||
|
resent_limit_prompt = 對不起,您請求發送激活郵件過於頻繁,請等待 3 分鐘後再試! |
||||||
|
has_unconfirmed_mail = %s 您好,系統檢測到您有一封發送至 <b>%s</b> 但未被確認的郵件。如果您未收到激活郵件,或需要重新發送,請單擊下方的按鈕。 |
||||||
|
resend_mail = 單擊此處重新發送確認郵件 |
||||||
|
email_not_associate = 您輸入的郵箱地址未被關聯到任何帳號! |
||||||
|
send_reset_mail = 單擊此處(重新)發送您的密碼重置郵件 |
||||||
|
reset_password = 重置密碼 |
||||||
|
invalid_code = 對不起,您的確認代碼已過期或已失效。 |
||||||
|
reset_password_helper = 單擊此處重置密碼 |
||||||
|
password_too_short = 密碼長度不能少於 6 位! |
||||||
|
|
||||||
|
[form] |
||||||
|
UserName = 用戶名 |
||||||
|
RepoName = 倉庫名稱 |
||||||
|
Email = 郵箱地址 |
||||||
|
Password = 密碼 |
||||||
|
Retype = 確認密碼 |
||||||
|
SSHTitle = SSH 密鑰名稱 |
||||||
|
HttpsUrl = HTTPS URL 地址 |
||||||
|
PayloadUrl = 推送地址 |
||||||
|
TeamName = 團隊名稱 |
||||||
|
AuthName = 認證名稱 |
||||||
|
AdminEmail = 管理員郵箱 |
||||||
|
|
||||||
|
require_error = 不能為空。 |
||||||
|
alpha_dash_error = 必須為英文字母、阿拉伯數字或橫線(-_)。 |
||||||
|
alpha_dash_dot_error = 必須為英文字母、阿拉伯數字、橫線(-_)或點。 |
||||||
|
min_size_error = 長度最小為 %s 個字符。 |
||||||
|
max_size_error = 長度最大為 %s 個字符。 |
||||||
|
email_error = 不是一個有效的郵箱地址。 |
||||||
|
url_error = 不是一個有效的 URL。 |
||||||
|
unknown_error = 未知錯誤: |
||||||
|
captcha_incorrect = 驗證碼未匹配。 |
||||||
|
password_not_match = 密碼與確認密碼未匹配。 |
||||||
|
|
||||||
|
username_been_taken = 用戶名已經被佔用。 |
||||||
|
repo_name_been_taken = 倉庫名稱已經被佔用。 |
||||||
|
org_name_been_taken = 組織名稱已經被佔用。 |
||||||
|
team_name_been_taken = 團隊名稱已經被佔用。 |
||||||
|
email_been_used = 郵箱地址已經被使用。 |
||||||
|
ssh_key_been_used = SSH 密鑰已經被使用。 |
||||||
|
illegal_username = 您的用戶名包含不合法字符。 |
||||||
|
illegal_repo_name = 倉庫名稱包含不合法字符。 |
||||||
|
illegal_org_name = 組織名稱包含不合法字符。 |
||||||
|
illegal_team_name = 團隊名稱包含不合法字符。 |
||||||
|
username_password_incorrect = 用戶名或密碼不正確。 |
||||||
|
enterred_invalid_repo_name = 請檢查您輸入的倉庫名稱是正確。 |
||||||
|
enterred_invalid_owner_name = 請檢查您輸入的新所有者用戶名是否正確。 |
||||||
|
enterred_invalid_password = 請檢查您輸入的密碼是否正確。 |
||||||
|
user_not_exist = 被操作的用戶不存在! |
||||||
|
last_org_owner = 被移除用戶為最後一位管理員。請添加一位新的管理員再進行移除成員操作! |
||||||
|
|
||||||
|
invalid_ssh_key = 很抱歉,我們無法驗證您輸入的 SSH 密鑰:%s |
||||||
|
auth_failed = 授權驗證失敗:%v |
||||||
|
|
||||||
|
still_own_repo = 您的帳戶仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除帳戶操作! |
||||||
|
org_still_own_repo = 該組織仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除組織操作! |
||||||
|
|
||||||
|
still_own_user = 該授權認證依舊被部分用戶使用,請先刪除該部分用戶後再試! |
||||||
|
|
||||||
|
[user] |
||||||
|
change_avatar = 到 gravatar.com 上修改您的頭像 |
||||||
|
join_on = 加入於 |
||||||
|
repositories = 倉庫列表 |
||||||
|
activity = 公開活動 |
||||||
|
followers = 關註者 |
||||||
|
starred = 已點讚 |
||||||
|
following = 關註中 |
||||||
|
|
||||||
|
[settings] |
||||||
|
profile = 個人信息 |
||||||
|
password = 修改密碼 |
||||||
|
ssh_keys = 管理 SSH 密鑰 |
||||||
|
social = 社交帳號綁定 |
||||||
|
orgs = 管理組織 |
||||||
|
delete = 刪除帳戶 |
||||||
|
uid = 用戶 ID |
||||||
|
|
||||||
|
public_profile = 公開信息 |
||||||
|
profile_desc = 您的郵箱地址將會被公開,並被用於接收帳戶的所有提醒和通知。 |
||||||
|
full_name = 自定義名稱 |
||||||
|
website = 個人網站 |
||||||
|
location = 所在地區 |
||||||
|
update_profile = 更新信息 |
||||||
|
update_profile_success = 您的個人信息更新成功! |
||||||
|
change_username = 用戶名將被修改 |
||||||
|
change_username_desc = 用戶名被修改,您確定要繼續操作嗎?這將會影響到所有與您帳戶有關的鏈接。 |
||||||
|
continue = 繼續操作 |
||||||
|
cancel = 取消操作 |
||||||
|
|
||||||
|
change_password = 修改密碼 |
||||||
|
old_password = 當前密碼 |
||||||
|
new_password = 新的密碼 |
||||||
|
password_incorrect = 當前密碼不正確! |
||||||
|
change_password_success = 密碼修改成功!您現在可以使用新的密碼登錄。 |
||||||
|
|
||||||
|
manage_ssh_keys = 管理 SSH 密鑰 |
||||||
|
add_key = 增加密鑰 |
||||||
|
ssh_desc = 以下是與您帳戶所關聯的 SSH 密鑰,如果您發現有陌生的密鑰,請立即刪除它! |
||||||
|
ssh_helper = <strong>需要幫助?</strong> 請查看有關 <a href="https://help.github.com/articles/generating-ssh-keys">如何生成 SSH 密鑰</a> 或 <a href="https://help.github.com/ssh-issues/">常見 SSH 問題</a> 尋找答案。 |
||||||
|
add_new_key = 增加 SSH 密鑰 |
||||||
|
key_name = 密鑰名稱 |
||||||
|
key_content = 密鑰內容 |
||||||
|
add_key_success = 新的 SSH 密鑰添加成功! |
||||||
|
delete_key = 刪除 |
||||||
|
add_on = 增加於 |
||||||
|
last_used = 上次使用在 |
||||||
|
no_activity = 沒有最近活動 |
||||||
|
|
||||||
|
manage_social = 管理關聯社交帳戶 |
||||||
|
social_desc = 以下是與您帳戶所關聯的社交帳號,如果您發現有陌生的關聯,請立即解除綁定! |
||||||
|
unbind = 解除綁定 |
||||||
|
unbind_success = 社交帳號解除綁定成功! |
||||||
|
|
||||||
|
delete_account = 刪除當前帳戶 |
||||||
|
delete_prompt = 刪除操作會永久清除您的帳戶信息,並且 <strong>不可恢復</strong>! |
||||||
|
confirm_delete_account = 確認刪除帳戶 |
||||||
|
delete_account_title = 帳戶刪除操作 |
||||||
|
delete_account_desc = 該帳戶將被永久性刪除,您確定要繼續操作嗎? |
||||||
|
|
||||||
|
[repo] |
||||||
|
owner = 擁有者 |
||||||
|
repo_name = 倉庫名稱 |
||||||
|
repo_name_helper = 偉大的倉庫名稱一般都較短、令人深刻並且 <strong>獨一無二</strong> 的。 |
||||||
|
visibility = 可見度 |
||||||
|
visiblity_helper = 本倉庫將是 <span class="label label-red label-radius">私有的</span> |
||||||
|
repo_desc = 倉庫描述 |
||||||
|
repo_lang = 倉庫語言 |
||||||
|
repo_lang_helper = 請選擇 .gitignore 文件 |
||||||
|
license = 授權許可 |
||||||
|
license_helper = 請選擇授權許可文件 |
||||||
|
init_readme = 使用 README.md 文件初始化倉庫 |
||||||
|
create_repo = 創建倉庫 |
||||||
|
default_branch = 默認分支 |
||||||
|
mirror_interval = 鏡像同步周期(小時) |
||||||
|
goget_meta = Go-Get 支持 |
||||||
|
goget_meta_helper = 本倉庫將可以通過 <span class="label label-blue label-radius">Go Get</span> 獲取 |
||||||
|
|
||||||
|
need_auth = 需要授權驗證 |
||||||
|
migrate_type = 遷移類型 |
||||||
|
migrate_type_helper = 本倉庫將是 <span class="label label-blue label-radius">鏡像</span> |
||||||
|
migrate_repo = 遷移倉庫 |
||||||
|
|
||||||
|
copy_link = 復製鏈接 |
||||||
|
click_to_copy = 復製到剪切簿 |
||||||
|
copied = 復製成功 |
||||||
|
clone_helper = 不知道如何操作?訪問 <a target="_blank" href="http://git-scm.com/book/zh/Git-基礎-取得項目的-Git-倉庫">此處</a> 查看幫助! |
||||||
|
unwatch = 取消關註 |
||||||
|
watch = 關註 |
||||||
|
unstar = 取消點讚 |
||||||
|
star = 點讚 |
||||||
|
fork = 派生 |
||||||
|
|
||||||
|
no_desc = 暫無描述 |
||||||
|
quick_guide = 快速幫助 |
||||||
|
clone_this_repo = 克隆當前倉庫 |
||||||
|
create_new_repo_command = 從命令行創建一個新的倉庫 |
||||||
|
push_exist_repo = 從命令行推送已經創建的倉庫 |
||||||
|
|
||||||
|
branch = 分支 |
||||||
|
tree = 目錄樹 |
||||||
|
branch_and_tags = 分支與標籤 |
||||||
|
branches = 分支列表 |
||||||
|
tags = 標籤列表 |
||||||
|
issues = 問題管理 |
||||||
|
commits = 提交歷史 |
||||||
|
releases = 版本發佈 |
||||||
|
|
||||||
|
commits.commits = 次代碼提交 |
||||||
|
commits.search = 搜索提交歷史 |
||||||
|
commits.find = 查找 |
||||||
|
commits.author = 作者 |
||||||
|
commits.message = 備註 |
||||||
|
commits.date = 提交日期 |
||||||
|
commits.older = 更舊的提交 |
||||||
|
commits.newer = 更新的提交 |
||||||
|
|
||||||
|
settings = 倉庫設置 |
||||||
|
settings.options = 基本設置 |
||||||
|
settings.collaboration = 管理協作者 |
||||||
|
settings.hooks = 管理 Web 鉤子 |
||||||
|
settings.githooks = 管理 Git 鉤子 |
||||||
|
settings.deploy_keys = 管理部署密鑰 |
||||||
|
settings.basic_settings = 基本設置 |
||||||
|
settings.danger_zone = 危險操作區 |
||||||
|
settings.site = 官方網站 |
||||||
|
settings.update_settings = 更新倉庫設置 |
||||||
|
settings.change_reponame = 倉庫名稱將被修改 |
||||||
|
settings.change_reponame_desc = 倉庫名稱被修改,您確定要繼續操作嗎?這將會影響到所有與該倉庫有關的鏈接。 |
||||||
|
settings.transfer = 轉移倉庫所有權 |
||||||
|
settings.transfer_desc = 您可以將倉庫轉移至您擁有管理員權限的帳戶或組織。 |
||||||
|
settings.new_owner_has_same_repo = 新的倉庫擁有者已經存在同名倉庫! |
||||||
|
settings.delete = 刪除本倉庫 |
||||||
|
settings.delete_desc = 刪除倉庫操作不可逆轉,請三思而後行。 |
||||||
|
settings.transfer_notices = <p>- 如果您轉移給個人用戶,您將對倉庫失去所有權限。</p><p>- 如果您轉移給您作為擁有者的組織,則可繼續保持操作權限。</p> |
||||||
|
settings.update_settings_success = 倉庫設置更新成功! |
||||||
|
settings.transfer_owner = 新擁有者 |
||||||
|
settings.make_transfer = 確認轉移倉庫 |
||||||
|
settings.transfer_succeed = 倉庫所有權轉移成功! |
||||||
|
settings.confirm_delete = 確認刪除倉庫 |
||||||
|
settings.add_collaborator = 增加新的協作者 |
||||||
|
settings.add_collaborator_success = 成功添加新的協作者! |
||||||
|
settings.remove_collaborator_success = 被操作的協作者已經被收回權限! |
||||||
|
settings.add_webhook = 添加 Web 鉤子 |
||||||
|
settings.hooks_desc = Web 鉤子允許您設定在 Gogs 上發生指定事件時對指定 URL 發送 POST 通知。查看 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文檔</a> 獲取更多信息。 |
||||||
|
settings.remove_hook_success = Web 鉤子刪除成功! |
||||||
|
settings.add_webhook_desc = 我們會通過 <code>POST</code> 請求將訂閱事件信息發送至向指定 URL 地址。您可以設置不同的數據接收方式(JSON 或 <code>x-www-form-urlencoded</code>)。 請查閱 <a target="_blank" href="http://gogs.io/docs/features/webhook.html">Webhooks 文檔</a> 獲取更多信息。 |
||||||
|
settings.githooks_desc = Git 鉤子是由 Git 本身提供的功能,以下為 Gogs 所支持的鉤子列表。 |
||||||
|
settings.githook_edit_desc = 如果鉤子未啟動,則會顯示樣例文件中的內容。如果想要刪除某個鉤子,則提交空白文本即可。 |
||||||
|
settings.githook_name = 鉤子名稱 |
||||||
|
settings.githook_content = 鉤子文本 |
||||||
|
settings.update_githook = 更新鉤子設置 |
||||||
|
settings.payload_url = 推送地址 |
||||||
|
settings.content_type = 數據格式 |
||||||
|
settings.secret = 密鑰文本 |
||||||
|
settings.event_desc = 請設置您希望觸發 Web 鉤子的事件: |
||||||
|
settings.event_push_only = 只推送 <code>push</code> 事件。 |
||||||
|
settings.active = 是否激活 |
||||||
|
settings.active_helper = 當指定事件發生時我們將會觸發此 Web 鉤子。 |
||||||
|
settings.add_hook_success = Web 鉤子添加成功! |
||||||
|
settings.update_webhook = 更新 Web 鉤子 |
||||||
|
settings.update_hook_success = Web 鉤子更新成功! |
||||||
|
settings.delete_webhook = 刪除 Web 鉤子 |
||||||
|
settings.recent_deliveries = 最近推送記錄 |
||||||
|
settings.hook_type = 鉤子類型 |
||||||
|
settings.add_slack_hook_desc = 為您的倉庫增加 <a href="http://slack.com">Slack</a> 集成 |
||||||
|
settings.slack_token = 令牌 |
||||||
|
settings.slack_domain = 域名 |
||||||
|
settings.slack_channel = 頻道 |
||||||
|
|
||||||
|
[org] |
||||||
|
org_name_holder = 組織名稱 |
||||||
|
org_name_helper = 偉大的組織都有一個簡短而寓意深刻的名字。 |
||||||
|
org_email_helper = 組織的郵箱用於接收所有通知和確認郵件。 |
||||||
|
create_org = 創建組織 |
||||||
|
repo_updated = 最後更新於 |
||||||
|
people = 組織成員 |
||||||
|
invite_someone = 邀請他人加入 |
||||||
|
teams = 組織團隊 |
||||||
|
lower_members = 名成員 |
||||||
|
lower_repositories = 個倉庫 |
||||||
|
create_new_team = 創建新的團隊 |
||||||
|
org_desc = 組織描述 |
||||||
|
team_name = 團隊名稱 |
||||||
|
team_desc = 團隊描述 |
||||||
|
team_name_helper = 您可以使用該名稱來通知改組全體成員。 |
||||||
|
team_desc_helper = 一句話描述這個團隊是做什麼的。 |
||||||
|
team_permission_desc = 請選擇該團隊所具有的權限等級: |
||||||
|
|
||||||
|
settings = 組織設置 |
||||||
|
settings.options = 基本設置 |
||||||
|
settings.full_name = 組織全名 |
||||||
|
settings.website = 官方網站 |
||||||
|
settings.location = 所在地區 |
||||||
|
settings.update_settings = 更新組織設置 |
||||||
|
settings.change_orgname = 組織名稱將被修改 |
||||||
|
settings.change_orgname_desc = 組織名稱被修改,您確定要繼續操作嗎?這將會影響到所有與該組織有關的鏈接。 |
||||||
|
settings.update_setting_success = 組織設置更新成功! |
||||||
|
settings.delete = 刪除組織 |
||||||
|
settings.delete_account = 刪除當前組織 |
||||||
|
settings.delete_prompt = 刪除操作會永久清除該組織的信息,並且 <strong>不可恢復</strong>! |
||||||
|
settings.confirm_delete_account = 確認刪除組織 |
||||||
|
settings.delete_org_title = 組織刪除操作 |
||||||
|
settings.delete_org_desc = 該組織將被永久性刪除,您確定要繼續操作嗎? |
||||||
|
settings.hooks_desc = 在此處添加的 Web 鉤子將會應用到該組織下的 <strong>所有倉庫</strong>。 |
||||||
|
|
||||||
|
members.public = 公開成員 |
||||||
|
members.public_helper = 設為私有 |
||||||
|
members.private = 私有成員 |
||||||
|
members.private_helper = 設為公開 |
||||||
|
members.owner = 管理員 |
||||||
|
members.member = 普通成員 |
||||||
|
members.conceal = 隱藏身份 |
||||||
|
members.remove = 移除成員 |
||||||
|
members.leave = 離開組織 |
||||||
|
members.invite_desc = 請輸入被邀請到組織 %s 的用戶名稱: |
||||||
|
members.invite_now = 立即邀請 |
||||||
|
|
||||||
|
teams.join = 加入團隊 |
||||||
|
teams.leave = 離開團隊 |
||||||
|
teams.read_access = 讀取權限 |
||||||
|
teams.read_access_helper = 這個團隊將擁有查看和克隆所屬倉庫的權限。 |
||||||
|
teams.write_access = 寫入權限 |
||||||
|
teams.write_access_helper = 這個團隊將擁有查看、克隆和推送所屬倉庫的權限。 |
||||||
|
teams.admin_access = 管理權限 |
||||||
|
teams.admin_access_helper = 這個團隊將擁有查看、克隆、推送和添加其他組織成員到團隊的權限。 |
||||||
|
teams.no_desc = 該團隊暫無描述 |
||||||
|
teams.settings = 團隊設置 |
||||||
|
teams.owners_permission_desc = 管理員團隊對 <strong>所有倉庫</strong> 具有操作權限,且對組織具有 <strong>管理員權限</strong>。 |
||||||
|
teams.members = 團隊成員 |
||||||
|
teams.update_settings = 更新團隊設置 |
||||||
|
teams.delete_team = 刪除當前團隊 |
||||||
|
teams.add_team_member = 添加團隊成員 |
||||||
|
teams.delete_team_title = 團隊刪除操作 |
||||||
|
teams.delete_team_desc = 刪除操作會永久清除有關該團隊的信息,您確定要繼續操作嗎?團隊成員可能會失去對某些倉庫的操作權限。 |
||||||
|
teams.delete_team_success = 指定團隊刪除成功! |
||||||
|
teams.read_permission_desc = 該團隊擁有對所屬倉庫的 <strong>讀取</strong> 權限,團隊成員可以進行查看和克隆等只讀操作。 |
||||||
|
teams.write_permission_desc = 該團隊擁有對所屬倉庫的 <strong>讀取</strong> 和 <strong>寫入</strong> 的權限。 |
||||||
|
teams.admin_permission_desc = 該團隊擁有一定的 <strong>管理</strong> 權限,團隊成員可以讀取、克隆、推送以及添加其它倉庫協作者。 |
||||||
|
teams.repositories = 團隊倉庫 |
||||||
|
teams.add_team_repository = 添加團隊倉庫 |
||||||
|
teams.remove_repo = 移除倉庫 |
||||||
|
|
||||||
|
[admin] |
||||||
|
dashboard = 控制面版 |
||||||
|
users = 用戶管理 |
||||||
|
organizations = 組織管理 |
||||||
|
repositories = 倉庫管理 |
||||||
|
authentication = 授權認證管理 |
||||||
|
config = 應用配置管理 |
||||||
|
notices = 系統提示管理 |
||||||
|
monitor = 應用監控面版 |
||||||
|
prev = 上一頁 |
||||||
|
next = 下一頁 |
||||||
|
|
||||||
|
dashboard.statistic = 應用統計數據 |
||||||
|
dashboard.operations = 管理員操作 |
||||||
|
dashboard.system_status = 系統監視狀態 |
||||||
|
dashboard.statistic_info = Gogs 數據庫統計:<b>%d</b> 位用戶,<b>%d</b> 個組織,<b>%d</b> 個公鑰,<b>%d</b> 個倉庫,<b>%d</b> 個倉庫關註,<b>%d</b> 個贊,<b>%d</b> 次行為,<b>%d</b> 條權限記錄,<b>%d</b> 個問題,<b>%d</b> 次評論,<b>%d</b> 個社交帳號,<b>%d</b> 個用戶關註,<b>%d</b> 個鏡像,<b>%d</b> 個版本發佈,<b>%d</b> 個登錄源,<b>%d</b> 個 Web 鉤子,<b>%d</b> 個里程碑,<b>%d</b> 個標籤,<b>%d</b> 個鉤子任務,<b>%d</b> 個團隊,<b>%d</b> 個更新任務,<b>%d</b> 個附件。 |
||||||
|
dashboard.operation_name = 操作名稱 |
||||||
|
dashboard.operation_switch = 開關 |
||||||
|
dashboard.operation_run = 執行 |
||||||
|
dashboard.clean_unbind_oauth = 清理未綁定社交帳號 |
||||||
|
dashboard.delete_inactivate_accounts = 刪除所有未激活帳戶 |
||||||
|
dashboard.server_uptime = 服務執行時間 |
||||||
|
dashboard.current_goroutine = 當前 Goroutines 數量 |
||||||
|
dashboard.current_memory_usage = 當前內存使用量 |
||||||
|
dashboard.total_memory_allocated = 所有被分配的內存 |
||||||
|
dashboard.memory_obtained = 內存佔用量 |
||||||
|
dashboard.pointer_lookup_times = 指針查找次數 |
||||||
|
dashboard.memory_allocate_times = 內存分配次數 |
||||||
|
dashboard.memory_free_times = 內存釋放次數 |
||||||
|
dashboard.current_heap_usage = 當前 Heap 內存使用量 |
||||||
|
dashboard.heap_memory_obtained = Heap 內存佔用量 |
||||||
|
dashboard.heap_memory_idle = Heap 內存空閒量 |
||||||
|
dashboard.heap_memory_in_use = 正在使用的 Heap 內存 |
||||||
|
dashboard.heap_memory_released = 被釋放的 Heap 內存 |
||||||
|
dashboard.heap_objects = Heap 對象數量 |
||||||
|
dashboard.bootstrap_stack_usage = 啟動 Stack 使用量 |
||||||
|
dashboard.stack_memory_obtained = 被分配的 Stack 內存 |
||||||
|
dashboard.mspan_structures_usage = MSpan 結構內存使用量 |
||||||
|
dashboard.mspan_structures_obtained = 被分配的 MSpan 結構內存 |
||||||
|
dashboard.mcache_structures_usage = MCache 結構內存使用量 |
||||||
|
dashboard.mcache_structures_obtained = 被分配的 MCache 結構內存 |
||||||
|
dashboard.profiling_bucket_hash_table_obtained = 被分配的剖析哈希表內存 |
||||||
|
dashboard.gc_metadata_obtained = 被分配的垃圾收集元數據內存 |
||||||
|
dashboard.other_system_allocation_obtained = 其它被分配的系統內存 |
||||||
|
dashboard.next_gc_recycle = 下次垃圾收集內存回收量 |
||||||
|
dashboard.last_gc_time = 距離上次垃圾收集時間 |
||||||
|
dashboard.total_gc_time = 垃圾收集執行時間總量 |
||||||
|
dashboard.total_gc_pause = 垃圾收集暫停時間總量 |
||||||
|
dashboard.last_gc_pause = 上次垃圾收集暫停時間 |
||||||
|
dashboard.gc_times = 垃圾收集執行次數 |
||||||
|
|
||||||
|
users.user_manage_panel = 用戶管理面版 |
||||||
|
users.new_account = 創建新的帳戶 |
||||||
|
users.name = 用戶名 |
||||||
|
users.activated = 已激活 |
||||||
|
users.admin = 管理員 |
||||||
|
users.repos = 倉庫數 |
||||||
|
users.created = 創建時間 |
||||||
|
users.edit = 編輯 |
||||||
|
users.auth_source = 認證源 |
||||||
|
users.local = 本地 |
||||||
|
users.auth_login_name = 認證登錄名 |
||||||
|
users.update_profile_success = 該用戶信息更新成功! |
||||||
|
users.edit_account = 編輯用戶信息 |
||||||
|
users.is_activated = 該用戶已被激活 |
||||||
|
users.is_admin = 該用戶具有管理員權限 |
||||||
|
users.update_profile = 更新用戶信息 |
||||||
|
users.delete_account = 刪除該用戶 |
||||||
|
users.still_own_repo = 該帳戶仍然是某些倉庫的擁有者,您必須先轉移或刪除它們才能執行刪除帳戶操作! |
||||||
|
|
||||||
|
orgs.org_manage_panel = 組織管理面版 |
||||||
|
orgs.name = 組織名稱 |
||||||
|
orgs.teams = 團隊數 |
||||||
|
orgs.members = 成員數 |
||||||
|
|
||||||
|
repos.repo_manage_panel = 倉庫管理界面 |
||||||
|
repos.owner = 所有者 |
||||||
|
repos.name = 倉庫名稱 |
||||||
|
repos.private = 私有庫 |
||||||
|
repos.watches = 關註數 |
||||||
|
repos.stars = 點讚數 |
||||||
|
repos.issues = 問題數 |
||||||
|
|
||||||
|
auths.auth_manage_panel = 授權認證管理面版 |
||||||
|
auths.new = 添加新的認證源 |
||||||
|
auths.name = 認證名稱 |
||||||
|
auths.type = 認證類型 |
||||||
|
auths.enabled = 已啟用 |
||||||
|
auths.updated = 最後更新時間 |
||||||
|
auths.auth_type = 授權類型 |
||||||
|
auths.auth_name = 授權名稱 |
||||||
|
auths.domain = 域名 |
||||||
|
auths.host = 主機地址 |
||||||
|
auths.port = 主機端口 |
||||||
|
auths.base_dn = Base DN |
||||||
|
auths.attributes = 搜尋屬性 |
||||||
|
auths.filter = 搜尋過濾 |
||||||
|
auths.ms_ad_sa = Ms Ad SA |
||||||
|
auths.smtp_auth = SMTP 授權類型 |
||||||
|
auths.smtphost = SMTP 主機地址 |
||||||
|
auths.smtpport = SMTP 主機端口 |
||||||
|
auths.enable_tls = 啟用 TLS 加密 |
||||||
|
auths.enable_auto_register = 允許授權用戶自動註冊 |
||||||
|
auths.tips = 幫助提示 |
||||||
|
auths.edit = 修改授權認證設置 |
||||||
|
auths.activated = 該授權認證已經啟用 |
||||||
|
auths.update_success = 授權認證設置更新成功! |
||||||
|
auths.update = 更新授權認證信息 |
||||||
|
auths.delete = 刪除該授權認證 |
||||||
|
auths.delete_auth_title = 授權認證刪除操作 |
||||||
|
auths.delete_auth_desc = 該授權認證將被刪除,您確定要繼續嗎? |
||||||
|
|
||||||
|
config.server_config = 服務器配置 |
||||||
|
config.app_name = 應用名稱 |
||||||
|
config.app_ver = 應用版本 |
||||||
|
config.app_url = 應用 URL |
||||||
|
config.domain = 應用域名 |
||||||
|
config.offline_mode = 離線模式 |
||||||
|
config.disable_router_log = 關閉路由日志 |
||||||
|
config.run_user = 執行用戶 |
||||||
|
config.run_mode = 執行模式 |
||||||
|
config.repo_root_path = 倉庫根目錄 |
||||||
|
config.static_file_root_path = 靜態文件根目錄 |
||||||
|
config.log_file_root_path = 日志文件根目錄 |
||||||
|
config.script_type = 腳本類型 |
||||||
|
config.reverse_auth_user = 反向代理認證 |
||||||
|
config.db_config = 數據庫配置 |
||||||
|
config.db_type = 數據庫類型 |
||||||
|
config.db_host = 主機地址 |
||||||
|
config.db_name = 數據庫名稱 |
||||||
|
config.db_user = 連接用戶 |
||||||
|
config.db_ssl_mode = SSL 模式 |
||||||
|
config.db_ssl_mode_helper = (僅限 "postgres" 使用) |
||||||
|
config.db_path = 數據庫路徑 |
||||||
|
config.db_path_helper = (僅限 "sqlite3" 使用) |
||||||
|
config.service_config = 服務配置 |
||||||
|
config.register_email_confirm = 註冊郵件確認 |
||||||
|
config.disable_register = 關閉註冊功能 |
||||||
|
config.require_sign_in_view = 強制登錄瀏覽 |
||||||
|
config.mail_notify = 郵件通知提醒 |
||||||
|
config.enable_cache_avatar = 開啟緩存頭像 |
||||||
|
config.active_code_lives = 激活用戶鏈接有效期 |
||||||
|
config.reset_password_code_lives = 重置密碼鏈接有效期 |
||||||
|
config.webhook_config = Web 鉤子配置 |
||||||
|
config.task_interval = 任務周期 |
||||||
|
config.deliver_timeout = 推送超時 |
||||||
|
config.mailer_config = 郵件配置 |
||||||
|
config.mailer_enabled = 啟用服務 |
||||||
|
config.mailer_name = 發送者名稱 |
||||||
|
config.mailer_host = 郵件主機地址 |
||||||
|
config.mailer_user = 發送者帳號 |
||||||
|
config.oauth_config = 社交帳號配置 |
||||||
|
config.oauth_enabled = 啟用服務 |
||||||
|
config.cache_config = Cache 配置 |
||||||
|
config.cache_adapter = Cache 適配器 |
||||||
|
config.cache_interval = Cache 周期 |
||||||
|
config.cache_conn = Cache 連接字符串 |
||||||
|
config.session_config = Session 配置 |
||||||
|
config.session_provider = Session 提供者 |
||||||
|
config.provider_config = 提供者配置 |
||||||
|
config.cookie_name = Cookie 名稱 |
||||||
|
config.enable_set_cookie = 啟用設置 Cookie |
||||||
|
config.gc_interval_time = 垃圾收集周期 |
||||||
|
config.session_life_time = Session 生命周期 |
||||||
|
config.https_only = 僅限 HTTPS |
||||||
|
config.cookie_life_time = Cookie 生命周期 |
||||||
|
config.session_hash_function = Session ID 哈希函數 |
||||||
|
config.session_hash_key = Session ID 哈希健值 |
||||||
|
config.picture_config = 圖片配置 |
||||||
|
config.picture_service = 圖片服務 |
||||||
|
config.disable_gravatar = 禁用 Gravatar 頭像 |
||||||
|
config.log_config = 日誌配置 |
||||||
|
config.log_mode = 日誌模式 |
||||||
|
|
||||||
|
monitor.cron = Cron 任務 |
||||||
|
monitor.name = 任務名稱 |
||||||
|
monitor.schedule = 任務安排 |
||||||
|
monitor.next = 下次執行時間 |
||||||
|
monitor.previous = 上次執行時間 |
||||||
|
monitor.execute_times = 執行次數 |
||||||
|
monitor.process = 執行中進程 |
||||||
|
monitor.desc = 進程描述 |
||||||
|
monitor.start = 開始時間 |
||||||
|
monitor.execute_time = 已執行時間 |
||||||
|
|
||||||
|
notices.system_notice_list = 系統提示管理 |
||||||
|
notices.type = 提示類型 |
||||||
|
notices.type_1 = 倉庫 |
||||||
|
notices.desc = 描述 |
||||||
|
notices.op = 操作 |
||||||
|
notices.delete_success = 系統提示刪除成功! |
||||||
|
|
||||||
|
[action] |
||||||
|
create_repo = 創建了倉庫 <a href="%s/%s">%s</a> |
||||||
|
commit_repo = 推送了 <a href="%s/%s/src/%s">%s</a> 分支的代碼到 <a href="%s/%s">%s</a> |
||||||
|
create_issue = 創建了問題 <a href="%s/%s/issues/%s">%s#%s</a> |
||||||
|
comment_issue = 評論了問題 <a href="%s/%s/issues/%s">%s#%s</a> |
||||||
|
transfer_repo = 將倉庫 <code>%s</code> 轉移至 <a href="/%s%s">%s</a> |
||||||
|
|
||||||
|
[tool] |
||||||
|
ago = 之前 |
||||||
|
from_now = 之後 |
||||||
|
now = 現在 |
||||||
|
1s = 1 秒%s |
||||||
|
1m = 1 分鐘%s |
||||||
|
1h = 1 小時%s |
||||||
|
1d = 1 天%s |
||||||
|
1w = 1 周%s |
||||||
|
1mon = 1 月%s |
||||||
|
1y = 1 年%s |
||||||
|
seconds = %d 秒%s |
||||||
|
minutes = %d 分鐘%s |
||||||
|
hours = %d 小時%s |
||||||
|
days = %d 天%s |
||||||
|
weeks = %d 周%s |
||||||
|
months = %d 月%s |
||||||
|
years = %d 年%s |
||||||
|
raw_seconds = 秒 |
||||||
|
raw_minutes = 分鐘 |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,64 @@ |
|||||||
|
// Copyright 2014 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 models |
||||||
|
|
||||||
|
import ( |
||||||
|
"time" |
||||||
|
|
||||||
|
"github.com/Unknwon/com" |
||||||
|
) |
||||||
|
|
||||||
|
type NoticeType int |
||||||
|
|
||||||
|
const ( |
||||||
|
NOTICE_REPOSITORY NoticeType = iota + 1 |
||||||
|
) |
||||||
|
|
||||||
|
// Notice represents a system notice for admin.
|
||||||
|
type Notice struct { |
||||||
|
Id int64 |
||||||
|
Type NoticeType |
||||||
|
Description string `xorm:"TEXT"` |
||||||
|
Created time.Time `xorm:"CREATED"` |
||||||
|
} |
||||||
|
|
||||||
|
// TrStr returns a translation format string.
|
||||||
|
func (n *Notice) TrStr() string { |
||||||
|
return "admin.notices.type_" + com.ToStr(n.Type) |
||||||
|
} |
||||||
|
|
||||||
|
// CreateNotice creates new system notice.
|
||||||
|
func CreateNotice(tp NoticeType, desc string) error { |
||||||
|
n := &Notice{ |
||||||
|
Type: tp, |
||||||
|
Description: desc, |
||||||
|
} |
||||||
|
_, err := x.Insert(n) |
||||||
|
return err |
||||||
|
} |
||||||
|
|
||||||
|
// CreateRepositoryNotice creates new system notice with type NOTICE_REPOSITORY.
|
||||||
|
func CreateRepositoryNotice(desc string) error { |
||||||
|
return CreateNotice(NOTICE_REPOSITORY, desc) |
||||||
|
} |
||||||
|
|
||||||
|
// CountNotices returns number of notices.
|
||||||
|
func CountNotices() int64 { |
||||||
|
count, _ := x.Count(new(Notice)) |
||||||
|
return count |
||||||
|
} |
||||||
|
|
||||||
|
// GetNotices returns given number of notices with offset.
|
||||||
|
func GetNotices(num, offset int) ([]*Notice, error) { |
||||||
|
notices := make([]*Notice, 0, num) |
||||||
|
err := x.Limit(num, offset).Desc("id").Find(¬ices) |
||||||
|
return notices, err |
||||||
|
} |
||||||
|
|
||||||
|
// DeleteNotice deletes a system notice by given ID.
|
||||||
|
func DeleteNotice(id int64) error { |
||||||
|
_, err := x.Id(id).Delete(new(Notice)) |
||||||
|
return err |
||||||
|
} |
@ -0,0 +1,111 @@ |
|||||||
|
// Copyright 2014 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 git |
||||||
|
|
||||||
|
import ( |
||||||
|
"errors" |
||||||
|
"io/ioutil" |
||||||
|
"os" |
||||||
|
"path" |
||||||
|
"strings" |
||||||
|
) |
||||||
|
|
||||||
|
// hookNames is a list of Git hooks' name that are supported.
|
||||||
|
var hookNames = []string{ |
||||||
|
"pre-applypatch", |
||||||
|
"applypatch-msg", |
||||||
|
"prepare-commit-msg", |
||||||
|
"commit-msg", |
||||||
|
"pre-commit", |
||||||
|
"pre-rebase", |
||||||
|
"post-commit", |
||||||
|
"post-receive", |
||||||
|
"post-update", |
||||||
|
} |
||||||
|
|
||||||
|
var ( |
||||||
|
ErrNotValidHook = errors.New("not a valid Git hook") |
||||||
|
) |
||||||
|
|
||||||
|
// IsValidHookName returns true if given name is a valid Git hook.
|
||||||
|
func IsValidHookName(name string) bool { |
||||||
|
for _, hn := range hookNames { |
||||||
|
if hn == name { |
||||||
|
return true |
||||||
|
} |
||||||
|
} |
||||||
|
return false |
||||||
|
} |
||||||
|
|
||||||
|
// Hook represents a Git hook.
|
||||||
|
type Hook struct { |
||||||
|
name string |
||||||
|
IsActive bool // Indicates whether repository has this hook.
|
||||||
|
Content string // Content of hook if it's active.
|
||||||
|
Sample string // Sample content from Git.
|
||||||
|
path string // Hook file path.
|
||||||
|
} |
||||||
|
|
||||||
|
// GetHook returns a Git hook by given name and repository.
|
||||||
|
func GetHook(repoPath, name string) (*Hook, error) { |
||||||
|
if !IsValidHookName(name) { |
||||||
|
return nil, ErrNotValidHook |
||||||
|
} |
||||||
|
h := &Hook{ |
||||||
|
name: name, |
||||||
|
path: path.Join(repoPath, "hooks", name), |
||||||
|
} |
||||||
|
if isFile(h.path) { |
||||||
|
data, err := ioutil.ReadFile(h.path) |
||||||
|
if err != nil { |
||||||
|
return nil, err |
||||||
|
} |
||||||
|
h.IsActive = true |
||||||
|
h.Content = string(data) |
||||||
|
} else if isFile(h.path + ".sample") { |
||||||
|
data, err := ioutil.ReadFile(h.path + ".sample") |
||||||
|
if err != nil { |
||||||
|
return nil, err |
||||||
|
} |
||||||
|
h.Sample = string(data) |
||||||
|
} |
||||||
|
return h, nil |
||||||
|
} |
||||||
|
|
||||||
|
func (h *Hook) Name() string { |
||||||
|
return h.name |
||||||
|
} |
||||||
|
|
||||||
|
// Update updates hook settings.
|
||||||
|
func (h *Hook) Update() error { |
||||||
|
if len(strings.TrimSpace(h.Content)) == 0 { |
||||||
|
return os.Remove(h.path) |
||||||
|
} |
||||||
|
return ioutil.WriteFile(h.path, []byte(strings.Replace(h.Content, "\r", "", -1)), os.ModePerm) |
||||||
|
} |
||||||
|
|
||||||
|
// ListHooks returns a list of Git hooks of given repository.
|
||||||
|
func ListHooks(repoPath string) (_ []*Hook, err error) { |
||||||
|
if !isDir(path.Join(repoPath, "hooks")) { |
||||||
|
return nil, errors.New("hooks path does not exist") |
||||||
|
} |
||||||
|
|
||||||
|
hooks := make([]*Hook, len(hookNames)) |
||||||
|
for i, name := range hookNames { |
||||||
|
hooks[i], err = GetHook(repoPath, name) |
||||||
|
if err != nil { |
||||||
|
return nil, err |
||||||
|
} |
||||||
|
} |
||||||
|
return hooks, nil |
||||||
|
} |
||||||
|
|
||||||
|
func (repo *Repository) GetHook(name string) (*Hook, error) { |
||||||
|
return GetHook(repo.Path, name) |
||||||
|
} |
||||||
|
|
||||||
|
func (repo *Repository) Hooks() ([]*Hook, error) { |
||||||
|
return ListHooks(repo.Path) |
||||||
|
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,46 @@ |
|||||||
|
// Copyright 2014 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 admin |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/Unknwon/com" |
||||||
|
|
||||||
|
"github.com/gogits/gogs/models" |
||||||
|
"github.com/gogits/gogs/modules/base" |
||||||
|
"github.com/gogits/gogs/modules/log" |
||||||
|
"github.com/gogits/gogs/modules/middleware" |
||||||
|
) |
||||||
|
|
||||||
|
const ( |
||||||
|
NOTICES base.TplName = "admin/notice" |
||||||
|
) |
||||||
|
|
||||||
|
func Notices(ctx *middleware.Context) { |
||||||
|
ctx.Data["Title"] = ctx.Tr("admin.notices") |
||||||
|
ctx.Data["PageIsAdmin"] = true |
||||||
|
ctx.Data["PageIsAdminNotices"] = true |
||||||
|
|
||||||
|
pageNum := 50 |
||||||
|
p := pagination(ctx, models.CountNotices(), pageNum) |
||||||
|
|
||||||
|
notices, err := models.GetNotices(pageNum, (p-1)*pageNum) |
||||||
|
if err != nil { |
||||||
|
ctx.Handle(500, "GetNotices", err) |
||||||
|
return |
||||||
|
} |
||||||
|
ctx.Data["Notices"] = notices |
||||||
|
ctx.HTML(200, NOTICES) |
||||||
|
} |
||||||
|
|
||||||
|
func DeleteNotice(ctx *middleware.Context) { |
||||||
|
id := com.StrTo(ctx.Params(":id")).MustInt64() |
||||||
|
if err := models.DeleteNotice(id); err != nil { |
||||||
|
ctx.Handle(500, "DeleteNotice", err) |
||||||
|
return |
||||||
|
} |
||||||
|
log.Trace("System notice deleted by admin(%s): %d", ctx.User.Name, id) |
||||||
|
ctx.Flash.Success(ctx.Tr("admin.notices.delete_success")) |
||||||
|
ctx.Redirect("/admin/notices") |
||||||
|
} |
@ -0,0 +1,2 @@ |
|||||||
|
#!/bin/sh |
||||||
|
su git -c "/home/git/gogs/scripts/gogs_supervisord.sh restart" |
@ -1 +1 @@ |
|||||||
0.5.4.1003 Beta |
0.5.5.1013 Beta |
@ -0,0 +1,54 @@ |
|||||||
|
{{template "ng/base/head" .}} |
||||||
|
{{template "ng/base/header" .}} |
||||||
|
<div id="admin-wrapper"> |
||||||
|
<div id="setting-wrapper" class="main-wrapper"> |
||||||
|
<div id="admin-setting" class="container clear"> |
||||||
|
{{template "admin/nav" .}} |
||||||
|
<div class="grid-4-5 left"> |
||||||
|
<div class="setting-content"> |
||||||
|
{{template "ng/base/alert" .}} |
||||||
|
<div id="setting-content"> |
||||||
|
<div class="panel panel-radius"> |
||||||
|
<div class="panel-header"> |
||||||
|
<strong>{{.i18n.Tr "admin.notices.system_notice_list"}}</strong> |
||||||
|
</div> |
||||||
|
<div class="panel-body admin-panel"> |
||||||
|
<div class="admin-table"> |
||||||
|
<table class="table table-striped"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>Id</th> |
||||||
|
<th>{{.i18n.Tr "admin.notices.type"}}</th> |
||||||
|
<th>{{.i18n.Tr "admin.notices.desc"}}</th> |
||||||
|
<th>{{.i18n.Tr "admin.users.created"}}</th> |
||||||
|
<th>{{.i18n.Tr "admin.notices.op"}}</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
{{range .Notices}} |
||||||
|
<tr> |
||||||
|
<td>{{.Id}}</td> |
||||||
|
<td>{{$.i18n.Tr .TrStr}}</td> |
||||||
|
<td class="grid-1-2"><span>{{.Description}}</span></td> |
||||||
|
<td>{{.Created}}</td> |
||||||
|
<td><a href="{{AppSubUrl}}/admin/notices/{{.Id}}/delete"><i class="fa fa-trash-o text-red"></i></a></td> |
||||||
|
</tr> |
||||||
|
{{end}} |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
{{if or .LastPageNum .NextPageNum}} |
||||||
|
<ul class="pagination"> |
||||||
|
{{if .LastPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{AppSubUrl}}/admin/users?p={{.LastPageNum}}">« {{.i18n.Tr "admin.prev"}}</a></li>{{end}} |
||||||
|
{{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="{{AppSubUrl}}/admin/users?p={{.NextPageNum}}">» {{.i18n.Tr "admin.next"}}</a></li>{{end}} |
||||||
|
</ul> |
||||||
|
{{end}} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{template "ng/base/footer" .}} |
@ -1,2 +1,3 @@ |
|||||||
{{if .Flash.ErrorMsg}}<span class="alert alert-red alert-radius block text-bold"><i class="octicon octicon-alert"></i>{{.Flash.ErrorMsg}}</span>{{end}} |
{{if .Flash.ErrorMsg}}<span class="alert alert-red alert-radius block text-bold"><i class="octicon octicon-alert"></i>{{.Flash.ErrorMsg}}</span>{{end}} |
||||||
{{if .Flash.SuccessMsg}}<div class="alert alert-green alert-radius block"><i class="octicon octicon-check"></i>{{.Flash.SuccessMsg}}</div>{{end}} |
{{if .Flash.SuccessMsg}}<div class="alert alert-green alert-radius block"><i class="octicon octicon-check"></i>{{.Flash.SuccessMsg}}</div>{{end}} |
||||||
|
{{if .Flash.InfoMsg}}<div class="alert alert-blue alert-radius block"><i class="octicon octicon-info"></i>{{.Flash.InfoMsg}}</div>{{end}} |
@ -0,0 +1,41 @@ |
|||||||
|
{{template "ng/base/head" .}} |
||||||
|
{{template "ng/base/header" .}} |
||||||
|
<div id="repo-wrapper"> |
||||||
|
{{template "repo/header" .}} |
||||||
|
<div id="setting-wrapper" class="main-wrapper"> |
||||||
|
<div id="repo-setting" class="container clear"> |
||||||
|
{{template "repo/settings/nav" .}} |
||||||
|
<div class="grid-4-5 left"> |
||||||
|
<div class="setting-content"> |
||||||
|
{{template "ng/base/alert" .}} |
||||||
|
<div id="setting-content"> |
||||||
|
<div id="repo-hooks-panel" class="panel panel-radius"> |
||||||
|
<div class="panel-header"> |
||||||
|
<strong>{{.i18n.Tr "repo.settings.githooks"}}</strong> |
||||||
|
</div> |
||||||
|
<form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings/hooks/git/{{.Hook.Name}}" method="post"> |
||||||
|
{{.CsrfTokenHtml}} |
||||||
|
<div class="text-center panel-desc">{{.i18n.Tr "repo.settings.githook_edit_desc"}}</div> |
||||||
|
{{with .Hook}} |
||||||
|
<div class="field"> |
||||||
|
<label>{{$.i18n.Tr "repo.settings.githook_name"}}</label> |
||||||
|
<label class="text-left">{{.Name}}</label> |
||||||
|
</div> |
||||||
|
<div class="field clear"> |
||||||
|
<label class="left" for="content">{{$.i18n.Tr "repo.settings.githook_content"}}</label> |
||||||
|
<textarea class="ipt-textarea ipt-large ipt-radius" id="content" name="content" cols="60" rows="20" wrap="off">{{if .IsActive}}{{.Content}}{{else}}{{.Sample}}{{end}}</textarea> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<span class="form-label"></span> |
||||||
|
<button class="btn btn-green btn-large btn-radius" id="change-reponame-btn" href="#change-reponame-modal">{{$.i18n.Tr "repo.settings.update_githook"}}</button> |
||||||
|
</div> |
||||||
|
{{end}} |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{template "ng/base/footer" .}} |
@ -0,0 +1,37 @@ |
|||||||
|
{{template "ng/base/head" .}} |
||||||
|
{{template "ng/base/header" .}} |
||||||
|
<div id="repo-wrapper"> |
||||||
|
{{template "repo/header" .}} |
||||||
|
<div id="setting-wrapper" class="main-wrapper"> |
||||||
|
<div id="repo-setting" class="container clear"> |
||||||
|
{{template "repo/settings/nav" .}} |
||||||
|
<div class="grid-4-5 left"> |
||||||
|
<div class="setting-content"> |
||||||
|
{{template "ng/base/alert" .}} |
||||||
|
<div id="setting-content"> |
||||||
|
<div id="repo-hooks-panel" class="panel panel-radius"> |
||||||
|
<div class="panel-header"> |
||||||
|
<strong>{{.i18n.Tr "repo.settings.githooks"}}</strong> |
||||||
|
</div> |
||||||
|
<ul class="panel-body setting-list"> |
||||||
|
<li>{{.i18n.Tr "repo.settings.githooks_desc" | Str2html}}</li> |
||||||
|
{{range .Hooks}} |
||||||
|
<li> |
||||||
|
{{if .IsActive}} |
||||||
|
<span class="left text-success"><i class="octicon octicon-check"></i></span> |
||||||
|
{{else}} |
||||||
|
<span class="left text-grey"><i class="octicon octicon-primitive-dot"></i></span> |
||||||
|
{{end}} |
||||||
|
<span>{{.Name}}</span> |
||||||
|
<a href="{{$.RepoLink}}/settings/hooks/git/{{.Name}}" class="text-blue right"><i class="fa fa-pencil"></i></a> |
||||||
|
</li> |
||||||
|
{{end}} |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{{template "ng/base/footer" .}} |
@ -1,40 +0,0 @@ |
|||||||
{{template "base/head" .}} |
|
||||||
{{template "base/navbar" .}} |
|
||||||
{{template "repo/nav" .}} |
|
||||||
{{template "repo/toolbar" .}} |
|
||||||
<div id="body" class="container"> |
|
||||||
<div id="source"> |
|
||||||
<div class="source-toolbar"> |
|
||||||
{{ $n := len .Treenames}} |
|
||||||
{{if not .IsFile}}<button class="btn btn-default pull-right hidden"><i class="fa fa-plus-square"></i>Add File</button>{{end}} |
|
||||||
<div class="dropdown branch-switch"> |
|
||||||
<a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{if .IsBranch}}{{.BranchName}}{{else}}{{ShortSha .CommitId}}{{end}} |
|
||||||
<b class="caret"></b></a> |
|
||||||
<ul class="dropdown-menu"> |
|
||||||
{{range .Branches}} |
|
||||||
<li><a {{if eq . $.BranchName}}class="current" {{end}}href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/src/{{.}}">{{.}}</a></li> |
|
||||||
{{end}} |
|
||||||
</ul> |
|
||||||
</div> |
|
||||||
{{ $l := Subtract $n 1}} |
|
||||||
<ol class="breadcrumb"> |
|
||||||
<li class="root dir"> |
|
||||||
<a href="{{.BranchLink}}">{{.Repository.Name}}</a></li> |
|
||||||
{{range $i, $v := .Treenames}} |
|
||||||
<li class="dir"> |
|
||||||
{{if eq $i $l}}{{$v}} |
|
||||||
{{else}} |
|
||||||
<a href="{{$.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a> |
|
||||||
{{end}} |
|
||||||
</li> |
|
||||||
{{end}} |
|
||||||
</ol> |
|
||||||
</div> |
|
||||||
{{if .IsFile}} |
|
||||||
{{template "repo/single_file" .}} |
|
||||||
{{else}} |
|
||||||
{{template "repo/single_list" .}} |
|
||||||
{{end}} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
{{template "base/footer" .}} |
|
@ -1,40 +0,0 @@ |
|||||||
{{template "base/head" .}} |
|
||||||
{{template "base/navbar" .}} |
|
||||||
{{template "repo/nav" .}} |
|
||||||
{{template "repo/toolbar" .}} |
|
||||||
<div id="body" class="container"> |
|
||||||
<div id="source"> |
|
||||||
<div class="panel panel-default guide-box clone-group-btn"> |
|
||||||
<div class="panel-heading guide-head"> |
|
||||||
<h4>Quick Guide</h4> |
|
||||||
</div> |
|
||||||
<div class="panel-body guide-content text-center"> |
|
||||||
<h3>Clone this repository</h3> |
|
||||||
<div class="input-group col-md-8 col-md-offset-2 guide-buttons"> |
|
||||||
<span class="input-group-btn"> |
|
||||||
<button class="btn btn-default" data-link="{{.CloneLink.SSH}}" type="button">SSH</button> |
|
||||||
<button class="btn btn-default" data-link="{{.CloneLink.HTTPS}}" type="button">HTTPS</button> |
|
||||||
</span> |
|
||||||
<input type="text" class="form-control clone-group-url" id="guide-clone-url" value="" readonly/> |
|
||||||
<span class="input-group-btn" style="position: relative"> |
|
||||||
<button class="btn btn-default" type="button" data-toggle="tooltip" title="copy to clipboard" data-placement="top" data-init="copy" data-copy-val="val" data-copy-from="#guide-clone-url"><i class="fa fa-copy"></i></button> |
|
||||||
</span> |
|
||||||
</div> |
|
||||||
<p>We recommend every repository include a <strong>README</strong>, <strong>LICENSE</strong>, and <strong>.gitignore</strong>.</p> |
|
||||||
<hr/> |
|
||||||
<h3>Create a new repository on the command line</h3> |
|
||||||
<pre class="text-left"><code>touch README.md |
|
||||||
git init |
|
||||||
git add README.md |
|
||||||
git commit -m "first commit" |
|
||||||
git remote add origin <span class="clone-url"></span> |
|
||||||
git push -u origin master</code></pre> |
|
||||||
<hr/> |
|
||||||
<h3>Push an existing repository from the command line</h3> |
|
||||||
<pre class="text-left"><code>git remote add origin <span class="clone-url"></span> |
|
||||||
git push -u origin master</code></pre> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
{{template "base/footer" .}} |
|
@ -1,51 +0,0 @@ |
|||||||
<div class="panel panel-default file-content"> |
|
||||||
<div class="panel-heading file-head"> |
|
||||||
{{if .ReadmeExist}} |
|
||||||
<i class="icon fa fa-book"></i> |
|
||||||
{{if .ReadmeInSingle}} |
|
||||||
{{.FileName}} |
|
||||||
{{else}} |
|
||||||
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span> |
|
||||||
{{end}} |
|
||||||
{{else}} |
|
||||||
<i class="icon fa fa-file-text-o"></i> |
|
||||||
{{.FileName}} <span class="file-size">{{FileSize .FileSize}}</span> |
|
||||||
{{end}} |
|
||||||
{{if not .ReadmeInSingle}} |
|
||||||
<div class="btn-group pull-right"> |
|
||||||
<a class="btn btn-default hidden" href="#">Edit</a> |
|
||||||
<a class="btn btn-default" href="{{.FileLink}}" rel="nofollow">Raw</a> |
|
||||||
<a class="btn btn-default hidden" href="#">Blame</a> |
|
||||||
<a class="btn btn-default" href="{{.RepoLink}}/commits/{{.BranchName}}/{{.TreeName}}">History</a> |
|
||||||
<a class="btn btn-danger hidden" href="#">Delete</a> |
|
||||||
</div> |
|
||||||
{{end}} |
|
||||||
</div> |
|
||||||
|
|
||||||
{{if not .FileIsText}} |
|
||||||
<div class="panel-body file-body file-code code-view"> |
|
||||||
{{if .IsImageFile}} |
|
||||||
<img src="{{.FileLink}}"> |
|
||||||
{{else}} |
|
||||||
<a href="{{.FileLink}}" rel="nofollow" class="btn btn-default">View Raw</a> |
|
||||||
{{end}} |
|
||||||
</div> |
|
||||||
{{else}} |
|
||||||
{{if .ReadmeExist}} |
|
||||||
<div class="panel-body file-body markdown"> |
|
||||||
{{.FileContent|str2html}} |
|
||||||
</div> |
|
||||||
{{else}} |
|
||||||
<div class="panel-body file-body file-code code-view"> |
|
||||||
<table> |
|
||||||
<tbody> |
|
||||||
<tr> |
|
||||||
<td class="lines-num"></td> |
|
||||||
<td class="lines-code markdown"><pre class="prettyprint linenums{{if .FileExt}} lang-{{.FileExt}}{{end}}">{{.FileContent}}</pre></td> |
|
||||||
</tr> |
|
||||||
</tbody> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
{{end}} |
|
||||||
{{end}} |
|
||||||
</div> |
|
@ -1,51 +0,0 @@ |
|||||||
<div class="panel panel-default info-box"> |
|
||||||
<div class="panel-heading info-head"> |
|
||||||
<a href="{{AppSubUrl}}/{{.Username}}/{{.Reponame}}/commit/{{.LastCommit.Id}}" rel="nofollow">{{.LastCommit.Summary}}</a> |
|
||||||
</div> |
|
||||||
<div class="panel-body info-content"> |
|
||||||
<a href="{{AppSubUrl}}/user/{{.LastCommit.Author.Name}}">{{.LastCommit.Author.Name}}</a> <span class="text-muted">{{TimeSince .LastCommit.Author.When}}</span> |
|
||||||
</div> |
|
||||||
<table class="panel-footer table file-list"> |
|
||||||
<thead class="hidden"> |
|
||||||
<tr> |
|
||||||
<th class="icon"></th> |
|
||||||
<th class="name">Filename</th> |
|
||||||
<th class="text">Message</th> |
|
||||||
<th class="date">Date modified</th> |
|
||||||
</tr> |
|
||||||
</thead> |
|
||||||
<tbody> |
|
||||||
{{if .HasParentPath}} |
|
||||||
<tr class="has-parent"> |
|
||||||
<td class="icon"><a href="{{.BranchLink}}{{.ParentPath}}"><i class="fa fa-reply"></i></a></td> |
|
||||||
<td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td> |
|
||||||
<td class="text"></td> |
|
||||||
<td class="date"></td> |
|
||||||
</tr> |
|
||||||
{{end}} |
|
||||||
{{range $item := .Files}} |
|
||||||
{{$entry := index $item 0}} |
|
||||||
{{$commit := index $item 1}} |
|
||||||
<tr {{if $entry.IsDir}}class="is-dir"{{end}}> |
|
||||||
<td class="icon"> |
|
||||||
<i class="fa {{if $entry.IsDir}}fa-folder{{else}}fa-file-text-o{{end}}"></i> |
|
||||||
</td> |
|
||||||
<td class="name"> |
|
||||||
<span class="wrap"> |
|
||||||
<a href="{{$.BranchLink}}/{{$.TreePath}}{{$entry.Name}}">{{$entry.Name}}</a> |
|
||||||
</span> |
|
||||||
</td> |
|
||||||
<td class="text"> |
|
||||||
<span class="wrap"><a rel="nofollow" href="{{AppSubUrl}}/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Id}}">{{$commit.Summary}}</a></span> |
|
||||||
</td> |
|
||||||
<td class="date"> |
|
||||||
<span class="wrap">{{TimeSince $commit.Committer.When}}</span> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
{{end}} |
|
||||||
</tbody> |
|
||||||
</table> |
|
||||||
</div> |
|
||||||
{{if .ReadmeExist}} |
|
||||||
{{template "repo/single_file" .}} |
|
||||||
{{end}} |
|
Loading…
Reference in new issue