aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--gogs.go2
-rw-r--r--modules/base/markdown.go10
-rw-r--r--modules/base/tool.go11
-rw-r--r--modules/ssh/ssh.go1
-rwxr-xr-xpublic/css/gogs.css3
-rw-r--r--public/less/_markdown.less4
-rw-r--r--routers/repo/repo.go2
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/admin/config.tmpl4
10 files changed, 34 insertions, 7 deletions
diff --git a/README.md b/README.md
index 69e375d3..3e7b5962 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
-##### Current version: 0.8.22
+##### Current version: 0.8.23
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
diff --git a/gogs.go b/gogs.go
index 81b28c6b..f281217f 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.8.22.0115"
+const APP_VER = "0.8.23.0126"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index a3d3a7ca..0ef379b8 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -142,6 +142,16 @@ func (r *CustomRender) AutoLink(out *bytes.Buffer, link []byte, kind int) {
r.Renderer.AutoLink(out, link, kind)
}
+func (options *CustomRender) ListItem(out *bytes.Buffer, text []byte, flags int) {
+ switch {
+ case bytes.HasPrefix(text, []byte("[ ] ")):
+ text = append([]byte(`<input type="checkbox" disabled="" />`), text[3:]...)
+ case bytes.HasPrefix(text, []byte("[x] ")):
+ text = append([]byte(`<input type="checkbox" disabled="" checked="" />`), text[3:]...)
+ }
+ options.Renderer.ListItem(out, text, flags)
+}
+
var (
svgSuffix = []byte(".svg")
svgSuffixWithMark = []byte(".svg?")
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 6bfd912d..f98ae28b 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -31,7 +31,16 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-var Sanitizer = bluemonday.UGCPolicy().AllowAttrs("class").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).OnElements("code")
+func BuildSanitizer() (p *bluemonday.Policy) {
+ p = bluemonday.UGCPolicy()
+ p.AllowAttrs("class").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).OnElements("code")
+
+ p.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input")
+ p.AllowAttrs("checked", "disabled").OnElements("input")
+ return p
+}
+
+var Sanitizer = BuildSanitizer()
// EncodeMD5 encodes string to md5 hex value.
func EncodeMD5(str string) string {
diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go
index 15ba02a2..4a78d845 100644
--- a/modules/ssh/ssh.go
+++ b/modules/ssh/ssh.go
@@ -91,6 +91,7 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
return
}
+ req.Reply(true, nil)
go io.Copy(input, ch)
io.Copy(ch, stdout)
io.Copy(ch.Stderr(), stderr)
diff --git a/public/css/gogs.css b/public/css/gogs.css
index e37d7bdc..02032e83 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -1490,6 +1490,9 @@ footer .container .links > *:first-child {
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
+.markdown input[type="checkbox"] {
+ vertical-align: middle !important;
+}
.markdown .csv-data td,
.markdown .csv-data th {
padding: 5px;
diff --git a/public/less/_markdown.less b/public/less/_markdown.less
index f12d504f..e59f6a59 100644
--- a/public/less/_markdown.less
+++ b/public/less/_markdown.less
@@ -458,6 +458,10 @@
box-shadow:inset 0 -1px 0 #bbb;
}
+ input[type="checkbox"] {
+ vertical-align: middle !important;
+ }
+
.csv-data td,
.csv-data th {
padding:5px;
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index d60ec688..d4af0bab 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -57,7 +57,7 @@ func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
}
// Check ownership of organization.
- if !org.IsOrganization() || !org.IsOwnedBy(ctx.User.Id) {
+ if !org.IsOrganization() || !(ctx.User.IsAdmin || org.IsOwnedBy(ctx.User.Id)) {
ctx.Error(403)
return nil
}
diff --git a/templates/.VERSION b/templates/.VERSION
index fbe31ee6..fb318e0d 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.8.22.0115 \ No newline at end of file
+0.8.23.0126 \ No newline at end of file
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 0738f18b..ccf5289a 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -78,8 +78,8 @@
<dd><i class="fa fa{{if .Service.EnableCacheAvatar}}-check{{end}}-square-o"></i></dd>
<dt>{{.i18n.Tr "admin.config.mail_notify"}}</dt>
<dd><i class="fa fa{{if .Service.EnableNotifyMail}}-check{{end}}-square-o"></i></dd>
- <dt>{{.i18n.Tr "admin.config.disable_key_size_check"}}</dt>
- <dd><i class="fa fa{{if .Service.DisableMinimumKeySizeCheck}}-check{{end}}-square-o"></i></dd>
+ {{/*<dt>{{.i18n.Tr "admin.config.disable_key_size_check"}}</dt>
+ <dd><i class="fa fa{{if .Service.DisableMinimumKeySizeCheck}}-check{{end}}-square-o"></i></dd>*/}}
<dt>{{.i18n.Tr "admin.config.enable_captcha"}}</dt>
<dd><i class="fa fa{{if .Service.EnableCaptcha}}-check{{end}}-square-o"></i></dd>
<div class="ui divider"></div>