@(pageName: Option[String], commits: List[util.JGitUtil.CommitInfo], repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context) @import view.helpers @import context._ @html.main("History - " + repository.owner + "/" + repository.name){ @html.header("wiki", repository) @wikitab(if(pageName.isEmpty) "history" else "", repository) <ul class="nav nav-tabs"> <li> <h1 class="wiki-title"> @if(pageName.isEmpty){ <span class="description">History</span> } else { <span class="description">History for</span> @pageName.get } </h1> </li> <li class="pull-right"> <div class="btn-group"> @if(pageName.isEmpty){ <a class="btn" href="@path/@repository.owner/@repository.name/wiki/_new">New Page</a> } else { <a class="btn" href="@path/@repository.owner/@repository.name/wiki/@pageName">View Page</a> <a class="btn" href="@path/@repository.owner/@repository.name/wiki/@pageName/_edit">Edit Page</a> } </div> </li> </ul> <table class="table table-bordered"> @commits.map { commit => <tr> <td width="0%"><input type="checkbox" name="commitId" value="@commit.id"></td> <td><a href="@path/@commit.committer">@commit.committer</a></td> <td width="80%"> <span class="description">@helpers.datetime(commit.time):</span> @commit.message </td> </tr> } </table> <input type="button" id="compare" value="Compare Revisions" class="btn"/> <input type="button" id="top" value="Back to Top" class="btn"/> <script> $(function(){ $('input[name=commitId]').click(function(){ return !($('input[name=commitId]:checked').length == 3); }); $('#compare').click(function(){ var e = $('input[name=commitId]:checked'); if(e.length == 2){ @if(pageName.isEmpty){ location.href = '@path/@repository.owner/@repository.name/wiki/_compare/' + $(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value'); } else { location.href = '@path/@repository.owner/@repository.name/wiki/@pageName.get/_compare/' + $(e.get(1)).attr('value') + '...' + $(e.get(0)).attr('value'); } } }); $('#top').click(function(){ $('html,body').animate({ scrollTop: 0 }, 'fast'); }); }); </script> }