2014-03-24 17:27:19 +04:00
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
2014-03-25 14:44:37 +04:00
<div id="body" class="container" data-page="repo">
<div id="source">
2014-03-24 17:27:19 +04:00
<div class="panel panel-info diff-box diff-head-box">
<div class="panel-heading">
2014-03-27 20:07:22 +04:00
<a class="pull-right btn btn-primary btn-sm" href="{{.SourcePath}}">Browse Source</a>
2014-03-26 07:53:01 +04:00
<h4>{{.Commit.Message}}</h4>
2014-03-24 17:27:19 +04:00
</div>
<div class="panel-body">
<span class="pull-right">
2014-03-30 06:13:02 +04:00
commit <span class="label label-default sha">{{ShortSha .CommitId}}</span>
2014-03-24 17:27:19 +04:00
</span>
<p class="author">
2014-03-26 07:53:01 +04:00
<img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
<a class="name" href=" #"><strong>{{.Commit.Author.Name}}</strong></a>
<span class="time">{{TimeSince .Commit.Author.When}}</span>
2014-03-24 17:27:19 +04:00
</p>
</div>
</div>
<div class="diff-detail-box diff-box">
2014-03-26 07:53:01 +04:00
<a class="pull-right btn btn-default" data-toggle="collapse" data-target=" #diff - files " >Show Diff Stats</a>
2014-03-24 17:27:19 +04:00
<p class="showing">
<i class="fa fa-retweet"></i>
2014-03-26 07:53:01 +04:00
<strong> {{.Diff.NumFiles}} changed files</strong> with <strong>{{.Diff.TotalAddition}} additions</strong> and <strong>{{.Diff.TotalDeletion}} deletions</strong>.
2014-03-24 17:27:19 +04:00
</p>
<ol class="detail-files collapse" id="diff-files">
2014-03-26 07:53:01 +04:00
{{range .Diff.Files}}
2014-03-24 17:27:19 +04:00
<li>
<div class="diff-counter count pull-right">
2014-04-11 20:14:11 +04:00
{{if Add .Addition .Deletion}}
2014-03-26 07:53:01 +04:00
<span class="add" data-line="{{.Addition}}">{{.Addition}}</span>
2014-03-24 17:27:19 +04:00
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
2014-03-26 07:53:01 +04:00
<span class="del" data-line="{{.Deletion}}">{{.Deletion}}</span>
2014-04-11 06:03:31 +04:00
{{else}}
<span>BIN</span>
{{end}}
2014-03-24 17:27:19 +04:00
</div>
<!-- todo finish all file status, now modify, add, delete and rename -->
2014-03-26 15:24:20 +04:00
<span class="status {{DiffTypeToStr .Type}}" data-toggle="tooltip" data-placement="right" title="{{DiffTypeToStr .Type}}"> </span>
2014-03-26 07:53:01 +04:00
<a class="file" href=" #diff - 1 " > {{ .Name}}</a>
2014-03-24 17:27:19 +04:00
</li>
2014-03-26 07:53:01 +04:00
{{end}}
2014-03-24 17:27:19 +04:00
</ol>
</div>
2014-03-26 07:53:01 +04:00
{{range .Diff.Files}}
2014-03-24 17:27:19 +04:00
<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">
2014-04-11 20:14:11 +04:00
{{if Add .Addition .Deletion}}
2014-03-26 07:53:01 +04:00
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
2014-03-24 17:27:19 +04:00
<span class="bar">
<span class="pull-left add"></span>
<span class="pull-left del"></span>
</span>
2014-03-26 07:53:01 +04:00
<span class="del" data-line="{{.Deletion}}">- {{.Deletion}}</span>
2014-04-11 06:03:31 +04:00
{{else}}
BIN
{{end}}
2014-03-24 17:27:19 +04:00
</div>
2014-03-27 20:07:22 +04:00
<a class="btn btn-default btn-sm pull-right" href="{{$.SourcePath}}/{{.Name}}">View File</a>
2014-03-26 07:53:01 +04:00
<span class="file">{{.Name}}</span>
2014-03-24 17:27:19 +04:00
</div>
2014-03-27 21:17:09 +04:00
{{ $ isImage := (call $.IsImageFile .Name)}}
2014-03-24 17:27:19 +04:00
<div class="panel-body file-body file-code code-view code-diff">
2014-03-27 21:17:09 +04:00
{{if $ isImage }}
<div class="text-center">
<img src="{{$.RawPath}}/{{.Name}}">
</div>
{{else}}
2014-03-24 17:27:19 +04:00
<table>
<tbody>
2014-03-26 14:02:08 +04:00
{{range .Sections}}
{{range .Lines}}
2014-03-27 00:41:16 +04:00
<tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
2014-03-26 07:53:01 +04:00
<td class="lines-num lines-num-old">
2014-03-27 00:41:16 +04:00
<span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
2014-03-26 07:53:01 +04:00
</td>
<td class="lines-num lines-num-new">
2014-03-27 00:41:16 +04:00
<span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
2014-03-26 07:53:01 +04:00
</td>
<td class="lines-code">
2014-03-26 14:02:08 +04:00
<pre>{{.Content}}</pre>
2014-03-26 07:53:01 +04:00
</td>
</tr>
{{end}}
2014-03-26 14:02:08 +04:00
{{end}}
2014-03-24 17:27:19 +04:00
</tbody>
</table>
2014-03-27 21:17:09 +04:00
{{end}}
2014-03-24 17:27:19 +04:00
</div>
</div>
2014-03-26 07:53:01 +04:00
{{end}}
2014-03-24 17:27:19 +04:00
</div>
</div>
2014-03-27 20:07:22 +04:00
{{template "base/footer" .}}