diff --git a/public/css/gogs.css b/public/css/gogs.css
index ff1aaba7e..739ecad3a 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -724,6 +724,11 @@ img {
}
pre {
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
+ white-space: pre-wrap; /* CSS 3 */
+ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
}
pre.raw {
padding: 7px 12px;
@@ -2343,6 +2348,13 @@ footer .container .links > *:first-child {
border-right: 1px solid #d4d4d5;
padding: 0 5px;
}
+.repository .diff-file-box .code-diff tbody tr.tag-code td {
+ width: 50%;
+}
+.repository .diff-file-box .code-diff tbody tr.tag-code td.lines-num span.fold {
+ display: block;
+ text-align: center;
+}
.repository .diff-file-box .code-diff tbody tr.tag-code td,
.repository .diff-file-box .code-diff tbody tr.tag-code pre {
background-color: #F0F0F0 !important;
@@ -2350,11 +2362,17 @@ footer .container .links > *:first-child {
padding-top: 4px;
padding-bottom: 4px;
}
+.repository .diff-file-box .code-diff tbody tr.del-code td {
+ width: 50%;
+}
.repository .diff-file-box .code-diff tbody tr.del-code td,
.repository .diff-file-box .code-diff tbody tr.del-code pre {
background-color: #ffecec !important;
border-color: #f1c0c0 !important;
}
+.repository .diff-file-box .code-diff tbody tr.add-code td {
+ width: 50%;
+}
.repository .diff-file-box .code-diff tbody tr.add-code td,
.repository .diff-file-box .code-diff tbody tr.add-code pre {
background-color: #eaffea !important;
diff --git a/templates/repo/diff_box.tmpl b/templates/repo/diff_box.tmpl
index 036d4a649..bfcad4a1b 100644
--- a/templates/repo/diff_box.tmpl
+++ b/templates/repo/diff_box.tmpl
@@ -6,7 +6,11 @@
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
-
-
- {{if not $file.IsRenamed}}
- {{$isImage := (call $.IsImageFile $file.Name)}}
- {{if and $isImage}}
-
-
![]({{$.RawPath}}/{{EscapePound .Name}})
-
- {{else}}
-
-
-
- {{range .Sections}}
- {{range $k, $line := .Lines}}
-
-
- {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}
- |
-
- {{if $line.RightIdx}}{{$line.RightIdx}}{{end}}
- |
-
- {{$line.Content}}
- |
-
- {{end}}
- {{end}}
-
-
-
- {{end}}
- {{end}}
-
-
-
+ {{ template "repo/diff_box_unified.tmpl" . }}
+
+
+ {{ template "repo/diff_box_inline.tmpl" . }}
+
{{end}}
diff --git a/templates/repo/diff_box_inline.tmpl b/templates/repo/diff_box_inline.tmpl
new file mode 100644
index 000000000..2dea01383
--- /dev/null
+++ b/templates/repo/diff_box_inline.tmpl
@@ -0,0 +1,74 @@
+{{range $i, $file := .Diff.Files}}
+
+
+
+ {{if not $file.IsRenamed}}
+ {{$isImage := (call $.IsImageFile $file.Name)}}
+ {{if and $isImage}}
+
+
![]({{$.RawPath}}/{{EscapePound .Name}})
+
+ {{else}}
+
+
+
+ {{range $j, $section := .Sections}}
+ {{range $k, $line := .Lines}}
+
+ {{if eq .Type 4}}
+
+ {{if gt $j 0}}{{end}}
+ |
+ {{else}}
+
+ {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}
+ |
+
+ {{if $line.RightIdx}}{{$line.RightIdx}}{{end}}
+ |
+ {{end}}
+
+ {{$line.Content}}
+ |
+
+ {{end}}
+ {{end}}
+
+
+
+
+ {{end}}
+ {{end}}
+
+
+
+
+
+ {{if not $file.IsRenamed}}
+ {{$isImage := (call $.IsImageFile $file.Name)}}
+ {{if and $isImage}}
+
+
![]({{$.RawPath}}/{{EscapePound .Name}})
+
+ {{else}}
+
+
+
+ {{range $j, $section := .Sections}}
+ {{range $k, $line := .Lines}}
+
+ {{if eq .Type 4}}
+
+
+ |
+
+ {{$line.Content}}
+ |
+
+
+ |
+
+ {{$line.Content}}
+ |
+ {{else}}
+
+ {{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}
+ |
+
+ {{if $line.LeftIdx}}{{$line.Content}}{{end}}
+ |
+
+ {{if $line.RightIdx}}{{$line.RightIdx}}{{end}}
+ |
+
+ {{if $line.RightIdx}}{{$line.Content}}{{end}}
+ |
+ {{end}}
+
+ {{end}}
+ {{end}}
+
+
+
+
+ {{end}}
+ {{end}}
+
+
+