Fix repo css and rel path img in md

This commit is contained in:
Unknwon 2014-10-14 23:44:34 -04:00
parent 5b3f1efd9f
commit 9ae92459a5
8 changed files with 474 additions and 453 deletions

View file

@ -14,7 +14,7 @@ watch_dirs = [
watch_exts = [".go", ".ini"] watch_exts = [".go", ".ini"]
build_delay = 1500 build_delay = 1500
cmds = [ cmds = [
["go", "install", "-tags", "sqlite cert"], ["go", "install", "-tags", "sqlite redis cert"],
["go", "build", "-tags", "sqlite cert"], ["go", "build", "-tags", "sqlite redis cert"],
["./gogs", "web"] ["./gogs", "web"]
] ]

View file

@ -16,7 +16,7 @@ github.com/go-xorm/xorm = commit:2d8b3135b1
github.com/gogits/gfm = commit:40f747a9c0 github.com/gogits/gfm = commit:40f747a9c0
github.com/gogits/oauth2 = commit:99cbec870a github.com/gogits/oauth2 = commit:99cbec870a
github.com/lib/pq = commit:b021d0ef20 github.com/lib/pq = commit:b021d0ef20
github.com/macaron-contrib/cache = commit:204d8e5137 github.com/macaron-contrib/cache =
github.com/macaron-contrib/captcha = commit:d37d37eeea github.com/macaron-contrib/captcha = commit:d37d37eeea
github.com/macaron-contrib/csrf = github.com/macaron-contrib/csrf =
github.com/macaron-contrib/i18n = commit:2246f45894 github.com/macaron-contrib/i18n = commit:2246f45894

View file

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.5.5.1013 Beta" const APP_VER = "0.5.5.1014 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View file

@ -91,6 +91,14 @@ func (options *CustomRender) Link(out *bytes.Buffer, link []byte, title []byte,
options.Renderer.Link(out, link, title, content) options.Renderer.Link(out, link, title, content)
} }
func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
if len(link) > 0 && !isLink(link) {
link = []byte(path.Join(strings.Replace(options.urlPrefix, "/src/", "/raw/", 1), string(link)))
}
options.Renderer.Image(out, link, title, alt)
}
var ( var (
MentionPattern = regexp.MustCompile(`@[0-9a-zA-Z_]{1,}`) MentionPattern = regexp.MustCompile(`@[0-9a-zA-Z_]{1,}`)
commitPattern = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`) commitPattern = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`)

View file

@ -980,7 +980,6 @@ The register and sign-in page style
background-color: #FFF; background-color: #FFF;
margin-left: -15px; margin-left: -15px;
} }
/* repository main */
#repo-wrapper { #repo-wrapper {
padding-bottom: 100px; padding-bottom: 100px;
} }
@ -1554,20 +1553,15 @@ The register and sign-in page style
.diff-box .panel-header { .diff-box .panel-header {
font-size: 14px; font-size: 14px;
} }
.diff-file-box .code-diff tbody tr:hover td, .diff-file-box .file-body.file-code .lines-num {
.diff-file-box .code-diff tbody tr:hover pre {
background-color: #FFF8D2 !important;
border-color: #F0DB88 !important;
}
.diff-file-box .file-body.file-code .lines-num-old {
border-right: 1px solid #DDD;
}
.file-content .file-body.file-code .lines-num {
text-align: right; text-align: right;
color: #999; color: #999;
background: #fafafa; background: #fafafa;
width: 1%; width: 1%;
} }
.diff-file-box .file-body.file-code .lines-num-old {
border-right: 1px solid #DDD;
}
.diff-file-box .code-diff tbody tr.tag-code td, .diff-file-box .code-diff tbody tr.tag-code td,
.diff-file-box .code-diff tbody tr.tag-code pre { .diff-file-box .code-diff tbody tr.tag-code pre {
background-color: #E0E0E0 !important; background-color: #E0E0E0 !important;
@ -1583,6 +1577,11 @@ The register and sign-in page style
background-color: #d1ffd6 !important; background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important; border-color: #b4e2b4 !important;
} }
.diff-file-box .code-diff tbody tr:hover td,
.diff-file-box .code-diff tbody tr:hover pre {
background-color: #FFF8D2 !important;
border-color: #F0DB88 !important;
}
.compare-head-box { .compare-head-box {
margin-top: 10px; margin-top: 10px;
} }

View file

