@@ -230,9 +230,10 @@ type Repository struct { | |||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | ||||
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` | UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` | ||||
Hot int64 `xorm:"-"` | |||||
Active int64 `xorm:"-"` | |||||
Alias string | |||||
Hot int64 `xorm:"-"` | |||||
Active int64 `xorm:"-"` | |||||
Alias string `xorm:"INDEX"` | |||||
LowerAlias string `xorm:"INDEX"` | |||||
} | } | ||||
// SanitizedOriginalURL returns a sanitized OriginalURL | // SanitizedOriginalURL returns a sanitized OriginalURL | ||||
@@ -963,10 +964,10 @@ func isRepositoryExist(e Engine, u *User, repoName string, alias string) (bool, | |||||
cond = cond.And(builder.Eq{"owner_id": u.ID}) | cond = cond.And(builder.Eq{"owner_id": u.ID}) | ||||
if alias != "" { | if alias != "" { | ||||
subCon := builder.NewCond() | subCon := builder.NewCond() | ||||
subCon = subCon.Or(builder.Eq{"alias": alias}, builder.Eq{"lower_name": repoName}) | |||||
subCon = subCon.Or(builder.Eq{"lower_alias": strings.ToLower(alias)}, builder.Eq{"lower_name": strings.ToLower(repoName)}) | |||||
cond = cond.And(subCon) | cond = cond.And(subCon) | ||||
} else { | } else { | ||||
cond = cond.And(builder.Eq{"lower_name": repoName}) | |||||
cond = cond.And(builder.Eq{"lower_name": strings.ToLower(repoName)}) | |||||
} | } | ||||
count, err := e.Where(cond).Count(&Repository{}) | count, err := e.Where(cond).Count(&Repository{}) | ||||
return count > 0 || com.IsDir(RepoPath(u.Name, repoName)), err | return count > 0 || com.IsDir(RepoPath(u.Name, repoName)), err | ||||
@@ -985,7 +986,7 @@ func IsRepositoryAliasExist(u *User, alias string) (bool, error) { | |||||
func isRepositoryAliasExist(e Engine, u *User, alias string) (bool, error) { | func isRepositoryAliasExist(e Engine, u *User, alias string) (bool, error) { | ||||
var cond = builder.NewCond() | var cond = builder.NewCond() | ||||
cond = cond.And(builder.Eq{"owner_id": u.ID}) | cond = cond.And(builder.Eq{"owner_id": u.ID}) | ||||
cond = cond.And(builder.Eq{"alias": alias}) | |||||
cond = cond.And(builder.Eq{"lower_alias": strings.ToLower(alias)}) | |||||
count, err := e.Where(cond).Count(&Repository{}) | count, err := e.Where(cond).Count(&Repository{}) | ||||
return count > 0, err | return count > 0, err | ||||
} | } | ||||
@@ -1131,6 +1132,7 @@ func IsUsableRepoAlias(name string) error { | |||||
// CreateRepository creates a repository for the user/organization. | // CreateRepository creates a repository for the user/organization. | ||||
func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, opts ...CreateRepoOptions) (err error) { | func CreateRepository(ctx DBContext, doer, u *User, repo *Repository, opts ...CreateRepoOptions) (err error) { | ||||
repo.LowerAlias = strings.ToLower(repo.Alias) | |||||
if err = IsUsableRepoName(repo.Name); err != nil { | if err = IsUsableRepoName(repo.Name); err != nil { | ||||
return err | return err | ||||
} | } | ||||
@@ -154,6 +154,22 @@ func (a *actionNotifier) NotifyRenameRepository(doer *models.User, repo *models. | |||||
} | } | ||||
} | } | ||||
func (a *actionNotifier) NotifyAliasRepository(doer *models.User, repo *models.Repository, oldAlias string) { | |||||
log.Trace("action.ChangeRepositoryAlias: %s/%s", doer.Name, repo.Alias) | |||||
if err := models.NotifyWatchers(&models.Action{ | |||||
ActUserID: doer.ID, | |||||
ActUser: doer, | |||||
OpType: models.ActionRenameRepo, | |||||
RepoID: repo.ID, | |||||
Repo: repo, | |||||
IsPrivate: repo.IsPrivate, | |||||
Content: oldAlias, | |||||
}); err != nil { | |||||
log.Error("NotifyWatchers: %v", err) | |||||
} | |||||
} | |||||
func (a *actionNotifier) NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) { | func (a *actionNotifier) NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) { | ||||
if err := models.NotifyWatchers(&models.Action{ | if err := models.NotifyWatchers(&models.Action{ | ||||
ActUserID: doer.ID, | ActUserID: doer.ID, | ||||
@@ -18,6 +18,7 @@ type Notifier interface { | |||||
NotifyDeleteRepository(doer *models.User, repo *models.Repository) | NotifyDeleteRepository(doer *models.User, repo *models.Repository) | ||||
NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) | NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) | ||||
NotifyRenameRepository(doer *models.User, repo *models.Repository, oldRepoName string) | NotifyRenameRepository(doer *models.User, repo *models.Repository, oldRepoName string) | ||||
NotifyAliasRepository(doer *models.User, repo *models.Repository, oldAlias string) | |||||
NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) | NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) | ||||
NotifyNewIssue(*models.Issue) | NotifyNewIssue(*models.Issue) | ||||
@@ -135,6 +135,10 @@ func (*NullNotifier) NotifyDeleteRef(doer *models.User, repo *models.Repository, | |||||
func (*NullNotifier) NotifyRenameRepository(doer *models.User, repo *models.Repository, oldRepoName string) { | func (*NullNotifier) NotifyRenameRepository(doer *models.User, repo *models.Repository, oldRepoName string) { | ||||
} | } | ||||
func (a *NullNotifier) NotifyAliasRepository(doer *models.User, repo *models.Repository, oldAlias string) { | |||||
} | |||||
// NotifyTransferRepository places a place holder function | // NotifyTransferRepository places a place holder function | ||||
func (*NullNotifier) NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) { | func (*NullNotifier) NotifyTransferRepository(doer *models.User, repo *models.Repository, oldOwnerName string) { | ||||
} | } | ||||
@@ -6,6 +6,7 @@ | |||||
package repo | package repo | ||||
import ( | import ( | ||||
"code.gitea.io/gitea/modules/notification" | |||||
"errors" | "errors" | ||||
"fmt" | "fmt" | ||||
"io/ioutil" | "io/ioutil" | ||||
@@ -71,8 +72,10 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
} | } | ||||
newAlias := form.Alias | newAlias := form.Alias | ||||
var aliasChanged = false | |||||
// Check if repository alias has been changed. | // Check if repository alias has been changed. | ||||
if repo.Alias != newAlias { | |||||
if strings.ToLower(repo.Alias) != strings.ToLower(newAlias) { | |||||
aliasChanged = true | |||||
//check new alias is available or not | //check new alias is available or not | ||||
if err := models.IsRepositoryAliasAvailable(ctx.Repo.Owner, newAlias); err != nil { | if err := models.IsRepositoryAliasAvailable(ctx.Repo.Owner, newAlias); err != nil { | ||||
ctx.Data["Err_Alias"] = true | ctx.Data["Err_Alias"] = true | ||||
@@ -117,6 +120,10 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName) | log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName) | ||||
} | } | ||||
//notify | |||||
if aliasChanged { | |||||
notification.NotifyRenameRepository(ctx.Repo.Owner, repo, repo.Alias) | |||||
} | |||||
// In case it's just a case change. | // In case it's just a case change. | ||||
repo.Name = newRepoName | repo.Name = newRepoName | ||||
@@ -125,6 +132,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
repo.Website = form.Website | repo.Website = form.Website | ||||
repo.IsTemplate = form.Template | repo.IsTemplate = form.Template | ||||
repo.Alias = newAlias | repo.Alias = newAlias | ||||
repo.LowerAlias = strings.ToLower(newAlias) | |||||
// Visibility of forked repository is forced sync with base repository. | // Visibility of forked repository is forced sync with base repository. | ||||
if repo.IsFork { | if repo.IsFork { | ||||
@@ -404,7 +412,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
ctx.Error(404) | ctx.Error(404) | ||||
return | return | ||||
} | } | ||||
if repo.Name != form.RepoName { | |||||
if repo.Alias != form.RepoName { | |||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ||||
return | return | ||||
} | } | ||||
@@ -431,7 +439,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
ctx.Error(404) | ctx.Error(404) | ||||
return | return | ||||
} | } | ||||
if repo.Name != form.RepoName { | |||||
if repo.Alias != form.RepoName { | |||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ||||
return | return | ||||
} | } | ||||
@@ -469,7 +477,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
ctx.Error(404) | ctx.Error(404) | ||||
return | return | ||||
} | } | ||||
if repo.Name != form.RepoName { | |||||
if repo.Alias != form.RepoName { | |||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ||||
return | return | ||||
} | } | ||||
@@ -489,7 +497,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) { | |||||
ctx.Error(404) | ctx.Error(404) | ||||
return | return | ||||
} | } | ||||
if repo.Name != form.RepoName { | |||||
if repo.Alias != form.RepoName { | |||||
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), tplSettingsOptions, nil) | ||||
return | return | ||||
} | } | ||||
@@ -55,7 +55,7 @@ func TransferOwnership(doer, newOwner *models.User, repo *models.Repository, tea | |||||
// ChangeRepositoryName changes all corresponding setting from old repository name to new one. | // ChangeRepositoryName changes all corresponding setting from old repository name to new one. | ||||
func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoName string) error { | func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoName string) error { | ||||
oldRepoName := repo.Name | |||||
//oldRepoName := repo.Name | |||||
// Change repository directory name. We must lock the local copy of the | // Change repository directory name. We must lock the local copy of the | ||||
// repo so that we can atomically rename the repo path and updates the | // repo so that we can atomically rename the repo path and updates the | ||||
@@ -68,7 +68,7 @@ func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoNam | |||||
} | } | ||||
repoWorkingPool.CheckOut(com.ToStr(repo.ID)) | repoWorkingPool.CheckOut(com.ToStr(repo.ID)) | ||||
notification.NotifyRenameRepository(doer, repo, oldRepoName) | |||||
//notification.NotifyRenameRepository(doer, repo, oldRepoName) | |||||
return nil | return nil | ||||
} | } |
@@ -256,11 +256,8 @@ | |||||
</div> | </div> | ||||
<div class="ui six wide tablet four wide computer column"> | <div class="ui six wide tablet four wide computer column"> | ||||
<div id="repo-desc"> | <div id="repo-desc"> | ||||
<h4 id="about-desc" class="ui header">简介 | |||||
<!-- <a class="edit-icon" href="javascript:void(0)"> | |||||
<i class="gray edit outline icon"></i> | |||||
</a> --> | |||||
</h4> | |||||
<h4 id="about-desc" class="ui header">简介</h4> | |||||
<input type="hidden" id="edit-alias" value="{{.Repository.Alias}}"> | |||||
<p> | <p> | ||||
{{if .Repository.DescriptionHTML}} | {{if .Repository.DescriptionHTML}} | ||||
<span class="description" style="word-break:break-all">{{.Repository.DescriptionHTML}}</span> | <span class="description" style="word-break:break-all">{{.Repository.DescriptionHTML}}</span> | ||||
@@ -286,14 +283,8 @@ | |||||
<i class="grey bookmark icon"></i> | <i class="grey bookmark icon"></i> | ||||
<div id="repo-topics1" style="flex: 1;"> | <div id="repo-topics1" style="flex: 1;"> | ||||
<!-- {{if not .Topics}} | |||||
<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span> | |||||
{{end}} --> | |||||
{{range .Topics}} | {{range .Topics}} | ||||
<a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=">{{.Name}}</a> | <a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=">{{.Name}}</a> | ||||
{{end}} | {{end}} | ||||
</div> | </div> | ||||
<div> | <div> | ||||
@@ -509,7 +509,7 @@ | |||||
<div class="field"> | <div class="field"> | ||||
<label> | <label> | ||||
{{.i18n.Tr "repo.settings.transfer_form_title"}} | {{.i18n.Tr "repo.settings.transfer_form_title"}} | ||||
<span class="text red">{{.Repository.Name}}</span> | |||||
<span class="text red">{{.Repository.Alias}}</span> | |||||
</label> | </label> | ||||
</div> | </div> | ||||
<div class="required field"> | <div class="required field"> | ||||
@@ -541,7 +541,7 @@ | |||||
<div class="field"> | <div class="field"> | ||||
<label> | <label> | ||||
{{.i18n.Tr "repo.settings.transfer_form_title"}} | {{.i18n.Tr "repo.settings.transfer_form_title"}} | ||||
<span class="text red">{{.Repository.Name}}</span> | |||||
<span class="text red">{{.Repository.Alias}}</span> | |||||
</label> | </label> | ||||
</div> | </div> | ||||
<div class="required field"> | <div class="required field"> | ||||
@@ -568,7 +568,7 @@ | |||||
<div class="content"> | <div class="content"> | ||||
<div class="ui warning message text left"> | <div class="ui warning message text left"> | ||||
{{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br> | {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br> | ||||
{{.i18n.Tr "repo.settings.delete_notices_2" .Repository.FullName | Safe}} | |||||
{{.i18n.Tr "repo.settings.delete_notices_2" .Repository.Alias | Safe}} | |||||
{{if .Repository.NumForks}}<br> | {{if .Repository.NumForks}}<br> | ||||
{{.i18n.Tr "repo.settings.delete_notices_fork_1"}} | {{.i18n.Tr "repo.settings.delete_notices_fork_1"}} | ||||
{{end}} | {{end}} | ||||
@@ -579,7 +579,7 @@ | |||||
<div class="field"> | <div class="field"> | ||||
<label> | <label> | ||||
{{.i18n.Tr "repo.settings.transfer_form_title"}} | {{.i18n.Tr "repo.settings.transfer_form_title"}} | ||||
<span class="text red">{{.Repository.Name}}</span> | |||||
<span class="text red">{{.Repository.Alias}}</span> | |||||
</label> | </label> | ||||
</div> | </div> | ||||
<div class="required field"> | <div class="required field"> | ||||
@@ -603,7 +603,7 @@ | |||||
<div class="content"> | <div class="content"> | ||||
<div class="ui warning message text left"> | <div class="ui warning message text left"> | ||||
{{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br> | {{.i18n.Tr "repo.settings.delete_notices_1" | Safe}}<br> | ||||
{{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}} | |||||
{{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Alias | Safe}} | |||||
</div> | </div> | ||||
<form class="ui form" action="{{.Link}}" method="post"> | <form class="ui form" action="{{.Link}}" method="post"> | ||||
{{.CsrfTokenHtml}} | {{.CsrfTokenHtml}} | ||||
@@ -611,7 +611,7 @@ | |||||
<div class="field"> | <div class="field"> | ||||
<label> | <label> | ||||
{{.i18n.Tr "repo.settings.transfer_form_title"}} | {{.i18n.Tr "repo.settings.transfer_form_title"}} | ||||
<span class="text red">{{.Repository.Name}}</span> | |||||
<span class="text red">{{.Repository.Alias}}</span> | |||||
</label> | </label> | ||||
</div> | </div> | ||||
<div class="required field"> | <div class="required field"> | ||||
@@ -21,55 +21,55 @@ | |||||
{{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoFullDisplayName | Str2html}} | {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoFullDisplayName | Str2html}} | ||||
{{else if eq .GetOpType 6}} | {{else if eq .GetOpType 6}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 7}} | {{else if eq .GetOpType 7}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 8}} | {{else if eq .GetOpType 8}} | ||||
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 9}} | {{else if eq .GetOpType 9}} | ||||
{{ $branchLink := .GetBranch | EscapePound | Escape}} | {{ $branchLink := .GetBranch | EscapePound | Escape}} | ||||
{{$.i18n.Tr "action.push_tag" .GetRepoLink $branchLink .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.push_tag" .GetRepoLink $branchLink .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 10}} | {{else if eq .GetOpType 10}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 11}} | {{else if eq .GetOpType 11}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 12}} | {{else if eq .GetOpType 12}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 13}} | {{else if eq .GetOpType 13}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 14}} | {{else if eq .GetOpType 14}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 15}} | {{else if eq .GetOpType 15}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 16}} | {{else if eq .GetOpType 16}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 17}} | {{else if eq .GetOpType 17}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 18}} | {{else if eq .GetOpType 18}} | ||||
{{ $branchLink := .GetBranch | EscapePound}} | {{ $branchLink := .GetBranch | EscapePound}} | ||||
{{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 19}} | {{else if eq .GetOpType 19}} | ||||
{{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 20}} | {{else if eq .GetOpType 20}} | ||||
{{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 21}} | {{else if eq .GetOpType 21}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.approve_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.approve_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 22}} | {{else if eq .GetOpType 22}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.reject_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.reject_pull_request" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{else if eq .GetOpType 23}} | {{else if eq .GetOpType 23}} | ||||
{{ $index := index .GetIssueInfos 0}} | {{ $index := index .GetIssueInfos 0}} | ||||
{{$.i18n.Tr "action.comment_pull" .GetRepoLink $index .ShortRepoPath | Str2html}} | |||||
{{$.i18n.Tr "action.comment_pull" .GetRepoLink $index .ShortRepoFullDisplayName | Str2html}} | |||||
{{end}} | {{end}} | ||||
</p> | </p> | ||||
{{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | {{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | ||||
@@ -52,6 +52,7 @@ export default { | |||||
desc: '', | desc: '', | ||||
index_web: '', | index_web: '', | ||||
repo_name_name: '', | repo_name_name: '', | ||||
alias:'' | |||||
}, | }, | ||||
// rule1:[{min:3,max:5,message:'1',trigger:"blur"}], | // rule1:[{min:3,max:5,message:'1',trigger:"blur"}], | ||||
rule: { | rule: { | ||||
@@ -76,6 +77,7 @@ export default { | |||||
getRepoName() { | getRepoName() { | ||||
const el = this.url.split('/')[2]; | const el = this.url.split('/')[2]; | ||||
this.info.repo_name = el; | this.info.repo_name = el; | ||||
this.info.alias = $('input#edit-alias').val() | |||||
}, | }, | ||||
initForm(diaolog) { | initForm(diaolog) { | ||||
if (diaolog === false) { | if (diaolog === false) { | ||||
@@ -95,6 +97,7 @@ export default { | |||||
data: this.qs.stringify({ | data: this.qs.stringify({ | ||||
_csrf: csrf, | _csrf: csrf, | ||||
action: 'update', | action: 'update', | ||||
alias:this.info.alias, | |||||
repo_name: this.info.repo_name, | repo_name: this.info.repo_name, | ||||
description: this.info.desc, | description: this.info.desc, | ||||
website: this.info.index_web | website: this.info.index_web | ||||