File tree Expand file tree Collapse file tree 7 files changed +26
-6
lines changed Expand file tree Collapse file tree 7 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,11 @@ func newMacaron() *macaron.Macaron {
88
88
if setting .Protocol == setting .FCGI {
89
89
m .SetURLPrefix (setting .AppSubURL )
90
90
}
91
+ m .Use (public .Custom (
92
+ & public.Options {
93
+ SkipLogging : setting .DisableRouterLog ,
94
+ },
95
+ ))
91
96
m .Use (public .Static (
92
97
& public.Options {
93
98
Directory : path .Join (setting .StaticRootPath , "public" ),
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ type Attachment struct {
31
31
CreatedUnix int64
32
32
}
33
33
34
-
35
34
// BeforeInsert is invoked from XORM before inserting an object of this type.
36
35
func (a * Attachment ) BeforeInsert () {
37
36
a .CreatedUnix = time .Now ().Unix ()
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ import (
14
14
"time"
15
15
16
16
"code.gitea.io/git"
17
+ "code.gitea.io/gitea/modules/base"
17
18
"code.gitea.io/gitea/modules/log"
18
19
"code.gitea.io/gitea/modules/process"
19
20
"code.gitea.io/gitea/modules/setting"
20
21
"code.gitea.io/gitea/modules/sync"
21
22
api "code.gitea.io/sdk/gitea"
22
23
"github.com/Unknwon/com"
23
24
"github.com/go-xorm/xorm"
24
- "code.gitea.io/gitea/modules/base"
25
25
)
26
26
27
27
var pullRequestQueue = sync .NewUniqueQueue (setting .Repository .PullRequestQueueLength )
Original file line number Diff line number Diff line change 4
4
5
5
package public
6
6
7
+ import (
8
+ "path"
9
+
10
+ "code.gitea.io/gitea/modules/setting"
11
+ "gopkg.in/macaron.v1"
12
+ )
13
+
7
14
//go:generate go-bindata -tags "bindata" -ignore "\\.go|\\.less" -pkg "public" -o "bindata.go" ../../public/...
8
15
//go:generate go fmt bindata.go
9
16
//go:generate sed -i.bak s/..\/..\/public\/// bindata.go
@@ -14,3 +21,13 @@ type Options struct {
14
21
Directory string
15
22
SkipLogging bool
16
23
}
24
+
25
+ // Custom implements the macaron static handler for serving custom assets.
26
+ func Custom (opts * Options ) macaron.Handler {
27
+ return macaron .Static (
28
+ path .Join (setting .CustomPath , "public" ),
29
+ macaron.StaticOptions {
30
+ SkipLogging : opts .SkipLogging ,
31
+ },
32
+ )
33
+ }
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import (
12
12
"code.gitea.io/gitea/models"
13
13
"code.gitea.io/gitea/modules/cron"
14
14
"code.gitea.io/gitea/modules/highlight"
15
+ "code.gitea.io/gitea/modules/indexer"
15
16
"code.gitea.io/gitea/modules/log"
16
17
"code.gitea.io/gitea/modules/mailer"
17
18
"code.gitea.io/gitea/modules/markdown"
18
19
"code.gitea.io/gitea/modules/setting"
19
20
"code.gitea.io/gitea/modules/ssh"
20
21
macaron "gopkg.in/macaron.v1"
21
- "code.gitea.io/gitea/modules/indexer"
22
22
)
23
23
24
24
func checkRunMode () {
Original file line number Diff line number Diff line change @@ -70,4 +70,3 @@ func UploadAttachment(ctx *context.Context) {
70
70
"uuid" : attach .UUID ,
71
71
})
72
72
}
73
-
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ func NewRelease(ctx *context.Context) {
169
169
ctx .Data ["Title" ] = ctx .Tr ("repo.release.new_release" )
170
170
ctx .Data ["PageIsReleaseList" ] = true
171
171
ctx .Data ["tag_target" ] = ctx .Repo .Repository .DefaultBranch
172
- renderAttachmentSettings (ctx );
172
+ renderAttachmentSettings (ctx )
173
173
ctx .HTML (200 , tplReleaseNew )
174
174
}
175
175
@@ -250,7 +250,7 @@ func EditRelease(ctx *context.Context) {
250
250
ctx .Data ["Title" ] = ctx .Tr ("repo.release.edit_release" )
251
251
ctx .Data ["PageIsReleaseList" ] = true
252
252
ctx .Data ["PageIsEditRelease" ] = true
253
- renderAttachmentSettings (ctx );
253
+ renderAttachmentSettings (ctx )
254
254
255
255
tagName := ctx .Params ("*" )
256
256
rel , err := models .GetRelease (ctx .Repo .Repository .ID , tagName )
You can’t perform that action at this time.
0 commit comments