mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 06:33:50 +03:00
Finish new repo settings page
This commit is contained in:
parent
669552e255
commit
755eec745f
25 changed files with 502 additions and 347 deletions
|
@ -242,9 +242,8 @@ func runWeb(*cli.Context) {
|
|||
}, reqSignIn)
|
||||
|
||||
m.Group("/:username/:reponame", func(r *macaron.Router) {
|
||||
r.Get("/settings", repo.Setting)
|
||||
r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingPost)
|
||||
|
||||
r.Get("/settings", repo.Settings)
|
||||
r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
|
||||
m.Group("/settings", func(r *macaron.Router) {
|
||||
r.Get("/collaboration", repo.Collaboration)
|
||||
r.Post("/collaboration", repo.CollaborationPost)
|
||||
|
|
|
@ -56,6 +56,7 @@ sign_up_now = Need an account? Sign up now.
|
|||
|
||||
[form]
|
||||
UserName = Username
|
||||
RepoName = Repository name
|
||||
Email = E-mail address
|
||||
Password = Password
|
||||
Retype = Re-type password
|
||||
|
@ -82,6 +83,9 @@ illegal_username = Your username contains illegal characters.
|
|||
illegal_repo_name = Repository name contains illegal characters.
|
||||
illegal_org_name = Organization name contains illegal characters.
|
||||
username_password_incorrect = Username or password is not correct.
|
||||
enterred_invalid_repo_name = Please make sure you entered repository name is correct.
|
||||
enterred_invalid_owner_name = Please make sure you entered owner name is correct.
|
||||
enterred_invalid_password = Please make sure you entered passord is correct.
|
||||
|
||||
invalid_ssh_key = Sorry, we're not able to verify your SSH key: %s
|
||||
auth_failed = Authentication failed: %v
|
||||
|
@ -143,12 +147,34 @@ license = License
|
|||
license_helper = Select a license file
|
||||
init_readme = Initialize this repository with a README.md
|
||||
create_repo = Create Repository
|
||||
default_branch = Default Branch
|
||||
mirror_interval = Mirror Interval(hour)
|
||||
goget_meta = Go-Get Meta
|
||||
goget_meta_helper = This repository will be <span class="label label-blue label-radius">Go-Getable</span>
|
||||
|
||||
need_auth = Need Authorization
|
||||
migrate_type = Migration Type
|
||||
migrate_type_helper = This repository will be a <span class="label label-blue label-radius">Mirror</span>
|
||||
migrate_repo = Migrate Repository
|
||||
|
||||
settings = Settings
|
||||
settings.options = Options
|
||||
settings.collaboration = Collaboration
|
||||
settings.hooks = Webhooks
|
||||
settings.deploy_keys = Deploy Keys
|
||||
settings.basic_settings = Basic Settings
|
||||
settings.danger_zone = Danger Zone
|
||||
settings.site = Official Site
|
||||
settings.update_settings = Update Settings
|
||||
settings.transfer = Transfer Ownership
|
||||
settings.transfer_desc = Transfer this repo to another user or to an organization where you have admin rights.
|
||||
settings.delete = Delete This Repository
|
||||
settings.delete_desc = Once you delete a repository, there is no going back. Please be certain.
|
||||
settings.update_settings_success = Repository options has been successfully updated.
|
||||
settings.transfer_owner = New Owner
|
||||
settings.make_transfer = Make Transfer
|
||||
settings.confirm_delete = Confirm Deletion
|
||||
|
||||
[org]
|
||||
org_name_holder = Organization Name
|
||||
org_name_helper = Great organization names are short and memorable.
|
||||
|
|
|
@ -56,6 +56,7 @@ sign_up_now = 还没帐户?马上注册。
|
|||
|
||||
[form]
|
||||
UserName = 用户名
|
||||
RepoName = 仓库名称
|
||||
Email = 邮箱地址
|
||||
Password = 密码
|
||||
Retype = 确认密码
|
||||
|
@ -82,6 +83,9 @@ illegal_username = 您的用户名包含非法字符。
|
|||
illegal_repo_name = 仓库名称包含非法字符。
|
||||
illegal_org_name = 组织名称包含非法字符。
|
||||
username_password_incorrect = 用户名或密码不正确。
|
||||
enterred_invalid_repo_name = 请检查您输入的仓库名称是正确。
|
||||
enterred_invalid_owner_name = 请检查您输入的新所有者用户名是否正确。
|
||||
enterred_invalid_password = 请检查您输入的密码是否正确。
|
||||
|
||||
invalid_ssh_key = 很抱歉,我们无法验证您输入的 SSH 密钥:%s
|
||||
auth_failed = 授权验证失败:%v
|
||||
|
@ -143,12 +147,34 @@ 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 = 迁移仓库
|
||||
|
||||
settings = 仓库设置
|
||||
settings.options = 基本设置
|
||||
settings.collaboration = 管理协作者
|
||||
settings.hooks = 管理 Web 钩子
|
||||
settings.deploy_keys = 管理部署密钥
|
||||
settings.basic_settings = 基本设置
|
||||
settings.danger_zone = 危险操作区
|
||||
settings.site = 官方网站
|
||||
settings.update_settings = 更新仓库设置
|
||||
settings.transfer = 转移仓库所有权
|
||||
settings.transfer_desc = 您可以将仓库转移至您拥有管理员权限的帐户或组织。
|
||||
settings.delete = 删除本仓库
|
||||
settings.delete_desc = 删除仓库操作不可逆转,请三思而后行。
|
||||
settings.update_settings_success = 仓库设置更新成功!
|
||||
settings.transfer_owner = 新拥有者
|
||||
settings.make_transfer = 确认转移仓库
|
||||
settings.confirm_delete = 确认删除仓库
|
||||
|
||||
[org]
|
||||
org_name_holder = 组织名称
|
||||
org_name_helper = 伟大的组织都有一个简短而寓意深刻的名字。
|
||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.4.7.0801 Alpha"
|
||||
const APP_VER = "0.4.7.0802 Alpha"
|
||||
|
||||
func init() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
|
|
|
@ -116,6 +116,13 @@ func (u *User) EncodePasswd() {
|
|||
u.Passwd = fmt.Sprintf("%x", newPasswd)
|
||||
}
|
||||
|
||||
// ValidtePassword checks if given password matches the one belongs to the user.
|
||||
func (u *User) ValidtePassword(passwd string) bool {
|
||||
newUser := &User{Passwd: passwd, Salt: u.Salt}
|
||||
newUser.EncodePasswd()
|
||||
return u.Passwd == newUser.Passwd
|
||||
}
|
||||
|
||||
// IsOrganization returns true if user is actually a organization.
|
||||
func (u *User) IsOrganization() bool {
|
||||
return u.Type == ORGANIZATION
|
||||
|
|
|
@ -48,7 +48,7 @@ func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs *binding.Errors, l
|
|||
}
|
||||
|
||||
type RepoSettingForm struct {
|
||||
RepoName string `form:"name" binding:"Required;AlphaDash;MaxSize(100)"`
|
||||
RepoName string `form:"repo_name" binding:"Required;AlphaDash;MaxSize(100)"`
|
||||
Description string `form:"desc" binding:"MaxSize(255)"`
|
||||
Website string `form:"site" binding:"Url;MaxSize(100)"`
|
||||
Branch string `form:"branch"`
|
||||
|
|
|
@ -96,9 +96,9 @@ func (ctx *Context) HasError() bool {
|
|||
return hasErr.(bool)
|
||||
}
|
||||
|
||||
// HTML calls render.HTML underlying but reduce one argument.
|
||||
// HTML calls Context.HTML and converts template name to string.
|
||||
func (ctx *Context) HTML(status int, name base.TplName) {
|
||||
ctx.Render.HTML(status, string(name), ctx.Data)
|
||||
ctx.Context.HTML(status, string(name))
|
||||
}
|
||||
|
||||
// RenderWithErr used for page has form validation but need to prompt error to users.
|
||||
|
|
|
@ -851,6 +851,7 @@ The register and sign-in page style
|
|||
color: #888888;
|
||||
font-size: 1.6em;
|
||||
font-weight: normal;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#repo-header-name i {
|
||||
margin-right: 12px;
|
||||
|
@ -1211,6 +1212,9 @@ The register and sign-in page style
|
|||
.code-view .lines-code > pre > ol.linenums > li.active {
|
||||
background: #ffffdd;
|
||||
}
|
||||
.repo-setting-zone {
|
||||
padding: 30px;
|
||||
}
|
||||
#setting-wrapper {
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
@ -1237,17 +1241,27 @@ The register and sign-in page style
|
|||
.setting-content {
|
||||
margin-left: 32px;
|
||||
}
|
||||
#repo-setting-form,
|
||||
#user-profile-form {
|
||||
background-color: #FFF;
|
||||
padding: 30px 0;
|
||||
}
|
||||
#repo-setting-form textarea,
|
||||
#user-profile-form textarea {
|
||||
margin-left: 4px;
|
||||
height: 100px;
|
||||
}
|
||||
#repo-setting-form label,
|
||||
#user-profile-form label,
|
||||
#repo-setting-form .form-label,
|
||||
#user-profile-form .form-label {
|
||||
width: 240px;
|
||||
}
|
||||
#repo-setting-form .ipt,
|
||||
#user-profile-form .ipt {
|
||||
width: 360px;
|
||||
}
|
||||
#repo-setting-form .field,
|
||||
#user-profile-form .field {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
@ -1298,3 +1312,101 @@ The register and sign-in page style
|
|||
#user-ssh-add-form .field {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.repo-issue-wrapper {
|
||||
padding: 18px 0;
|
||||
}
|
||||
.pr-main {
|
||||
padding-right: 40px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.pr-sidebar {
|
||||
border-left: 1px solid #DDD;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#pr-sidebar-nav {
|
||||
margin-top: 6px;
|
||||
}
|
||||
#pr-sidebar-nav li {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#pr-sidebar-nav li > a {
|
||||
border: 1px solid transparent;
|
||||
border-left: none;
|
||||
}
|
||||
#pr-sidebar-nav li > a:hover {
|
||||
background-color: #FFF;
|
||||
border-color: #DDD;
|
||||
}
|
||||
#pr-sidebar-nav .label {
|
||||
font-size: 12px;
|
||||
line-height: 1.4em;
|
||||
margin-top: 1px;
|
||||
}
|
||||
#pr-sidebar-nav li.current a {
|
||||
background-color: #FFF;
|
||||
border-color: #DDD;
|
||||
}
|
||||
.pr-title .pr-num {
|
||||
font-weight: normal;
|
||||
color: #888;
|
||||
}
|
||||
.pr-meta {
|
||||
color: #888;
|
||||
}
|
||||
.pr-meta .pr-author {
|
||||
margin: 0 8px;
|
||||
color: #444;
|
||||
}
|
||||
.pr-meta .pr-author:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.pr-meta .pr-branch {
|
||||
margin: 0 4px;
|
||||
font-size: 12px;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
.pr-nav {
|
||||
border-bottom: 1px solid #DDD;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.pr-nav .octicon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.pr-nav li > a {
|
||||
padding: 3px 9px !important;
|
||||
border: 1px solid transparent;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: .2em;
|
||||
border-top-right-radius: .2em;
|
||||
}
|
||||
.pr-nav li > a .label {
|
||||
padding: 1px 5px;
|
||||
font-size: 12px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
.pr-nav li.current > a {
|
||||
background-color: #FFF;
|
||||
border-color: #E6E6E6;
|
||||
}
|
||||
.diff-bar .diff-add {
|
||||
color: #65ad4e;
|
||||
}
|
||||
.diff-bar .diff-delete {
|
||||
color: #d9453d;
|
||||
}
|
||||
.diff-bar .diff-status {
|
||||
width: 50px;
|
||||
background-color: #d9453d;
|
||||
height: 10px;
|
||||
margin-top: 7px;
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
border-radius: .2em;
|
||||
}
|
||||
.diff-bar .diff-status-inner {
|
||||
width: 45%;
|
||||
background-color: #65ad4e;
|
||||
height: 10px;
|
||||
border-top-left-radius: .2em;
|
||||
border-bottom-left-radius: .2em;
|
||||
}
|
||||
|
|
|
@ -173,12 +173,14 @@ svg:not(:root) {
|
|||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
textarea,
|
||||
input,
|
||||
.ipt {
|
||||
padding: .6em;
|
||||
line-height: normal;
|
||||
border: 1px solid #bbbbbb;
|
||||
}
|
||||
textarea:focus,
|
||||
input:focus,
|
||||
.ipt:focus {
|
||||
background-color: #f2fffc;
|
||||
|
@ -290,6 +292,9 @@ pre {
|
|||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
.left {
|
||||
float: left;
|
||||
}
|
||||
|
@ -651,6 +656,9 @@ ul.menu-radius > li:last-child > a {
|
|||
background-color: #eeeeee;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
}
|
||||
.panel .panel-body {
|
||||
background-color: white;
|
||||
}
|
||||
.panel .panel-body .panel-desc {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
|
|
@ -174,11 +174,31 @@ function initRepoCreate() {
|
|||
console.log('initRepoCreate');
|
||||
}
|
||||
|
||||
function initRepoSetting() {
|
||||
// Confirmation of changing repository name.
|
||||
$('#repo-setting-form').submit(function (e) {
|
||||
var $reponame = $('#repo_name');
|
||||
if (($reponame.data('repo-name') != $reponame.val()) && !confirm('Repository name has been changed, do you want to continue?')) {
|
||||
e.preventDefault();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
$('#transfer-button').click(function () {
|
||||
$('#transfer-form').show();
|
||||
});
|
||||
$('#delete-button').click(function () {
|
||||
$('#delete-form').show();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
initCore();
|
||||
if ($('#repo-create-form').length || $('#repo-migrate-form').length) {
|
||||
initRepoCreate();
|
||||
}
|
||||
if ($('#repo-setting').length) {
|
||||
initRepoSetting();
|
||||
}
|
||||
|
||||
Tabs('#dashboard-sidebar-menu');
|
||||
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
@import "gogs/sign";
|
||||
@import "gogs/repository";
|
||||
@import "gogs/settings";
|
||||
@import "gogs/issue";
|
|
@ -8,6 +8,7 @@
|
|||
border-bottom: 1px solid@panelBorderColor;
|
||||
}
|
||||
.panel-body {
|
||||
background-color: white;
|
||||
.panel-desc {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
|
|
@ -230,6 +230,7 @@ label {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input,
|
||||
.ipt {
|
||||
padding: .6em;
|
||||
|
@ -374,3 +375,7 @@ pre {
|
|||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
|
@ -77,9 +77,9 @@ func Http(ctx *middleware.Context) {
|
|||
repoUser, err := models.GetUserByName(username)
|
||||
if err != nil {
|
||||
if err == models.ErrUserNotExist {
|
||||
ctx.Handle(404, "repo.Http(GetUserByName)", nil)
|
||||
ctx.Handle(404, "GetUserByName", nil)
|
||||
} else {
|
||||
ctx.Handle(500, "repo.Http(GetUserByName)", err)
|
||||
ctx.Handle(500, "GetUserByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -87,9 +87,9 @@ func Http(ctx *middleware.Context) {
|
|||
repo, err := models.GetRepositoryByName(repoUser.Id, reponame)
|
||||
if err != nil {
|
||||
if err == models.ErrRepoNotExist {
|
||||
ctx.Handle(404, "repo.Http(GetRepositoryByName)", nil)
|
||||
ctx.Handle(404, "GetRepositoryByName", nil)
|
||||
} else {
|
||||
ctx.Handle(500, "repo.Http(GetRepositoryByName)", err)
|
||||
ctx.Handle(500, "GetRepositoryByName", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
SETTING base.TplName = "repo/setting"
|
||||
SETTINGS_OPTIONS base.TplName = "repo/settings/options"
|
||||
COLLABORATION base.TplName = "repo/collaboration"
|
||||
|
||||
HOOKS base.TplName = "repo/hooks"
|
||||
|
@ -29,19 +29,20 @@ const (
|
|||
HOOK_EDIT base.TplName = "repo/hook_edit"
|
||||
)
|
||||
|
||||
func Setting(ctx *middleware.Context) {
|
||||
ctx.Data["IsRepoToolbarSetting"] = true
|
||||
ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - settings"
|
||||
ctx.HTML(200, SETTING)
|
||||
func Settings(ctx *middleware.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings")
|
||||
ctx.Data["PageIsSettingsOptions"] = true
|
||||
ctx.HTML(200, SETTINGS_OPTIONS)
|
||||
}
|
||||
|
||||
func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
ctx.Data["IsRepoToolbarSetting"] = true
|
||||
func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings")
|
||||
ctx.Data["PageIsSettingsOptions"] = true
|
||||
|
||||
switch ctx.Query("action") {
|
||||
case "update":
|
||||
if ctx.HasError() {
|
||||
ctx.HTML(200, SETTING)
|
||||
ctx.HTML(200, SETTINGS_OPTIONS)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -50,17 +51,17 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
|||
if ctx.Repo.Repository.Name != newRepoName {
|
||||
isExist, err := models.IsRepositoryExist(ctx.Repo.Owner, newRepoName)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "setting.SettingPost(update: check existence)", err)
|
||||
ctx.Handle(500, "IsRepositoryExist", err)
|
||||
return
|
||||
} else if isExist {
|
||||
ctx.RenderWithErr("Repository name has been taken in your repositories.", SETTING, nil)
|
||||
ctx.Data["Err_RepoName"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), SETTINGS_OPTIONS, nil)
|
||||
return
|
||||
} else if err = models.ChangeRepositoryName(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName); err != nil {
|
||||
ctx.Handle(500, "setting.SettingPost(change repository name)", err)
|
||||
ctx.Handle(500, "ChangeRepositoryName", err)
|
||||
return
|
||||
}
|
||||
log.Trace("%s Repository name changed: %s/%s -> %s", ctx.Req.RequestURI, ctx.User.Name, ctx.Repo.Repository.Name, newRepoName)
|
||||
|
||||
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName)
|
||||
ctx.Repo.Repository.Name = newRepoName
|
||||
}
|
||||
|
||||
|
@ -77,7 +78,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
|||
ctx.Handle(404, "UpdateRepository", err)
|
||||
return
|
||||
}
|
||||
log.Trace("%s Repository updated: %s/%s", ctx.Req.RequestURI, ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
|
||||
log.Trace("Repository updated: %s/%s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
|
||||
|
||||
if ctx.Repo.Repository.IsMirror {
|
||||
if form.Interval > 0 {
|
||||
|
@ -89,51 +90,42 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
|||
}
|
||||
}
|
||||
|
||||
ctx.Flash.Success("Repository options has been successfully updated.")
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success"))
|
||||
ctx.Redirect(fmt.Sprintf("/%s/%s/settings", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name))
|
||||
case "transfer":
|
||||
if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") {
|
||||
ctx.RenderWithErr("Please make sure you entered repository name is correct.", SETTING, nil)
|
||||
return
|
||||
} else if ctx.Repo.Repository.IsMirror {
|
||||
ctx.Error(404)
|
||||
if ctx.Repo.Repository.Name != form.RepoName {
|
||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
|
||||
return
|
||||
}
|
||||
|
||||
newOwner := ctx.Query("owner")
|
||||
// Check if new owner exists.
|
||||
newOwner := ctx.Query("new_owner_name")
|
||||
isExist, err := models.IsUserExist(newOwner)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "setting.SettingPost(transfer: check existence)", err)
|
||||
ctx.Handle(500, "IsUserExist", err)
|
||||
return
|
||||
} else if !isExist {
|
||||
ctx.RenderWithErr("Please make sure you entered owner name is correct.", SETTING, nil)
|
||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_owner_name"), SETTINGS_OPTIONS, nil)
|
||||
return
|
||||
} else if err = models.TransferOwnership(ctx.Repo.Owner, newOwner, ctx.Repo.Repository); err != nil {
|
||||
ctx.Handle(500, "setting.SettingPost(transfer repository)", err)
|
||||
ctx.Handle(500, "TransferOwnership", err)
|
||||
return
|
||||
}
|
||||
log.Trace("%s Repository transfered: %s/%s -> %s", ctx.Req.RequestURI, ctx.User.Name, ctx.Repo.Repository.Name, newOwner)
|
||||
|
||||
log.Trace("Repository transfered: %s/%s -> %s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newOwner)
|
||||
ctx.Redirect("/")
|
||||
case "delete":
|
||||
if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") {
|
||||
ctx.RenderWithErr("Please make sure you entered repository name is correct.", SETTING, nil)
|
||||
if ctx.Repo.Repository.Name != form.RepoName {
|
||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
|
||||
return
|
||||
}
|
||||
|
||||
if ctx.Repo.Owner.IsOrganization() &&
|
||||
!ctx.Repo.Owner.IsOrgOwner(ctx.User.Id) {
|
||||
ctx.Error(403)
|
||||
} else if !ctx.Repo.Owner.ValidtePassword(ctx.Query("password")) {
|
||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
|
||||
return
|
||||
}
|
||||
|
||||
if err := models.DeleteRepository(ctx.Repo.Owner.Id, ctx.Repo.Repository.Id, ctx.Repo.Owner.Name); err != nil {
|
||||
ctx.Handle(500, "setting.Delete(DeleteRepository)", err)
|
||||
ctx.Handle(500, "DeleteRepository", err)
|
||||
return
|
||||
}
|
||||
log.Trace("%s Repository deleted: %s/%s", ctx.Req.RequestURI, ctx.Repo.Owner.LowerName, ctx.Repo.Repository.LowerName)
|
||||
|
||||
log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
|
||||
if ctx.Repo.Owner.IsOrganization() {
|
||||
ctx.Redirect("/org/" + ctx.Repo.Owner.Name + "/dashboard")
|
||||
} else {
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.4.7.0801 Alpha
|
||||
0.4.7.0802 Alpha
|
|
@ -8,23 +8,23 @@
|
|||
</div>
|
||||
<div class="panel-content">
|
||||
{{template "ng/base/alert" .}}
|
||||
<p class="field">
|
||||
<div class="field">
|
||||
<label class="req" for="org_name">{{.i18n.Tr "org.org_name_holder"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_OrgName}}ipt-error{{end}}" id="org_name" name="org_name" type="text" value="{{.org_name}}" required/>
|
||||
<label></label>
|
||||
<span class="help">{{.i18n.Tr "org.org_name_helper"}}</span>
|
||||
</p>
|
||||
<p class="field">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="req" for="email">{{.i18n.Tr "email"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.email}}" required/>
|
||||
<label></label>
|
||||
<span class="help">{{.i18n.Tr "org.org_email_helper"}}</span>
|
||||
</p>
|
||||
<p class="field">
|
||||
</div>
|
||||
<div class="field">
|
||||
<span class="form-label"></span>
|
||||
<button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_org"}}</button>
|
||||
<a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -36,20 +36,20 @@
|
|||
</div>
|
||||
<div class="field">
|
||||
<label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input class="ipt ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
|
||||
<span class="form-label"></span>
|
||||
<span class="help">{{.i18n.Tr "repo.repo_name_helper" | Str2html}}</span>
|
||||
</div>
|
||||
<p class="field">
|
||||
<div class="field">
|
||||
<label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
|
||||
<input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
|
||||
<span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="field clear">
|
||||
<label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
|
||||
<textarea class="ipt ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
|
||||
<textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
|
||||
</div>
|
||||
<p class="field">
|
||||
<div class="field">
|
||||
<label for="lang">{{.i18n.Tr "repo.repo_lang"}}</label>
|
||||
<select id="lang" name="gitignore">
|
||||
<option>{{.i18n.Tr "repo.repo_lang_helper"}}</option>
|
||||
|
@ -64,17 +64,17 @@
|
|||
<option value="{{.}}" {{if eq . $.license}}selected{{end}}>{{.}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</p>
|
||||
<p class="field">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="init-readme"></label>
|
||||
<input class="ipt-chk" id="init-readme" name="init_readme" type="checkbox" {{if .init_readme}}checked{{end}} />
|
||||
<strong>{{.i18n.Tr "repo.init_readme"}}</strong>
|
||||
</p>
|
||||
<p class="field">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="repo-create-submit"></label>
|
||||
<button class="btn btn-large btn-blue btn-radius" id="repo-create-submit">{{.i18n.Tr "repo.create_repo"}}</button>
|
||||
<a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
57
templates/repo/header.tmpl
Normal file
57
templates/repo/header.tmpl
Normal file
|
@ -0,0 +1,57 @@
|
|||
<div id="repo-header" class="clear">
|
||||
<div class="container clear">
|
||||
<h1 id="repo-header-name" class="left public">
|
||||
<i class="mega-octicon octicon-{{if .Repository.IsPrivate}}lock{{else}}repo{{end}}"></i>
|
||||
<a class="author" href="/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
||||
<span class="divider">/</span>
|
||||
<a class="repo text-bold" href="{{.RepoLink}}">{{.Repository.Name}}</a>
|
||||
</h1>
|
||||
<ul id="repo-header-meta" class="right menu menu-line">
|
||||
<li id="repo-header-download" class="inline-block down drop">
|
||||
<a id="repo-header-download-btn" href="#">
|
||||
<button class="btn btn-black text-bold btn-radius">
|
||||
<i class="octicon octicon-cloud-download"></i>
|
||||
</button>
|
||||
</a>
|
||||
<div id="repo-header-download-drop" class="drop-down">
|
||||
<div id="repo-clone" class="clear">
|
||||
<button id="repo-clone-ssh" class="btn btn-blue current left left btn-left-radius">SSH</button>
|
||||
<button id="repo-clone-https" class="btn btn-gray left">HTTPS</button>
|
||||
<input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{.CloneLink.SSH}}" />
|
||||
<button id="repo-clone-copy" class="btn btn-black left btn-right-radius">Copy</button>
|
||||
<p class="text-center" id="repo-clone-help">Need help cloning? Visit <a target="_blank" href="http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository">Help</a>!</p>
|
||||
<hr/>
|
||||
<div class="text-center" id="repo-clone-zip">
|
||||
<a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
|
||||
<a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="repo-header-watch">
|
||||
<a id="repo-header-watch-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-eye-watch"></i>{{if .IsWatchingRepo}}Unwatch{{else}}Watch{{end}}
|
||||
<span class="num">{{.Repository.NumWatches}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li id="repo-header-star">
|
||||
<a id="repo-header-star-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-star"></i>Star
|
||||
<span class="num">{{.Repository.NumStars}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li id="repo-header-fork">
|
||||
<a id="repo-header-fork-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-repo-forked"></i>Fork
|
||||
<span class="num">{{.Repository.NumForks}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1,63 +1,7 @@
|
|||
{{template "ng/base/head" .}}
|
||||
{{template "ng/base/header" .}}
|
||||
<div id="repo-wrapper">
|
||||
<div id="repo-header" class="clear">
|
||||
<div class="container clear">
|
||||
<h1 id="repo-header-name" class="left public">
|
||||
<i class="mega-octicon octicon-{{if .Repository.IsPrivate}}lock{{else}}repo{{end}}"></i>
|
||||
<a class="author" href="/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
||||
<span class="divider">/</span>
|
||||
<a class="repo text-bold" href="{{.RepoLink}}">{{.Repository.Name}}</a>
|
||||
</h1>
|
||||
<ul id="repo-header-meta" class="right menu menu-line">
|
||||
<li id="repo-header-download" class="inline-block down drop">
|
||||
<a id="repo-header-download-btn" href="#">
|
||||
<button class="btn btn-black text-bold btn-radius">
|
||||
<i class="octicon octicon-cloud-download"></i>
|
||||
</button>
|
||||
</a>
|
||||
<div id="repo-header-download-drop" class="drop-down">
|
||||
<div id="repo-clone" class="clear">
|
||||
<button id="repo-clone-ssh" class="btn btn-blue current left left btn-left-radius">SSH</button>
|
||||
<button id="repo-clone-https" class="btn btn-gray left">HTTPS</button>
|
||||
<input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{.CloneLink.SSH}}" />
|
||||
<button id="repo-clone-copy" class="btn btn-black left btn-right-radius">Copy</button>
|
||||
<p class="text-center" id="repo-clone-help">Need help cloning? Visit <a href="#">Help</a>!</p>
|
||||
<hr/>
|
||||
<div class="text-center" id="repo-clone-zip">
|
||||
<a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
|
||||
<a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li id="repo-header-watch">
|
||||
<a id="repo-header-watch-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-eye-watch"></i>{{if .IsWatchingRepo}}Unwatch{{else}}Watch{{end}}
|
||||
<span class="num">{{.Repository.NumWatches}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li id="repo-header-star">
|
||||
<a id="repo-header-star-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-star"></i>Star
|
||||
<span class="num">{{.Repository.NumStars}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
<li id="repo-header-fork">
|
||||
<a id="repo-header-fork-btn" href="#">
|
||||
<button class="btn btn-gray text-bold btn-radius">
|
||||
<i class="octicon octicon-repo-forked"></i>Fork
|
||||
<span class="num">{{.Repository.NumForks}}</span>
|
||||
</button>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/header" .}}
|
||||
<div id="repo-content" class="clear container">
|
||||
<div id="repo-main" class="left grid-4-5">
|
||||
<p id="repo-desc">
|
||||
|
@ -128,34 +72,7 @@
|
|||
{{template "repo/view_list" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div id="repo-sidebar" class="right grid-1-5">
|
||||
<ul class="menu menu-vertical" id="repo-sidebar-nav">
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/issues"><i class="octicon octicon-issue-opened"></i>Issues<span class="num right label label-blue label-radius">{{.Repository.NumOpenIssues}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/pulls"><i class="octicon octicon-git-pull-request"></i>Pull Requests<span class="num right label label-blue label-radius">{{.Repository.NumOpenPulls}}</span></a>
|
||||
</li>
|
||||
<li class="border-bottom"></li>
|
||||
<li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>Commits <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/branches"><i class="octicon octicon-git-branch"></i>Branches<span class="num right label label-gray label-radius">{{.BrancheCount}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/releases"><i class="octicon octicon-tag"></i>Releases <span class="num right label label-gray label-radius">{{.Repository.NumTags}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="#"><i class="octicon octicon-organization"></i>contributors <span class="num right label label-gray label-radius">43</span></a>
|
||||
</li>
|
||||
<li class="border-bottom"></li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/settings"><i class="octicon octicon-tools"></i>settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{template "repo/sidebar" .}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "ng/base/footer" .}}
|
|
@ -8,7 +8,7 @@
|
|||
{{template "ng/base/alert" .}}
|
||||
<div class="field">
|
||||
<label class="req" for="url">HTTPS URL</label>
|
||||
<input class="ipt ipt-radius {{if .Err_HttpsUrl}}ipt-error{{end}}" id="url" name="url" type="text" value="{{.url}}" required />
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_HttpsUrl}}ipt-error{{end}}" id="url" name="url" type="text" value="{{.url}}" required />
|
||||
</div>
|
||||
<div class="field">
|
||||
<span class="form-label"></span>
|
||||
|
@ -16,11 +16,11 @@
|
|||
<div id="repo-migrate-auth" {{if not .Err_Auth}}class="hide"{{end}}>
|
||||
<div class="field">
|
||||
<label for="auth_username">{{.i18n.Tr "username"}}</label>
|
||||
<input class="ipt ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_username" name="auth_username" type="text" value="{{.auth_username}}" />
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_username" name="auth_username" type="text" value="{{.auth_username}}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="auth_password">{{.i18n.Tr "password"}}</label>
|
||||
<input class="ipt ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_password" name="auth_password" type="text" value="{{.auth_password}}" />
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_password" name="auth_password" type="text" value="{{.auth_password}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,27 +55,27 @@
|
|||
</div>
|
||||
<div class="field">
|
||||
<label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input class="ipt ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
|
||||
</div>
|
||||
<p class="field">
|
||||
<div class="field">
|
||||
<label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
|
||||
<input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
|
||||
<span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
|
||||
</p>
|
||||
<p class="field">
|
||||
<label for="visibility">{{.i18n.Tr "repo.migrate_type"}}</label>
|
||||
<input class="ipt-chk" id="visibility" name="mirror" type="checkbox" {{if .mirror}}checked{{end}} />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="migrate_type">{{.i18n.Tr "repo.migrate_type"}}</label>
|
||||
<input class="ipt-chk" id="migrate_type" name="mirror" type="checkbox" {{if .mirror}}checked{{end}} />
|
||||
<span>{{.i18n.Tr "repo.migrate_type_helper" | Str2html}}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="field clear">
|
||||
<label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
|
||||
<textarea class="ipt ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
|
||||
<textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
|
||||
</div>
|
||||
<p class="field">
|
||||
<div class="field">
|
||||
<label for="repo-create-submit"></label>
|
||||
<button class="btn btn-large btn-blue btn-radius" id="repo-create-submit">{{.i18n.Tr "repo.migrate_repo"}}</button>
|
||||
<a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,182 +0,0 @@
|
|||
{{template "base/head" .}}
|
||||
{{template "base/navbar" .}}
|
||||
{{template "repo/nav" .}}
|
||||
{{template "repo/toolbar" .}}
|
||||
<div id="body" class="container">
|
||||
{{template "repo/setting_nav" .}}
|
||||
<div id="repo-setting-container" class="col-md-10">
|
||||
{{template "base/alert" .}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Repository Options
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="form-horizontal">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="update">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 text-right" for="repo-setting-name">Name</label>
|
||||
<div class="col-md-9">
|
||||
<input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" id="repo-setting-name"/>
|
||||
<p class="help-block hidden"><span class="text-danger">Cautious : </span>your repository name is changing !</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 text-right">Description</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" name="desc" id="repo-desc" rows="3">{{.Repository.Description}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 text-right">Official Site</label>
|
||||
<div class="col-md-9">
|
||||
<input type="url" class="form-control" name="site" value="{{.Repository.Website}}" />
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 text-right">Default Branch</label>
|
||||
<div class="col-md-3">
|
||||
<select name="branch" id="repo-default-branch" class="form-control">
|
||||
{{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
|
||||
{{range .Branches}}
|
||||
{{if eq . $.Repository.DefaultBranch}}{{else}}<option value="{{.}}">{{.}}</option>{{end}}
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .Repository.IsMirror}}<div class="form-group">
|
||||
<label class="col-md-3 text-right">Mirror Interval(hours)</label>
|
||||
<div class="col-md-3">
|
||||
<input class="form-control" name="interval" value="{{.MirrorInterval}}"/>
|
||||
</div>
|
||||
</div>{{end}}
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<div class="checkbox">
|
||||
<label style="line-height: 15px;">
|
||||
<input type="checkbox" name="private" {{if .Repository.IsPrivate}}checked{{end}}>
|
||||
<strong>Make this repository private</strong>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label style="line-height: 15px;">
|
||||
<input type="checkbox" name="goget" {{if .Repository.IsGoget}}checked{{end}}>
|
||||
<strong>Enable 'go get' meta</strong>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<button class="btn btn-primary" type="submit">Save Options</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-warning">
|
||||
<div class="panel-heading">
|
||||
Danger Zone
|
||||
</div>
|
||||
|
||||
{{if not .Repository.IsMirror}}
|
||||
<div class="panel-body">
|
||||
<button type="button" class="btn btn-default pull-right" href="#transfer-repository-modal" data-toggle="modal">
|
||||
Transfer ownership
|
||||
</button>
|
||||
<dd>
|
||||
<dt>Transfer ownership</dt>
|
||||
<dl>Transfer this repo to another user or to an organization where you have admin rights.</dl>
|
||||
</dd>
|
||||
|
||||
<div class="modal fade" id="transfer-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="transfer">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Do you really want to transfer this repo?</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning">This is important, pay attention.</div>
|
||||
<ul>
|
||||
<!-- <li>Transferring may be delayed until the new owner approves the transfer.</li> -->
|
||||
<!-- <li>If you are transferring into an org, teams <strong>will not be set</strong>. An owner on the org will need to set teams for the repo.</li> -->
|
||||
<li>Admin rights will be transferred to the new owner, you <strong>will lose admin rights</strong>.</li>
|
||||
<!-- <li>Admin rights will be transferred to the new owner, you <strong>may lose admin rights</strong> if you are transferring into an organization account.</li> -->
|
||||
<li>Redirect entries <strong>will NOT be</strong> set up from the previous location.</li>
|
||||
<li>Git access <strong>will NOT continue</strong> to work from the previous location.</li>
|
||||
</ul>
|
||||
<div class="form-group">
|
||||
<label>Please type the name of the repository to confirm "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
|
||||
<input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Please type the name of the new owner:</label>
|
||||
<input name="owner" class="form-control" type="text" placeholder="Type new owner's name" required="required">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button class="btn btn-danger btn-lg">I understand the consequences, transfer this repository</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<hr>
|
||||
<div class="panel-body">
|
||||
<button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal">
|
||||
Delete this repository
|
||||
</button>
|
||||
<dd>
|
||||
<dt>Delete this repository</dt>
|
||||
<dl>Once you delete a repository, there is no going back. Please be certain.</dl>
|
||||
</dd>
|
||||
|
||||
<div class="modal fade" id="delete-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="delete">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Delete repository</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Please enter your repository name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
|
||||
<input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button class="btn btn-danger btn-lg">I understand the consequences, delete this repository</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
11
templates/repo/settings/nav.tmpl
Normal file
11
templates/repo/settings/nav.tmpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
<div id="setting-menu" class="grid-1-5 panel panel-radius left">
|
||||
<p class="panel-header"><strong>{{.i18n.Tr "repo.settings"}}</strong></p>
|
||||
<div class="panel-body">
|
||||
<ul class="menu menu-vertical switching-list grid-1-5 left">
|
||||
<li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li>
|
||||
<li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li>
|
||||
<li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li>
|
||||
<li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
127
templates/repo/settings/options.tmpl
Normal file
127
templates/repo/settings/options.tmpl
Normal file
|
@ -0,0 +1,127 @@
|
|||
{{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="user-profile-setting-content" class="panel panel-radius">
|
||||
<div class="panel-header">
|
||||
<strong>{{.i18n.Tr "repo.settings.basic_settings"}}</strong>
|
||||
</div>
|
||||
<form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="update">
|
||||
<div class="field">
|
||||
<label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required />
|
||||
</div>
|
||||
<div class="field clear">
|
||||
<label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
|
||||
<textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.Repository.Description}}</textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="site" type="url" value="{{.Repository.Website}}" />
|
||||
</div>
|
||||
<hr>
|
||||
<br>
|
||||
<div class="field">
|
||||
<label for="lang">{{.i18n.Tr "repo.default_branch"}}</label>
|
||||
<select id="lang" name="gitignore">
|
||||
{{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
|
||||
{{range .Branches}}
|
||||
{{if not (eq . $.Repository.DefaultBranch)}}<option value="{{.}}">{{.}}</option>{{end}}
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
{{if .Repository.IsMirror}}
|
||||
<div class="field">
|
||||
<label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius {{if .Err_Interval}}ipt-error{{end}}" id="interval" name="interval" type="number" value="{{.MirrorInterval}}" />
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field">
|
||||
<label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
|
||||
<input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}} />
|
||||
<span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="goget">{{.i18n.Tr "repo.goget_meta"}}</label>
|
||||
<input class="ipt-chk" id="goget" name="goget" type="checkbox" {{if .Repository.IsGoget}}checked{{end}} />
|
||||
<span>{{.i18n.Tr "repo.goget_meta_helper" | Str2html}}</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<span class="form-label"></span>
|
||||
<button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "repo.settings.update_settings"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="setting-content">
|
||||
<div id="setting-content">
|
||||
<div id="user-profile-setting-content" class="panel panel-warning panel-radius">
|
||||
<div class="panel-header">
|
||||
<strong>{{.i18n.Tr "repo.settings.danger_zone"}}</strong>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="repo-setting-zone">
|
||||
<button class="btn btn-gray btn-large btn-radius right" id="transfer-button">{{.i18n.Tr "repo.settings.transfer"}}</button>
|
||||
<dt>{{.i18n.Tr "repo.settings.transfer"}}</dt>
|
||||
<dl>{{.i18n.Tr "repo.settings.transfer_desc"}}</dl>
|
||||
<div class="hide" id="transfer-form">
|
||||
<br>
|
||||
<form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="transfer">
|
||||
<div class="panel-content">
|
||||
<div class="field">
|
||||
<label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
|
||||
</div>
|
||||
<label class="req" for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius" id="new_owner_name" name="new_owner_name" required/>
|
||||
<span class="form-label"></span>
|
||||
<button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="repo-setting-zone">
|
||||
<button class="btn btn-gray btn-large btn-radius pull-right" id="delete-button">{{.i18n.Tr "repo.settings.delete"}}</button>
|
||||
<dt>{{.i18n.Tr "repo.settings.delete"}}</dt>
|
||||
<dl>{{.i18n.Tr "repo.settings.delete_desc"}}</dl>
|
||||
<div class="hide" id="delete-form">
|
||||
<br>
|
||||
<form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<div class="panel-content">
|
||||
<div class="field">
|
||||
<label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
|
||||
</div>
|
||||
<label class="req" for="password">{{.i18n.Tr "password"}}</label>
|
||||
<input class="ipt ipt-large ipt-radius" id="password" name="password" type="password" required/>
|
||||
<span class="form-label"></span>
|
||||
<button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "ng/base/footer" .}}
|
28
templates/repo/sidebar.tmpl
Normal file
28
templates/repo/sidebar.tmpl
Normal file
|
@ -0,0 +1,28 @@
|
|||
<div id="repo-sidebar" class="right grid-1-5">
|
||||
<ul class="menu menu-vertical" id="repo-sidebar-nav">
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/issues"><i class="octicon octicon-issue-opened"></i>Issues<span class="num right label label-blue label-radius">{{.Repository.NumOpenIssues}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/pulls"><i class="octicon octicon-git-pull-request"></i>Pull Requests<span class="num right label label-blue label-radius">{{.Repository.NumOpenPulls}}</span></a>
|
||||
</li>
|
||||
<li class="border-bottom"></li>
|
||||
<li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>Commits <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/branches"><i class="octicon octicon-git-branch"></i>Branches<span class="num right label label-gray label-radius">{{.BrancheCount}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/releases"><i class="octicon octicon-tag"></i>Releases <span class="num right label label-gray label-radius">{{.Repository.NumTags}}</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="radius" href="#"><i class="octicon octicon-organization"></i>contributors <span class="num right label label-gray label-radius">43</span></a>
|
||||
</li>
|
||||
<li class="border-bottom"></li>
|
||||
<li>
|
||||
<a class="radius" href="{{.RepoLink}}/settings"><i class="octicon octicon-tools"></i>settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
Loading…
Reference in a new issue