@(active: String, repository: gitbucket.core.service.RepositoryService.RepositoryInfo, id: Option[String] = None, expand: Boolean = false, isNoGroup: Boolean = true, info: Option[Any] = None, error: Option[Any] = None)(body: Html)(implicit context: gitbucket.core.controller.Context) @import context._ @import gitbucket.core.view.helpers._ @import gitbucket.core.service.RepositoryService._ @sidemenu(path: String, name: String, icon: String, label: String, count: Int = 0) = { <li @if(active == name){class="active"}> <a href="@url(repository)@path"> <i class="menu-icon @if(active == name){menu-icon-active} octicon octicon-@{icon} "></i> @label @if(count > 0){ <span class="badge">@count</span> } </a> </li> } <div class="headbar"> <div class="container"> @helper.html.information(info) @helper.html.error(error) <div class="head"> @if(repository.commitCount > 0){ <div class="input-group pull-right"> <span class="fork"> <span class="input-group-btn"> @if(loginAccount.isEmpty){ <a title="You must be signed in to fork a repository" href="@path/signin?redirect=@urlEncode(s"${path}/${repository.owner}/${repository.name}")" class="btn btn-default">Fork</a> } else { @if(isNoGroup) { <a id="fork-link" href="javascript:void(0);" class="btn btn-default">Fork</a> } else { <a href="@path/@repository.owner/@repository.name/fork" class="btn btn-default" rel="facebox">Fork</a> } } </span> <span class="count"><a href="@url(repository)/network/members">@repository.forkedCount</a></span> </span> </div> @if(loginAccount.isDefined && isNoGroup){ <form id="fork-form" method="post" action="@path/@repository.owner/@repository.name/fork" style="display: none;"> <input type="hidden" name="account" value="@loginAccount.get.userName"/> </form> } } @helper.html.repositoryicon(repository, true) <a href="@url(repository.owner)">@repository.owner</a> / <a href="@url(repository)" class="strong">@repository.name</a> @defining(repository.repository){ x => @if(repository.repository.originRepositoryName.isDefined){ <div class="forked"> forked from <a href="@path/@x.parentUserName/@x.parentRepositoryName">@x.parentUserName/@x.parentRepositoryName</a> </div> } } </div> <ul class="headmenu"> @sidemenu("" , "code" , "code" , "Code") @sidemenu("/issues", "issues" , "issue-opened" , "Issues", repository.issueCount) @sidemenu("/pulls" , "pulls" , "git-pull-request" , "Pull Requests", repository.pullCount) @sidemenu("/wiki" , "wiki" , "book" , "Wiki") @if(loginAccount.isDefined && (loginAccount.get.isAdmin || repository.managers.contains(loginAccount.get.userName))){ @sidemenu("/settings" , "settings" , "tools", "Settings") } </ul> </div> </div> <div class="container body"> @* @if(expand){ <div class="small"> <strong id="repository-url-proto">HTTP</strong> <span class="mute">clone URL</span> </div> @helper.html.copy("repository-url-copy", repository.httpUrl){ <input type="text" value="@repository.httpUrl" id="repository-url" class="form-control input-sm" readonly> } @if(repository.sshUrl.isDefined){ <div class="small"> <span class="mute">You can clone <a href="javascript:void(0);" id="repository-url-http">HTTP</a> or <a href="javascript:void(0);" id="repository-url-ssh">SSH</a>.</span> </div> } @id.map { id => @if(context.platform != "linux" && context.platform != null){ <div style="margin-top: 10px;"> <a href="@openRepoUrl(repository.httpUrl)" id="repository-clone-url" class="btn btn-sm btn-default btn-block"><i class="octicon octicon-desktop-download"></i> Clone in Desktop</a> </div> } <div style="margin-top: 10px;"> <a href="@{url(repository)}/archive/@{encodeRefName(id)}.zip" class="btn btn-sm btn-default btn-block"><i class="octicon octicon-cloud-download"></i>Download ZIP</a> </div> <div style="margin-top: 10px;"> <a href="@{url(repository)}/archive/@{encodeRefName(id)}.tar.gz" class="btn btn-sm btn-default btn-block "><i class="octicon octicon-cloud-download"></i>Download TAR.GZ</a> </div> } } *@ @* <div class="pull-left" style="width: 895px;">*@ @if(expand){ @repository.repository.description.map { description => <p class="description">@detectAndRenderLinks(description)</p> } <div style="margin-bottom: 10px; padding: 4px;" class="panel panel-default"> <table class="fill-width"> <tr> <td style="width: 33%; text-align: center;"> <a href="@url(repository)/commits/@encodeRefName(id.getOrElse(""))" class="header-link"> <i class="octicon octicon-history"></i> @if(repository.commitCount > 10000){ <strong>10000+</strong> commits } else { <strong>@repository.commitCount</strong> commits } </a> </td> <td style="width: 33%; text-align: center;"> <a href="@url(repository)/branches" class="header-link" class="header-link"> <i class="octicon octicon-git-branch"></i> <strong>@repository.branchList.length</strong> branches </a> </td> <td style="width: 33%; text-align: center;"> <a href="@url(repository)/tags" class="header-link" class="header-link"> <i class="octicon octicon-tag"></i> <strong>@repository.tags.length</strong> releases </a> </td> </tr> </table> </div> } @body </div> @*</div>*@ <script> $(function(){ $('ul.sidemenu a').mouseover(function(e){ var target = e.target; if(e.target.tagName == "I"){ target = e.target.parentElement; } $(target).prev('div.gradient').css('border-left', '1px solid silver'); }); $('ul.sidemenu a').mouseout(function(e){ var target = e.target; if(e.target.tagName == "I"){ target = e.target.parentElement; } $(target).prev('div.gradient').css('border-left', '1px solid #eee'); }); $('a[rel*=facebox]').facebox({ 'loadingImage': '@assets/vendors/facebox/loading.gif', 'closeImage': '@assets/vendors/facebox/closelabel.png' }); $(document).on("click", ".js-fork-owner-select-target", function() { if (!$(this).hasClass("disabled")) { var account = $(this).text().replace("@@", ""); $("#account").val(account); $("#fork").submit(); } }); @if(loginAccount.isDefined){ $(document).on("click", "a#fork-link", function(e) { e.preventDefault(); $('#fork-form').submit(); }); } @repository.sshUrl.map { sshUrl => $('#repository-url-http').click(function(){ $('#repository-url-proto').text('HTTP'); $('#repository-url').val('@repository.httpUrl'); $('#repository-clone-url').attr('href', '@openRepoUrl(repository.httpUrl)') $('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val()); }); $('#repository-url-ssh').click(function(){ $('#repository-url-proto').text('SSH'); $('#repository-url').val('@sshUrl'); $('#repository-clone-url').attr('href', '@openRepoUrl(sshUrl)'); $('#repository-url-copy').attr('data-clipboard-text', $('#repository-url').val()); }); } }); </script>