@ -3,8 +3,6 @@
@repoHeaderBgColor: #FFF; @repoHeaderBgColor: #FFF;
@repoHeaderNameColor: #888; @repoHeaderNameColor: #888;
/* repository main */
#repo-wrapper { #repo-wrapper {
padding-bottom: 100px; padding-bottom: 100px;
} }
@ -30,7 +28,7 @@
#repo-header-meta { #repo-header-meta {
line-height: 66px; line-height: 66px;
li { li {
> a { >a {
padding: 0; padding: 0;
&:hover { &:hover {
background-color: transparent; background-color: transparent;
@ -38,7 +36,7 @@
} }
} }
a { a {
& > .btn { &>.btn {
line-height: 16px; line-height: 16px;
margin-left: 16px; margin-left: 16px;
font-size: 13px; font-size: 13px;
@ -52,7 +50,7 @@
} }
} }
#repo-header-download-btn { #repo-header-download-btn {
> .btn > i { >.btn>i {
margin-right: 0 !important; margin-right: 0 !important;
} }
&:hover { &:hover {
@ -80,11 +78,10 @@
padding: 20px; padding: 20px;
box-sizing: border-box; box-sizing: border-box;
z-index: 1; z-index: 1;
.btn > i { .btn>i {
margin-right: 6px; margin-right: 6px;
} }
button, button, input {
input {
font-size: 11px; font-size: 11px;
} }
} }
@ -143,7 +140,7 @@
padding-left: 12px; padding-left: 12px;
width: 24px; width: 24px;
text-align: center; text-align: center;
> i.octicon { >i.octicon {
font-size: 21px; font-size: 21px;
} }
} }
@ -165,12 +162,12 @@
} }
#repo-file-nav { #repo-file-nav {
padding: .6em 0 1em 0; padding: .6em 0 1em 0;
> li > a { >li>a {
padding-left: 0; padding-left: 0;
&:hover { &:hover {
background-color: transparent; background-color: transparent;
} }
} }
li.repo-jump > a { li.repo-jump > a {
padding-right: 0; padding-right: 0;
.btn { .btn {
@ -179,7 +176,7 @@
} }
} }
#repo-branch-switch { #repo-branch-switch {
> a { >a {
.btn { .btn {
padding-right: 30px; padding-right: 30px;
} }
@ -189,10 +186,9 @@
right: 30px; right: 30px;
margin-left: 0; margin-left: 0;
color: @baseFontColor; color: @baseFontColor;
} }
} }
> .drop-down { >.drop-down {
top: 40px; top: 40px;
left: 0; left: 0;
} }
@ -348,6 +344,7 @@
width: 520px; width: 520px;
} }
} }
/* repository create */ /* repository create */
#team-create-form, #team-create-form,
@ -595,32 +592,49 @@
font-size: 14px; font-size: 14px;
} }
} }
.diff-file-box .code-diff tbody tr:hover td, .diff-file-box .code-diff tbody tr:hover pre { .diff-file-box {
.file-body.file-code {
.lines-num {
text-align: right;
color: #999;
background: #fafafa;
width: 1%;
}
.lines-num-old {
border-right: 1px solid #DDD;
}
}
.code-diff {
tbody {
tr {
&.tag-code {
td, pre {
background-color: #E0E0E0 !important;
border-color: #ADADAD !important;
}
}
&.del-code {
td, pre {
background-color: #ffe2dd !important;
border-color: #e9aeae !important;
}
}
&.add-code {
td, pre {
background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important;
}
}
&:hover {
td, pre {
background-color: #FFF8D2 !important; background-color: #FFF8D2 !important;
border-color: #F0DB88 !important; border-color: #F0DB88 !important;
}
}
}
}
}
} }
.diff-file-box .file-body.file-code .lines-num-old {
border-right: 1px solid #DDD;
}
.file-content .file-body.file-code .lines-num {
text-align: right;
color: #999;
background: #fafafa;
width: 1%;
}
.diff-file-box .code-diff tbody tr.tag-code td, .diff-file-box .code-diff tbody tr.tag-code pre {
background-color: #E0E0E0 !important;
border-color: #ADADAD !important;
}
.diff-file-box .code-diff tbody tr.del-code td, .diff-file-box .code-diff tbody tr.del-code pre {
background-color: #ffe2dd !important;
border-color: #e9aeae !important;
}
.diff-file-box .code-diff tbody tr.add-code td, .diff-file-box .code-diff tbody tr.add-code pre {
background-color: #d1ffd6 !important;
border-color: #b4e2b4 !important;
}
.compare-head-box { .compare-head-box {
margin-top: 10px; margin-top: 10px;
.compare { .compare {

View file

@ -1 +1 @@
0.5.5.1013 Beta 0.5.5.1014 Beta

View file

@ -50,7 +50,7 @@
<i class="fa fa-retweet"></i> <i class="fa fa-retweet"></i>
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
</p> </p>
<ol class="detail-files collapse" id="diff-files"> <ol class="detail-files collapse hide" id="diff-files">
{{range .Diff.Files}} {{range .Diff.Files}}
<li> <li>
<div class="diff-counter count pull-right"> <div class="diff-counter count pull-right">