github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/template/pages/repo_commit.html (about) 1 {{ define "title" }}{{.Repo.Slug}} ยท {{ .Commit.HashShort }}{{ end }} 2 3 {{ define "content" }} 4 5 <div class="subhead"> 6 <div class="container"> 7 <ul class="nav nav-tabs pull-right"> 8 <li class="active"><a href="/{{.Repo.Slug}}/commit/{{ .Commit.Hash }}?branch={{ .Commit.Branch }}">{{ .Commit.HashShort }}</a></li> 9 <li><a href="/{{.Repo.Slug}}">Commits</a></li> 10 <li><a href="/{{.Repo.Slug}}/settings">Settings</a></li> 11 </ul> <!-- ./nav --> 12 <h1> 13 <span>{{.Repo.Name}}</span> 14 <small>{{.Repo.Owner}}</small> 15 </h1> 16 </div><!-- ./container --> 17 </div><!-- ./subhead --> 18 19 <div class="container"> 20 <div class="alert alert-build-{{ .Build.Status }}"> 21 <a href="/{{.Repo.Slug}}/commit/{{ .Commit.Hash }}?branch={{ .Commit.Branch }}" class="btn btn-{{ .Build.Status }}"></a> 22 {{ if .Commit.PullRequest }} 23 <span>opened pull request <span># {{ .Commit.PullRequest }}</span></span> 24 {{ else }} 25 <span>commit <span>{{ .Commit.HashShort }}</span> to <span>{{.Commit.Branch}}</span> branch</span> 26 {{ end }} 27 </div> 28 <div class="build-details container affix-top" data-spy="affix" data-offset-top="248"> 29 <div class="build-summary"> 30 <dt>Status</dt> 31 <dd>{{.Build.Status}}</dd> 32 <dt>Started</dt> 33 <dd><span class="timeago" title="{{ .Build.StartedString }}"></span></dd> 34 <dt>Duration</dt> 35 <dd>{{ if .Build.IsRunning }}--{{else}}{{ .Build.HumanDuration }}{{end}}</dd> 36 </div> 37 <img src="{{.Commit.Image}}"> 38 <div class="commit-summary"> 39 <dt>Commit</dt> 40 <dd><u>{{ .Commit.HashShort }}</u></dd> 41 <dt>Committer</dt> 42 <dd>{{ .Commit.Author }}</dd> 43 <dt>Message</dt> 44 <dd>{{ .Commit.Message }}</dd> 45 </div> 46 </div> 47 <pre id="stdout"></pre> 48 <span id="follow">Follow</span> 49 </div><!-- ./container --> 50 {{ end }} 51 52 {{ define "script" }} 53 <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.1.0/jquery.timeago.js"></script> 54 <script> 55 $(document).ready(function() { 56 $(".timeago").timeago(); 57 }); 58 </script> 59 60 <script> 61 {{ if .Build.IsRunning }} 62 $(document).ready(function() { 63 var commitUpdates = new Drone.CommitUpdates('/feed?token='+{{ .Token }}); 64 var outputBox = document.getElementById('stdout'); 65 commitUpdates.startOutput(outputBox); 66 67 $("#follow").on("click", function(e) { 68 e.preventDefault(); 69 70 if(commitUpdates.autoFollow) { 71 commitUpdates.autoFollow = false; 72 $(this).text("Follow"); 73 } else { 74 commitUpdates.autoFollow = true; 75 $(this).text("Stop following"); 76 } 77 }); 78 }); 79 80 {{ else }} 81 $.get("/{{ .Repo.Slug }}/commit/{{ .Commit.Hash }}/build/{{ .Build.Slug }}/out.txt?branch={{ .Commit.Branch }}", function( data ) { 82 var lineFormatter = new Drone.LineFormatter(); 83 $( "#stdout" ).html(lineFormatter.format(data)); 84 }); 85 {{ end }} 86 </script> 87 {{ end }}