mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 15:35:59 +01:00
Apply AdminLTE sidemenu to dashboard
This commit is contained in:
@@ -2,71 +2,62 @@
|
|||||||
userRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo])(body: Html)(implicit context: gitbucket.core.controller.Context)
|
userRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo])(body: Html)(implicit context: gitbucket.core.controller.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import gitbucket.core.view.helpers._
|
@import gitbucket.core.view.helpers._
|
||||||
<div class="container body">
|
<div class="main-sidebar">
|
||||||
<div class="dashboard-sidebar">
|
<div class="sidebar">
|
||||||
@if(loginAccount.isEmpty){
|
<ul class="nav sidebar-menu">
|
||||||
<div id="dashboard-signin-form">@html.signinform(settings)</div>
|
@if(loginAccount.isDefined){
|
||||||
|
<li class="header">Your repositories <span class="label label-primary pull-right">@userRepositories.size</span></li>
|
||||||
|
@if(userRepositories.isEmpty){
|
||||||
|
<li>No repositories</li>
|
||||||
} else {
|
} else {
|
||||||
<div class="panel panel-default">
|
@defining(10){ max =>
|
||||||
<div class="panel-heading strong">
|
@userRepositories.zipWithIndex.map { case (repository, i) =>
|
||||||
Your repositories <span class="badge">@userRepositories.size</span>
|
<li class="repo-link" style="@if(i > max - 1){display:none;}">
|
||||||
</div>
|
@if(repository.owner == loginAccount.get.userName){
|
||||||
<ul class="list-group list-group-flush">
|
<a href="@url(repository)">@helper.html.repositoryicon(repository, false) <span class="strong">@repository.name</span></a>
|
||||||
@if(userRepositories.isEmpty){
|
} else {
|
||||||
<li class="list-group-item">No repositories</li>
|
<a href="@url(repository)">@helper.html.repositoryicon(repository, false) @repository.owner/<span class="strong">@repository.name</span></a>
|
||||||
} else {
|
|
||||||
@defining(20){ max =>
|
|
||||||
@userRepositories.zipWithIndex.map { case (repository, i) =>
|
|
||||||
<li class="list-group-item repo-link" style="@if(i > max - 1){display:none;}">
|
|
||||||
@helper.html.repositoryicon(repository, false)
|
|
||||||
@if(repository.owner == loginAccount.get.userName){
|
|
||||||
<a href="@url(repository)"><span class="strong">@repository.name</span></a>
|
|
||||||
} else {
|
|
||||||
<a href="@url(repository)">@repository.owner/<span class="strong">@repository.name</span></a>
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
@if(userRepositories.size > max){
|
|
||||||
<li class="list-group-item show-more">
|
|
||||||
<a href="javascript:void(0);" id="show-more-repos">Show @{userRepositories.size - max} more repositories...</a>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
@if(userRepositories.size > max){
|
||||||
</div>
|
<li class="show-more">
|
||||||
}
|
<a href="javascript:void(0);" id="show-more-repos">Show @{userRepositories.size - max} more repositories...</a>
|
||||||
<div class="panel panel-default">
|
</li>
|
||||||
<div class="panel-heading strong">Recent updated repositories</div>
|
|
||||||
<ul class="list-group list-group-flush">
|
|
||||||
@if(recentRepositories.isEmpty){
|
|
||||||
<li class="list-group-item">No repositories</li>
|
|
||||||
} else {
|
|
||||||
@defining(20){ max =>
|
|
||||||
@recentRepositories.zipWithIndex.map { case (repository, i) =>
|
|
||||||
<li class="list-group-item repo-link" style="@if(i > max - 1){display:none;}">
|
|
||||||
@helper.html.repositoryicon(repository, false)
|
|
||||||
<a href="@url(repository)">@repository.owner/<span class="strong">@repository.name</span></a>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
@if(recentRepositories.size > max){
|
|
||||||
<li class="list-group-item show-more">
|
|
||||||
<a href="javascript:void(0);" id="show-more-recent-repos">Show @{recentRepositories.size - max} more repositories...</a>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</ul>
|
}
|
||||||
</div>
|
} else {
|
||||||
|
<li class="header">Recent updated repositories</li>
|
||||||
|
@if(recentRepositories.isEmpty){
|
||||||
|
<li>No repositories</li>
|
||||||
|
} else {
|
||||||
|
@defining(10){ max =>
|
||||||
|
@recentRepositories.zipWithIndex.map { case (repository, i) =>
|
||||||
|
<li class="repo-link" style="@if(i > max - 1){display:none;}">
|
||||||
|
<a href="@url(repository)">@helper.html.repositoryicon(repository, false) @repository.owner/<span class="strong">@repository.name</span></a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
@if(recentRepositories.size > max){
|
||||||
|
<li class="show-more">
|
||||||
|
<a href="javascript:void(0);" id="show-more-recent-repos">Show @{recentRepositories.size - max} more repositories...</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-content">
|
</div>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="content body">
|
||||||
@body
|
@body
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
$('#show-more-repos, #show-more-recent-repos').click(function(e){
|
$('#show-more-repos, #show-more-recent-repos').click(function(e){
|
||||||
$(e.target).parents('ul.list-group').find('li.repo-link').show();
|
$(e.target).parents('ul').find('li.repo-link').show();
|
||||||
$(e.target).parents('li.show-more').remove();
|
$(e.target).parents('li.show-more').remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,9 +63,6 @@
|
|||||||
@repository.map { repository =>
|
@repository.map { repository =>
|
||||||
<form id="search" action="@path/search" method="POST" class="navbar-form navbar-left" role="search">
|
<form id="search" action="@path/search" method="POST" class="navbar-form navbar-left" role="search">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@*
|
|
||||||
<input type="text" class="form-control" id="navbar-search-input" placeholder="Search">
|
|
||||||
*@
|
|
||||||
<input type="text" name="query" id="navbar-search-input" class="form-control" placeholder="Search this repository"/>
|
<input type="text" name="query" id="navbar-search-input" class="form-control" placeholder="Search this repository"/>
|
||||||
<input type="hidden" name="owner" value="@repository.owner"/>
|
<input type="hidden" name="owner" value="@repository.owner"/>
|
||||||
<input type="hidden" name="repository" value="@repository.name"/>
|
<input type="hidden" name="repository" value="@repository.name"/>
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
<li @if(active == name){class="active"}>
|
<li @if(active == name){class="active"}>
|
||||||
@if(path.startsWith("http")){
|
@if(path.startsWith("http")){
|
||||||
<a href="@path" target="_blank">
|
<a href="@path" target="_blank">
|
||||||
<i class="menu-icon octicon octicon-@icon"></i> <span class="pc">@label @if(count > 0) { <span class="badge">@count</span> }</span>
|
<i class="menu-icon octicon octicon-@icon"></i> <span class="pc">@label @if(count > 0) { <span class="label label-primary pull-right">@count</span> }</span>
|
||||||
</a>
|
</a>
|
||||||
} else {
|
} else {
|
||||||
<a href="@url(repository)@path">
|
<a href="@url(repository)@path">
|
||||||
<i class="menu-icon octicon octicon-@icon"></i> <span class="pc">@label @if(count > 0) { <span class="badge">@count</span> }</span>
|
<i class="menu-icon octicon octicon-@icon"></i> <span class="pc">@label @if(count > 0) { <span class="label label-primary pull-right">@count</span> }</span>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user