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