aboutsummaryrefslogtreecommitdiff
path: root/modules/base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/template.go4
-rw-r--r--modules/base/tool.go10
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/base/template.go b/modules/base/template.go
index dfcae931..56b77a5d 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -67,6 +67,10 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{
"DateFormat": DateFormat,
"List": List,
"Mail2Domain": func(mail string) string {
+ if !strings.Contains(mail, "@") {
+ return "try.gogits.org"
+ }
+
suffix := strings.SplitN(mail, "@", 2)[1]
domain, ok := mailDomains[suffix]
if !ok {
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 6876da76..3946c4b5 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -494,6 +494,8 @@ func ActionIcon(opType int) string {
return "arrow-circle-o-right"
case 6: // Create issue.
return "exclamation-circle"
+ case 8: // Transfer repository.
+ return "share"
default:
return "invalid type"
}
@@ -503,8 +505,9 @@ const (
TPL_CREATE_REPO = `<a href="/user/%s">%s</a> created repository <a href="/%s">%s</a>`
TPL_COMMIT_REPO = `<a href="/user/%s">%s</a> pushed to <a href="/%s/src/%s">%s</a> at <a href="/%s">%s</a>%s`
TPL_COMMIT_REPO_LI = `<div><img src="%s?s=16" alt="user-avatar"/> <a href="/%s/commit/%s">%s</a> %s</div>`
- TPL_CREATE_Issue = `<a href="/user/%s">%s</a> opened issue <a href="/%s/issues/%s">%s#%s</a>
+ TPL_CREATE_ISSUE = `<a href="/user/%s">%s</a> opened issue <a href="/%s/issues/%s">%s#%s</a>
<div><img src="%s?s=16" alt="user-avatar"/> %s</div>`
+ TPL_TRANSFER_REPO = `<a href="/user/%s">%s</a> transfered repository <code>%s</code> to <a href="/%s">%s</a>`
)
type PushCommit struct {
@@ -547,8 +550,11 @@ func ActionDesc(act Actioner) string {
buf.String())
case 6: // Create issue.
infos := strings.SplitN(content, "|", 2)
- return fmt.Sprintf(TPL_CREATE_Issue, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0],
+ return fmt.Sprintf(TPL_CREATE_ISSUE, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0],
AvatarLink(email), infos[1])
+ case 8: // Transfer repository.
+ newRepoLink := content + "/" + repoName
+ return fmt.Sprintf(TPL_TRANSFER_REPO, actUserName, actUserName, repoLink, newRepoLink, newRepoLink)
default:
return "invalid type"
}