You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/templates/repo/diff.tmpl

114 lines
5.2 KiB

11 years ago
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
<div id="body" class="container" data-page="repo">
<div id="source">
11 years ago
<div class="panel panel-info diff-box diff-head-box">
<div class="panel-heading">
<a class="pull-right btn btn-primary btn-sm" rel="nofollow" href="{{.SourcePath}}">Browse Source</a>
<h4>{{.Commit.Message}}</h4>
11 years ago
</div>
{{ $username := .Username }}
{{ $reponame := .Reponame }}
11 years ago
<div class="panel-body">
<span class="pull-right">
<ul class="list-unstyled">
{{range .Parents}}
<li>parent <a href="/{{$username}}/{{$reponame}}/commit/{{.}}"><span class="label label-default sha">{{ShortSha .}}</span></a></li>
{{end}}
<li>commit <span class="label label-default sha">{{ShortSha .CommitId}}</span></li>
</ul>
11 years ago
</span>
<p class="author">
<img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
<a class="name" href="/user/email2user?email={{.Commit.Author.Email}}"><strong>{{.Commit.Author.Name}}</strong></a>
<span class="time">{{TimeSince .Commit.Author.When}}</span>
11 years ago
</p>
</div>
</div>
11 years ago
{{if .DiffNotAvailable}}
<h4>Diff Data Not Available.</h4>
{{else}}
11 years ago
<div class="diff-detail-box diff-box">
<a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
11 years ago
<p class="showing">
<i class="fa fa-retweet"></i>
<strong> {{.Diff.NumFiles}} changed files</strong> with <strong>{{.Diff.TotalAddition}} additions</strong> and <strong>{{.Diff.TotalDeletion}} deletions</strong>.
11 years ago
</p>
<ol class="detail-files collapse" id="diff-files">
{{range .Diff.Files}}
11 years ago
<li>
<div class="diff-counter count pull-right">
{{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
11 years ago
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
{{else}}
<span>BIN</span>
{{end}}
11 years ago
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
11 years ago
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}">&nbsp;</span>
<a class="file" href="#diff-1">{{.Name}}</a>
11 years ago
</li>
{{end}}
11 years ago
</ol>
</div>
{{range .Diff.Files}}
11 years ago
<div class="panel panel-default diff-file-box diff-box file-content" id="diff-2">
<div class="panel-heading">
<div class="diff-counter count pull-left">
{{if not .IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
11 years ago
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
{{else}}
BIN
{{end}}
11 years ago
</div>
<a class="btn btn-default btn-sm pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">View File</a>
<span class="file">{{.Name}}</span>
11 years ago
</div>
{{$isImage := (call $.IsImageFile .Name)}}
11 years ago
<div class="panel-body file-body file-code code-view code-diff">
{{if $isImage}}
<div class="text-center">
<img src="{{$.RawPath}}/{{.Name}}">
</div>
{{else}}
11 years ago
<table>
<tbody>
11 years ago
{{range .Sections}}
{{range .Lines}}
<tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
<td class="lines-num lines-num-old">
<span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
<span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
11 years ago
<pre>{{.Content}}</pre>
</td>
</tr>
{{end}}
11 years ago
{{end}}
11 years ago
</tbody>
</table>
{{end}}
11 years ago
</div>
</div>
{{end}}
11 years ago
{{end}}
11 years ago
</div>
</div>
{{template "base/footer" .}}