Browse Source

Fix repo css and rel path img in md

pull/563/merge
Unknwon 10 years ago
parent
commit
9ae92459a5
  1. 4
      .bra.toml
  2. 2
      .gopmfile
  3. 2
      gogs.go
  4. 8
      modules/base/markdown.go
  5. 19
      public/ng/css/gogs.css
  6. 88
      public/ng/less/gogs/repository.less
  7. 2
      templates/.VERSION
  8. 2
      templates/repo/diff.tmpl

4
.bra.toml

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

2
.gopmfile

@ -16,7 +16,7 @@ github.com/go-xorm/xorm = commit:2d8b3135b1
github.com/gogits/gfm = commit:40f747a9c0
github.com/gogits/oauth2 = commit:99cbec870a
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/csrf =
github.com/macaron-contrib/i18n = commit:2246f45894

2
gogs.go

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

8
modules/base/markdown.go

@ -91,6 +91,14 @@ func (options *CustomRender) Link(out *bytes.Buffer, link []byte, title []byte,
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 (
MentionPattern = regexp.MustCompile(`@[0-9a-zA-Z_]{1,}`)
commitPattern = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`)

19
public/ng/css/gogs.css

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

88
public/ng/less/gogs/repository.less

@ -3,8 +3,6 @@
@repoHeaderBgColor: #FFF;
@repoHeaderNameColor: #888;
/* repository main */
#repo-wrapper {
padding-bottom: 100px;
}
@ -30,7 +28,7 @@
#repo-header-meta {
line-height: 66px;
li {
> a {
>a {
padding: 0;
&:hover {
background-color: transparent;
@ -38,7 +36,7 @@
}
}
a {
& > .btn {
&>.btn {
line-height: 16px;
margin-left: 16px;
font-size: 13px;
@ -52,7 +50,7 @@
}
}
#repo-header-download-btn {
> .btn > i {
>.btn>i {
margin-right: 0 !important;
}
&:hover {
@ -80,11 +78,10 @@
padding: 20px;
box-sizing: border-box;
z-index: 1;
.btn > i {
.btn>i {
margin-right: 6px;
}
button,
input {
button, input {
font-size: 11px;
}
}
@ -143,7 +140,7 @@
padding-left: 12px;
width: 24px;
text-align: center;
> i.octicon {
>i.octicon {
font-size: 21px;
}
}
@ -165,12 +162,12 @@
}
#repo-file-nav {
padding: .6em 0 1em 0;
> li > a {
>li>a {
padding-left: 0;
&:hover {
background-color: transparent;
}
}
}
li.repo-jump > a {
padding-right: 0;
.btn {
@ -179,7 +176,7 @@
}
}
#repo-branch-switch {
> a {
>a {
.btn {
padding-right: 30px;
}
@ -189,10 +186,9 @@
right: 30px;
margin-left: 0;
color: @baseFontColor;
}
}
> .drop-down {
>.drop-down {
top: 40px;
left: 0;
}
@ -348,6 +344,7 @@
width: 520px;
}
}
/* repository create */
#team-create-form,
@ -595,32 +592,49 @@
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;
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 {
margin-top: 10px;
.compare {

2
templates/.VERSION

@ -1 +1 @@
0.5.5.1013 Beta
0.5.5.1014 Beta

2
templates/repo/diff.tmpl

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

Loading…
Cancel
Save