aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/base/conf.go22
-rw-r--r--modules/base/template.go8
-rw-r--r--modules/hooks/hooks.go2
-rw-r--r--modules/middleware/logger.go2
4 files changed, 21 insertions, 13 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go
index 73552732..cbd6532b 100644
--- a/modules/base/conf.go
+++ b/modules/base/conf.go
@@ -45,16 +45,16 @@ type Oauther struct {
}
var (
- AppVer string
- AppName string
- AppLogo string
- AppUrl string
- OfflineMode bool
- RouterLog bool
- ProdMode bool
- Domain string
- SecretKey string
- RunUser string
+ AppVer string
+ AppName string
+ AppLogo string
+ AppUrl string
+ OfflineMode bool
+ DisableRouterLog bool
+ ProdMode bool
+ Domain string
+ SecretKey string
+ RunUser string
RepoRootPath string
ScriptType string
@@ -330,7 +330,7 @@ func NewConfigContext() {
AppUrl = Cfg.MustValue("server", "ROOT_URL")
Domain = Cfg.MustValue("server", "DOMAIN")
OfflineMode = Cfg.MustBool("server", "OFFLINE_MODE", false)
- RouterLog = Cfg.MustBool("server", "ROUTER_LOG", true)
+ DisableRouterLog = Cfg.MustBool("server", "DISABLE_ROUTER_LOG", false)
SecretKey = Cfg.MustValue("security", "SECRET_KEY")
InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false)
diff --git a/modules/base/template.go b/modules/base/template.go
index a69a5461..135be107 100644
--- a/modules/base/template.go
+++ b/modules/base/template.go
@@ -117,6 +117,8 @@ func ActionIcon(opType int) string {
return "exclamation-circle"
case 8: // Transfer repository.
return "share"
+ case 10: // Comment issue.
+ return "comment"
default:
return "invalid type"
}
@@ -130,6 +132,8 @@ const (
<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>`
TPL_PUSH_TAG = `<a href="/user/%s">%s</a> pushed tag <a href="/%s/src/%s" rel="nofollow">%s</a> at <a href="/%s">%s</a>`
+ TPL_COMMENT_ISSUE = `<a href="/user/%s">%s</a> commented on issue <a href="/%s/issues/%s">%s#%s</a>
+<div><img src="%s?s=16" alt="user-avatar"/> %s</div>`
)
type PushCommit struct {
@@ -179,6 +183,10 @@ func ActionDesc(act Actioner) string {
return fmt.Sprintf(TPL_TRANSFER_REPO, actUserName, actUserName, repoLink, newRepoLink, newRepoLink)
case 9: // Push tag.
return fmt.Sprintf(TPL_PUSH_TAG, actUserName, actUserName, repoLink, branch, branch, repoLink, repoLink)
+ case 10: // Comment issue.
+ infos := strings.SplitN(content, "|", 2)
+ return fmt.Sprintf(TPL_COMMENT_ISSUE, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0],
+ AvatarLink(email), infos[1])
default:
return "invalid type"
}
diff --git a/modules/hooks/hooks.go b/modules/hooks/hooks.go
index 2b53dbfb..a3a59454 100644
--- a/modules/hooks/hooks.go
+++ b/modules/hooks/hooks.go
@@ -77,7 +77,7 @@ func handleQueue() {
log.Error("hooks.handleQueue: Fail to deliver hook: %v", err)
continue
}
- log.Info("Hook delivered")
+ log.Info("Hook delivered: %s", string(data))
}
}
}
diff --git a/modules/middleware/logger.go b/modules/middleware/logger.go
index d815b90c..1ee030a0 100644
--- a/modules/middleware/logger.go
+++ b/modules/middleware/logger.go
@@ -24,7 +24,7 @@ func init() {
func Logger() martini.Handler {
return func(res http.ResponseWriter, req *http.Request, ctx martini.Context, log *log.Logger) {
- if !base.RouterLog {
+ if base.DisableRouterLog {
return
}