From 6437d0180b97a26319b50c2e22927dac7c94fcdd Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sun, 8 Mar 2020 19:09:31 +0800 Subject: git: migrate to github.com/gogs/git-module@v1.0.0 (#5958) * WIP * Finish `internal/db/git_diff.go` * FInish internal/db/mirror.go * Finish internal/db/pull.go * Finish internal/db/release.go * Finish internal/db/repo.go * Finish internal/db/repo_branch.go * Finish internal/db/repo_editor.go * Finish internal/db/update.go * Save my work * Add license header * Compile! * Merge master * Finish internal/cmd/hook.go * Finish internal/conf/static.go * Finish internal/context/repo.go * Finish internal/db/action.go * Finish internal/db/git_diff.go * Fix submodule URL inferring * Finish internal/db/mirror.go * Updat to beta.4 * css: update fonts * Finish internal/db/pull.go * Finish internal/db/release.go * Finish internal/db/repo_branch.go * Finish internal/db/wiki.go * gitutil: enhance infer submodule UR * Finish internal/route/api/v1/repo/commits.go * mirror: only collect branch commits after sync * mirror: fix tag support * Finish internal/db/repo.go * Finish internal/db/repo_editor.go * Finish internal/db/update.go * Finish internal/gitutil/pull_request.go * Make it compile * Finish internal/route/repo/setting.go * Finish internal/route/repo/branch.go * Finish internal/route/api/v1/repo/file.go * Finish internal/route/repo/download.go * Finish internal/route/repo/editor.go * Use helper * Finish internal/route/repo/issue.go * Finish internal/route/repo/pull.go * Finish internal/route/repo/release.go * Finish internal/route/repo/repo.go * Finish internal/route/repo/wiki.go * Finish internal/route/repo/commit.go * Finish internal/route/repo/view.go * Finish internal/gitutil/tag.go * go.sum --- templates/repo/diff/box.tmpl | 34 ++++++++++++++++---------------- templates/repo/diff/section_unified.tmpl | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index eaa2882e..297c84f1 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -4,7 +4,7 @@
- {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2HTML}} + {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAdditions .Diff.TotalDeletions | Str2HTML}}
{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}} {{.i18n.Tr "repo.diff.show_diff_stats"}} @@ -14,19 +14,19 @@ {{range .Diff.Files}}
  • - {{if not .IsBin}} - {{.Addition}} + {{if not .IsBinary}} + {{.NumAdditions}} - {{.Deletion}} + {{.NumDeletions}} {{else}} {{$.i18n.Tr "repo.diff.bin"}} {{end}}
    -   +   {{.Name}}
  • {{end}} @@ -40,12 +40,12 @@ {{$.i18n.Tr "repo.diff.file_suppressed"}}
    {{if not $file.IsRenamed}} - + {{.Addition}} + + {{.NumAdditions}} - - {{.Deletion}} + - {{.NumDeletions}} {{end}}
    {{$file.Name}} @@ -55,15 +55,15 @@

    - {{if $file.IsBin}} + {{if $file.IsBinary}} {{$.i18n.Tr "repo.diff.bin"}} {{else if not $file.IsRenamed}} - + {{.Addition}} + + {{.NumAdditions}} - - {{.Deletion}} + - {{.NumDeletions}} {{end}}
    {{if $file.IsRenamed}}{{$file.OldName}} → {{end}}{{$file.Name}} @@ -80,7 +80,7 @@
    {{if not $file.IsRenamed}} {{$isImage := (call $.IsImageFile $file.Name)}} - {{if and $isImage}} + {{if $isImage}}
    @@ -92,22 +92,22 @@ {{$highlightClass := $file.HighlightClass}} {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} - - {{if eq .GetType 4}} + + {{if eq .Type 4}}
    {{$section.ComputedInlineDiffFor $line}}
    {{else}} - + -
    {{if $line.LeftIdx}}{{$section.ComputedInlineDiffFor $line}}{{end}}
    +
    {{if $line.LeftLine}}{{$section.ComputedInlineDiffFor $line}}{{end}}
    - + -
    {{if $line.RightIdx}}{{$section.ComputedInlineDiffFor $line}}{{end}}
    +
    {{if $line.RightLine}}{{$section.ComputedInlineDiffFor $line}}{{end}}
    {{end}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index d85ea49d..9954a4ec 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -2,18 +2,18 @@ {{$highlightClass := $file.HighlightClass}} {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} - - {{if eq .GetType 4}} + + {{if eq .Type 4}} {{/* {{if gt $j 0}}{{end}} */}} {{else}} - - + + {{end}}
    {{$section.ComputedInlineDiffFor $line}}
    {{end}} -{{end}} \ No newline at end of file +{{end}} -- cgit v1.2.3