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. 854
      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"] 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"]
] ]

2
.gopmfile

@ -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

2
gogs.go

@ -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())

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) 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-]*)?`)

19
public/ng/css/gogs.css

@ -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;
} }

854
public/ng/less/gogs/repository.less

@ -3,493 +3,490 @@
@repoHeaderBgColor: #FFF; @repoHeaderBgColor: #FFF;
@repoHeaderNameColor: #888; @repoHeaderNameColor: #888;
/* repository main */
#repo-wrapper { #repo-wrapper {
padding-bottom: 100px; padding-bottom: 100px;
} }
#repo-header { #repo-header {
height: 69px; height: 69px;
border-bottom: 1px solid@repoHeaderBorderColor; border-bottom: 1px solid@repoHeaderBorderColor;
background-color: @repoHeaderBgColor; background-color: @repoHeaderBgColor;
} }
#repo-header-name { #repo-header-name {
line-height: 66px; line-height: 66px;
color: @repoHeaderNameColor; color: @repoHeaderNameColor;
font-size: 1.6em; font-size: 1.6em;
font-weight: normal; font-weight: normal;
margin-bottom: 0; margin-bottom: 0;
i { i {
margin-right: 12px; margin-right: 12px;
vertical-align: middle; vertical-align: middle;
} }
.divider { .divider {
margin: 0 4px; margin: 0 4px;
} }
} }
#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;
} }
} }
} }
a { a {
& > .btn { &>.btn {
line-height: 16px; line-height: 16px;
margin-left: 16px; margin-left: 16px;
font-size: 13px; font-size: 13px;
i { i {
margin-right: 6px; margin-right: 6px;
} }
.num { .num {
margin-left: 6px; margin-left: 6px;
} }
}
} }
}
} }
#repo-header-download-btn { #repo-header-download-btn {
> .btn > i { >.btn>i {
margin-right: 0 !important; margin-right: 0 !important;
} }
&:hover { &:hover {
&:after, .btn { &:after, .btn {
background-color: @btnHoverBlackColor; background-color: @btnHoverBlackColor;
color: #FFF; color: #FFF;
} }
} }
&:after { &:after {
background-color: @btnBlackColor; background-color: @btnBlackColor;
padding: 9px 16px 8px 0; padding: 9px 16px 8px 0;
margin-left: -8px !important; margin-left: -8px !important;
color: #FFF; color: #FFF;
border-top: 1px solid@btnBlackColor; border-top: 1px solid@btnBlackColor;
border-bottom: 1px solid@btnBlackColor; border-bottom: 1px solid@btnBlackColor;
border-top-right-radius: .25em; border-top-right-radius: .25em;
border-bottom-right-radius: .25em; border-bottom-right-radius: .25em;
} }
} }
#repo-header-download-drop { #repo-header-download-drop {
line-height: 24px; line-height: 24px;
width: 440px; width: 440px;
top: 50px; top: 50px;
left: -370px; left: -370px;
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; }
}
} }
#repo-content { #repo-content {
padding: 18px 0; padding: 18px 0;
} }
.repo-wide-wrapper { .repo-wide-wrapper {
padding: 18px 0; padding: 18px 0;
position: relative; position: relative;
} }
#repo-clone-url { #repo-clone-url {
border-right: none; border-right: none;
width: 190px; width: 190px;
border-left: none; border-left: none;
} }
#repo-clone-help { #repo-clone-help {
clear: both; clear: both;
line-height: 48px; line-height: 48px;
} }
#repo-clone-zip { #repo-clone-zip {
line-height: 48px; line-height: 48px;
a { a {
cursor: pointer; cursor: pointer;
color: white; color: white;
overflow: visible; overflow: visible;
padding: .6em 1.2em; padding: .6em 1.2em;
} }
.btn { .btn {
margin: 0 6px; margin: 0 6px;
} }
} }
#repo-desc { #repo-desc {
font-size: 1.2em; font-size: 1.2em;
.no-description{ .no-description{
color: #999; color: #999;
} }
} }
#repo-sidebar-nav { #repo-sidebar-nav {
.label { .label {
font-size: 12px; font-size: 12px;
line-height: 1.4em; line-height: 1.4em;
margin-top: 2px; margin-top: 2px;
} }
i { i {
margin-right: 6px; margin-right: 6px;
} }
} }
#repo-sidebar-mini { #repo-sidebar-mini {
margin-top: 6px; margin-top: 6px;
width: 60px; width: 60px;
li { li {
margin-bottom: 4px; margin-bottom: 4px;
} }
li > a { li > a {
position: relative; position: relative;
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;
} }
} }
.num { .num {
position: absolute; position: absolute;
font-size: 12px; font-size: 12px;
top: 0; top: 0;
left: 36px; left: 36px;
padding: 0 2px; padding: 0 2px;
min-width: 16px; min-width: 16px;
height: 16px; height: 16px;
text-align: center; text-align: center;
line-height: 16px; line-height: 16px;
border-radius: 4px; border-radius: 4px;
opacity: 0.7; opacity: 0.7;
-webkit-transform: scale(0.9); -webkit-transform: scale(0.9);
font-weight: bold; font-weight: bold;
} }
} }
#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 {
margin-left: -1px; margin-left: -1px;
}
} }
}
} }
#repo-branch-switch { #repo-branch-switch {
> a { >a {
.btn { .btn {
padding-right: 30px; padding-right: 30px;
}
&:after {
position: absolute;
top: 12px;
right: 30px;
margin-left: 0;
color: @baseFontColor;
}
} }
&:after { >.drop-down {
position: absolute; top: 40px;
top: 12px; left: 0;
right: 30px;
margin-left: 0;
color: @baseFontColor;
} }
}
> .drop-down {
top: 40px;
left: 0;
}
} }
#repo-branch-filter-ipt { #repo-branch-filter-ipt {
width: 100%; width: 100%;
border-left: none; border-left: none;
border-right: none; border-right: none;
box-sizing: border-box; box-sizing: border-box;
} }
#repo-branch-tag { #repo-branch-tag {
.tab-nav { .tab-nav {
border-bottom: 1px solid #EAEAEA; border-bottom: 1px solid #EAEAEA;
a { a {
padding: .3em .8em; padding: .3em .8em;
}
.js-tab-nav-show {
background-color: #EEE;
font-weight: bold;
}
} }
.js-tab-nav-show { .switching-list {
background-color: #EEE; max-height: 300px;
font-weight: bold; overflow-y: auto;
} }
}
.switching-list {
max-height: 300px;
overflow-y: auto;
}
} }
#repo-branch-list, #repo-branch-list,
#repo-tag-list { #repo-tag-list {
li { li {
i { i {
margin-right: 12px; margin-right: 12px;
opacity: 0; opacity: 0;
}
} }
} li.checked {
li.checked { i {
i { opacity: 1;
opacity: 1; }
} }
}
} }
#repo-bread { #repo-bread {
.bread { .bread {
padding-right: 0; padding-right: 0;
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
} }
#repo-main { #repo-main {
padding-right: 40px; padding-right: 40px;
box-sizing: border-box; box-sizing: border-box;
} }
#repo-files-table { #repo-files-table {
margin-bottom: 20px; margin-bottom: 20px;
th, td { th, td {
text-align: left; text-align: left;
line-height: 32px; line-height: 32px;
} }
td.icon { td.icon {
width: 16px; width: 16px;
padding-right: .1em; padding-right: .1em;
padding-left: 1em; padding-left: 1em;
} }
td.name { td.name {
max-width: 120px; max-width: 120px;
.text-truncate { .text-truncate {
max-width: 100%; max-width: 100%;
} }
}
td.age {
max-width: 120px;
text-align: right;
}
td.msg {
max-width: 440px;
.text-truncate {
max-width: 100%;
}
}
td.age,
td.size,
td.msg a {
color: #888;
}
td.msg a:hover {
color: #428BCA;
text-decoration: underline;
}
tbody {
background-color: #FFF;
tr:hover {
background-color: #ffffEE;
}
}
thead {
background-color: #F0F0F0;
.author {
a {
margin: 0 .4em;
}
} }
.last-commit { td.age {
strong { max-width: 120px;
color: #444; text-align: right;
}
.text-truncate {
margin-left: .4em;
}
} }
.last-commit .text-truncate, td.msg {
.age { max-width: 440px;
font-weight: normal; .text-truncate {
color: #888; max-width: 100%;
}
}
td.age,
td.size,
td.msg a {
color: #888;
}
td.msg a:hover {
color: #428BCA;
text-decoration: underline;
}
tbody {
background-color: #FFF;
tr:hover {
background-color: #ffffEE;
}
}
thead {
background-color: #F0F0F0;
.author {
a {
margin: 0 .4em;
}
}
.last-commit {
strong {
color: #444;
}
.text-truncate {
margin-left: .4em;
}
}
.last-commit .text-truncate,
.age {
font-weight: normal;
color: #888;
}
} }
}
} }
#repo-readme, #repo-readme,
#repo-read-file { #repo-read-file {
margin-bottom: 80px; margin-bottom: 80px;
} }
#repo-bare-start { #repo-bare-start {
margin-bottom: 100px; margin-bottom: 100px;
.panel-content { .panel-content {
background-color: #FFF; background-color: #FFF;
} }
pre { pre {
margin: 0 40px; margin: 0 40px;
padding: 6px 10px; padding: 6px 10px;
border: 1px solid #ddd; border: 1px solid #ddd;
background: #f8f8f8; background: #f8f8f8;
} }
} }
.repo-bare { .repo-bare {
#repo-bare-start { #repo-bare-start {
h2 { h2 {
margin-top: 30px; margin-top: 30px;
margin-bottom: 24px; margin-bottom: 24px;
} }
} }
#repo-header-meta { #repo-header-meta {
display: none; display: none;
} }
#repo-clone-ssh { #repo-clone-ssh {
margin-left: 200px; margin-left: 200px;
} }
#repo-clone-copy { #repo-clone-copy {
margin-right: 200px; margin-right: 200px;
} }
#repo-clone-help { #repo-clone-help {
clear: both; clear: both;
width: 100%; width: 100%;
} }
#repo-clone-url { #repo-clone-url {
width: 520px; width: 520px;
} }
} }
/* repository create */ /* repository create */
#team-create-form, #team-create-form,
#repo-migrate-form, #repo-migrate-form,
#repo-create-form { #repo-create-form {
width: 800px; width: 800px;
margin: 60px auto auto auto; margin: 60px auto auto auto;
background: white; background: white;
h2 { h2 {
margin: .5em 1em; margin: .5em 1em;
} }
.field { .field {
margin: 1.2em 0 2em 0; margin: 1.2em 0 2em 0;
} }
.ipt { .ipt {
width: 540px; width: 540px;
} }
textarea { textarea {
height: 120px; height: 120px;
} }
.avatar { .avatar {
vertical-align: middle; vertical-align: middle;
margin-right: .6em; margin-right: .6em;
width: 28px; width: 28px;
height: 28px; height: 28px;
} }
&:hover { &:hover {
box-shadow: 0px 0px 6px #CCC; box-shadow: 0px 0px 6px #CCC;
} }
} }
#repo-create-cancel { #repo-create-cancel {
margin-left: 4em; margin-left: 4em;
} }
#repo-create-owner-list { #repo-create-owner-list {
top: 30px; top: 30px;
left: 0; left: 0;
width: auto; width: auto;
max-width: 300px; max-width: 300px;
.octicon { .octicon {
margin-right: 12px; margin-right: 12px;
opacity: 0; opacity: 0;
}
.avatar {
width: 20px;
height: 20px;
}
li {
white-space: nowrap;
&.checked {
.octicon {
opacity: 1;
}
} }
a { .avatar {
text-overflow: ellipsis; width: 20px;
-o-text-overflow: ellipsis; height: 20px;
overflow: hidden; }
li {
white-space: nowrap;
&.checked {
.octicon {
opacity: 1;
}
}
a {
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
}
} }
}
} }
.file-name { .file-name {
margin-left: 1em; margin-left: 1em;
} }
.file-size { .file-size {
font-size: 13px; font-size: 13px;
color: #888; color: #888;
margin-left: 1em; margin-left: 1em;
} }
.code-view { .code-view {
overflow: auto; overflow: auto;
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
background: white; background: white;
.view-raw { .view-raw {
min-height: 40px; min-height: 40px;
text-align: center; text-align: center;
padding-top: 20px; padding-top: 20px;
.btn { .btn {
font-size: 1.05em; font-size: 1.05em;
line-height: 16px; line-height: 16px;
padding: 6px 8px; padding: 6px 8px;
}
} }
} table {
table { width: 100%;
width: 100%; td {
td { padding: 0;
padding: 0; }
} }
} .lines-num {
.lines-num { vertical-align: top;
vertical-align: top; text-align: right;
text-align: right; color: #999;
color: #999; background: #f5f5f5;
background: #f5f5f5; width: 1%;
width: 1%; span {
span { font-family: Monaco,Menlo,Consolas,"Courier New",monospace;
font-family: Monaco,Menlo,Consolas,"Courier New",monospace; line-height: 1.6;
line-height: 1.6; padding: 0 10px;
padding: 0 10px; cursor: pointer;
cursor: pointer; display: block;
display: block; }
} }
} .lines-code > pre {
.lines-code > pre { border: none;
border: none; border-left: 1px solid #ddd;
border-left: 1px solid #ddd; > ol.linenums > li {
> ol.linenums > li { padding: 0 10px;
padding: 0 10px; &.active {
&.active { background: #ffffdd;
background: #ffffdd; }
} }
} }
}
} }
.repo-setting-zone { .repo-setting-zone {
padding: 30px; padding: 30px;
} }
#team-repositories-list, #team-repositories-list,
#team-members-list, #team-members-list,
#repo-collab-list { #repo-collab-list {
list-style: none; list-style: none;
padding: 10px 0 5px 0; padding: 10px 0 5px 0;
li.collab { li.collab {
clear: both; clear: both;
height: 50px; height: 50px;
padding: 0 15px 0 15px; padding: 0 15px 0 15px;
} }
a.member { a.member {
color: #444; color: #444;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
&:hover { &:hover {
color: #4183C4; color: #4183C4;
}
}
.avatar {
margin-right: 1em;
width: 40px;
}
.remove-collab {
color: #DD4B39;
} }
}
.avatar {
margin-right: 1em;
width: 40px;
}
.remove-collab {
color: #DD4B39;
}
} }
.repo-user-list-block { .repo-user-list-block {
position: relative; position: relative;
@ -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 {
background-color: #FFF8D2 !important; .file-body.file-code {
border-color: #F0DB88 !important; .lines-num {
} text-align: right;
.diff-file-box .file-body.file-code .lines-num-old { color: #999;
border-right: 1px solid #DDD; background: #fafafa;
} width: 1%;
.file-content .file-body.file-code .lines-num { }
text-align: right; .lines-num-old {
color: #999; border-right: 1px solid #DDD;
background: #fafafa; }
width: 1%; }
} .code-diff {
.diff-file-box .code-diff tbody tr.tag-code td, .diff-file-box .code-diff tbody tr.tag-code pre { tbody {
background-color: #E0E0E0 !important; tr {
border-color: #ADADAD !important; &.tag-code {
} td, pre {
.diff-file-box .code-diff tbody tr.del-code td, .diff-file-box .code-diff tbody tr.del-code pre { background-color: #E0E0E0 !important;
background-color: #ffe2dd !important; border-color: #ADADAD !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 { &.del-code {
background-color: #d1ffd6 !important; td, pre {
border-color: #b4e2b4 !important; 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;
}
}
}
}
}
} }
.compare-head-box { .compare-head-box {
margin-top: 10px; margin-top: 10px;
.compare { .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> <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">

Loading…
Cancel
Save