From 08405a4fea1d2e5c73a73dafd866e0c00c7749c2 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Wed, 26 Mar 2014 21:47:20 +0800 Subject: [PATCH] add issue view ui --- public/css/gogs.css | 73 +++++++++++++++++++++++++++++- routers/repo/issue.go | 1 + templates/issue/list.tmpl | 2 +- templates/issue/view.tmpl | 89 +++++++++++++++++++++++++++++++++++++ templates/repo/toolbar.tmpl | 6 ++- 5 files changed, 166 insertions(+), 5 deletions(-) create mode 100644 templates/issue/view.tmpl diff --git a/public/css/gogs.css b/public/css/gogs.css index 6bf698e8b1f..6d498e0e652 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1014,11 +1014,11 @@ html, body { margin-bottom: 0; } -#issue-create-form .nav-tabs { +#issue-create-form .nav-tabs, #issue .issue-reply .nav-tabs { margin-bottom: 10px; } -#issue-create-form .md-help { +#issue .md-help { margin-top: 6px; } @@ -1095,6 +1095,75 @@ html, body { vertical-align: top; } +#issue .issue-whole .title { + margin-top: 0; + font-size: 28px; +} + +#issue .issue-whole .number { + font-size: 26px; + color: #AAA; +} + +#issue .issue-head .author .avatar { + width: 48px; + height: 48px; + margin-right: 16px; +} + +#issue .issue-head .info { + width: 99%; + margin-top: 10px; + padding-left: 64px; + margin-bottom: 16px; + padding-bottom: 20px; + border-bottom: 1px solid #CCC; +} + +#issue .issue-head .status { + font-size: 16px; + font-weight: bold; + padding: 6px 18px; + border-radius: 3px; +} + +#issue .issue-head a.author { + margin-left: .6em; + color: #444; +} + +#issue .issue-main { + padding-left: 0; +} + +#issue .issue-content { + border-bottom-width: 1px; +} + +#issue .issue-child .user .avatar { + width: 42px; + height: 42px; + margin-right: 12px; +} + +#issue .issue-child .issue-content { + margin-left: 56px; +} + +#issue .issue-child .panel-heading { + padding-top: 10px; + padding-bottom: 10px; + font-weight: normal; +} + +#issue .issue-child .panel-heading .user { + font-weight: bold; +} + +#issue .issue-line { + border-color: #CCC; +} + /* wrapper and footer */ #wrapper { diff --git a/routers/repo/issue.go b/routers/repo/issue.go index a4dbad0f41d..72d07d4acf6 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -20,6 +20,7 @@ import ( func Issues(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Issues" ctx.Data["IsRepoToolbarIssues"] = true + ctx.Data["IsRepoToolbarIssuesList"] = true milestoneId, _ := base.StrTo(params["milestone"]).Int() page, _ := base.StrTo(params["page"]).Int() diff --git a/templates/issue/list.tmpl b/templates/issue/list.tmpl index 0df68838670..60f22a0d31f 100644 --- a/templates/issue/list.tmpl +++ b/templates/issue/list.tmpl @@ -20,7 +20,7 @@
{{range .Issues}} -
+
#{{.Index}}
{{.Name}}

diff --git a/templates/issue/view.tmpl b/templates/issue/view.tmpl new file mode 100644 index 00000000000..381c79990c6 --- /dev/null +++ b/templates/issue/view.tmpl @@ -0,0 +1,89 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +{{template "repo/nav" .}} +{{template "repo/toolbar" .}} +

+
+
+
+
#448
+ +

[Request]关于context中的Download方法

+

+ Open + linbaozhong opened this issue + 2 months ago · 1 comment +

+
+
+
+
+

context中的Download方法:

+

func (output *BeegoOutput) Download(file string)

+

建议在file参数后面增加一个可选参数filename.

+

如果filename不存在或为空,output.Header("Content-Disposition", "attachment; filename="+filepath.Base(file))

+

如果filename不为空,output.Header("Content-Disposition", "attachment; filename="+filename)

+

因为有时候,多数情况下,要下载的真实的文件名与显示和保存的本地的文件名是不一样的,希望显示的文件名更友好些

+
+
+
+ +
+
+ phpqinsir commented 3 days ago +
+
+

@slene 看来也只能这样了。最主要是数组与切片的用法,我感觉不科学。因为要知道个数,然后个数与问号个数要对应。不能像PHP YII框架那样,直接传入一个数组,自己在里面把参数组装成1,2,3,4这种格式。希望,Beego框架能加上。那就太完美了。谢谢。

+
+
+
+
+ +
+
+ phpqinsir commented 3 days ago +
+
+

@slene 看来也只能这样了。最主要是数组与切片的用法,我感觉不科学。因为要知道个数,然后个数与问号个数要对应。不能像PHP YII框架那样,直接传入一个数组,自己在里面把参数组装成1,2,3,4这种格式。希望,Beego框架能加上。那就太完美了。谢谢。

+
+
+
+
+
+ +
+
+
+
+ Content with Markdown +
+ +
+
+
+ +
+
+
preview
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+{{template "base/footer" .}} \ No newline at end of file diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index 17d4e5b1ad7..e3390c77ca2 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -10,9 +10,11 @@
  • Issues
  • {{if .IsRepoToolbarIssues}} -
  • +
  • {{if .IsRepoToolbarIssuesList}} -
  • + {{else}} + + {{end}} {{end}}