mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Fix dashboard and search layout
This commit is contained in:
@@ -108,7 +108,9 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
case _ => condition.copy(author = Some(userName))
|
||||
},
|
||||
filter,
|
||||
getGroupNames(userName))
|
||||
getGroupNames(userName),
|
||||
getVisibleRepositories(context.loginAccount, withoutPhysicalInfo = true),
|
||||
getUserRepositories(userName, withoutPhysicalInfo = true))
|
||||
}
|
||||
|
||||
private def searchPullRequests(filter: String) = {
|
||||
@@ -131,7 +133,9 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
case _ => condition.copy(author = Some(userName))
|
||||
},
|
||||
filter,
|
||||
getGroupNames(userName))
|
||||
getGroupNames(userName),
|
||||
getVisibleRepositories(context.loginAccount, withoutPhysicalInfo = true),
|
||||
getUserRepositories(userName, withoutPhysicalInfo = true))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,15 +4,19 @@
|
||||
closedCount: Int,
|
||||
condition: gitbucket.core.service.IssuesService.IssueSearchCondition,
|
||||
filter: String,
|
||||
groups: List[String])(implicit context: gitbucket.core.controller.Context)
|
||||
groups: List[String],
|
||||
recentRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo],
|
||||
userRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo])(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main("Issues"){
|
||||
<div class="body">
|
||||
@sidebar(recentRepositories, userRepositories){
|
||||
<div style="overflow: hidden;">
|
||||
@dashboard.html.tab("issues")
|
||||
<div class="container">
|
||||
@issuesnavi(filter, openCount, closedCount, condition)
|
||||
@issueslist(issues, page, openCount, closedCount, condition, filter, groups)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<li class="@(if(condition.state == "open"){"active"})">
|
||||
<a href="@condition.copy(state = "open").toURL">Open <span class="badge">@openCount</span></a>
|
||||
</li>
|
||||
<li class="@if(condition.state == "closed"){ selected}">
|
||||
<li class="@(if(condition.state == "closed"){"active"})">
|
||||
<a href="@condition.copy(state = "closed").toURL">Closed <span class="badge">@closedCount</span></a>
|
||||
</li>
|
||||
@*
|
||||
|
||||
@@ -4,15 +4,19 @@
|
||||
closedCount: Int,
|
||||
condition: gitbucket.core.service.IssuesService.IssueSearchCondition,
|
||||
filter: String,
|
||||
groups: List[String])(implicit context: gitbucket.core.controller.Context)
|
||||
groups: List[String],
|
||||
recentRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo],
|
||||
userRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo])(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.main("Pull Requests"){
|
||||
<div class="body">
|
||||
@sidebar(recentRepositories, userRepositories){
|
||||
<div style="overflow: hidden;">
|
||||
@dashboard.html.tab("pulls")
|
||||
<div class="container">
|
||||
@issuesnavi(filter, openCount, closedCount, condition)
|
||||
@issueslist(issues, page, openCount, closedCount, condition, filter, groups)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
65
src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html
Normal file
65
src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html
Normal file
@@ -0,0 +1,65 @@
|
||||
@(recentRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo],
|
||||
userRepositories: List[gitbucket.core.service.RepositoryService.RepositoryInfo])(body: Html)(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
<div class="container body">
|
||||
<div class="dashboard-sidebar">
|
||||
@if(loginAccount.isEmpty){
|
||||
<div id="dashboard-signin-form">@html.signinform(settings)</div>
|
||||
} else {
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading strong">
|
||||
Your repositories <span class="badge">@userRepositories.size</span>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
@if(userRepositories.isEmpty){
|
||||
<li class="list-group-item">No repositories</li>
|
||||
} 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>
|
||||
}
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
<div class="panel panel-default">
|
||||
<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>
|
||||
</div>
|
||||
<div class="dashboard-content">
|
||||
@body
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,10 @@
|
||||
@(active: String = "")(implicit context: gitbucket.core.controller.Context)
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
<div class="container headbar">
|
||||
<ul class="nav nav-tabs">
|
||||
<ul class="nav nav-tabs" style="margin-bottom: 20px;">
|
||||
<li @if(active == ""){ class="active"}><a href="@path/">News Feed</a></li>
|
||||
@if(loginAccount.isDefined){
|
||||
<li @if(active == "pulls" ){ class="active"}><a href="@path/dashboard/pulls">Pull Requests</a></li>
|
||||
<li @if(active == "issues"){ class="active"}><a href="@path/dashboard/issues">Issues</a></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
@@ -4,82 +4,23 @@
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@main("GitBucket"){
|
||||
<div class="body">
|
||||
@dashboard.html.tab()
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="pull-right">
|
||||
<a href="@path/activities.atom"><img src="@assets/common/images/feed.png" alt="activities"></a>
|
||||
</div>
|
||||
@helper.html.activities(activities)
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@dashboard.html.sidebar(recentRepositories, userRepositories){
|
||||
@settings.information.map { information =>
|
||||
<div class="alert alert-info" style="background-color: white; color: #555; border-color: #4183c4; font-size: small; line-height: 120%;">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
@Html(information)
|
||||
</div>
|
||||
}
|
||||
@if(loginAccount.isEmpty){
|
||||
<div id="dashboard-signin-form">@signinform(settings)</div>
|
||||
} else {
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading strong">
|
||||
Your repositories <span class="badge">@userRepositories.size</span>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
@if(userRepositories.isEmpty){
|
||||
<li class="list-group-item">No repositories</li>
|
||||
} 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>
|
||||
}
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
<div class="panel panel-default">
|
||||
<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>
|
||||
</div>
|
||||
<div style="overflow: hidden;">
|
||||
@dashboard.html.tab()
|
||||
<div class="container">
|
||||
<div class="pull-right">
|
||||
<a href="@path/activities.atom"><img src="@assets/common/images/feed.png" alt="activities"></a>
|
||||
</div>
|
||||
@helper.html.activities(activities)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</a>
|
||||
@if(loginAccount.isDefined){
|
||||
@repository.map { repository =>
|
||||
<input type="text" name="query" class="form-control" style="width: 200px; margin-top: 3px; margin-bottom: 3px;" placeholder="Search this repository"/>
|
||||
<input type="text" name="query" class="form-control" style="width: 400px; margin-top: 3px; margin-bottom: 3px;" placeholder="Search this repository"/>
|
||||
<input type="hidden" name="owner" value="@repository.owner"/>
|
||||
<input type="hidden" name="repository" value="@repository.name"/>
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
} else {
|
||||
@* TODO: merge with below *@
|
||||
@repository.map { repository =>
|
||||
<input type="text" name="query" class="form-control" style="width: 200px; margin-top: 3px; margin-bottom: 3px;" placeholder="Search this repository"/>
|
||||
<input type="text" name="query" class="form-control" style="width: 400px; margin-top: 3px; margin-bottom: 3px;" placeholder="Search this repository"/>
|
||||
<input type="hidden" name="owner" value="@repository.owner"/>
|
||||
<input type="hidden" name="repository" value="@repository.name"/>
|
||||
}
|
||||
|
||||
@@ -21,26 +21,6 @@
|
||||
<div class="container">
|
||||
@helper.html.information(info)
|
||||
@helper.html.error(error)
|
||||
@*
|
||||
<div class="pull-right">
|
||||
<a href="@url(repository)/commits/@encodeRefName(id.getOrElse(repository.repository.defaultBranch))" class="header-link">
|
||||
<i class="octicon octicon-history"></i>
|
||||
@if(repository.commitCount > 10000){
|
||||
<strong>10000+</strong> commits
|
||||
} else {
|
||||
<strong>@repository.commitCount</strong> commits
|
||||
}
|
||||
</a>
|
||||
<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>
|
||||
<a href="@url(repository)/tags" class="header-link" class="header-link">
|
||||
<i class="octicon octicon-tag"></i>
|
||||
<strong>@repository.tags.length</strong> releases
|
||||
</a>
|
||||
</div>
|
||||
*@
|
||||
<div class="head">
|
||||
@helper.html.repositoryicon(repository, true)
|
||||
<a href="@url(repository.owner)">@repository.owner</a> / <a href="@url(repository)" class="strong">@repository.name</a>
|
||||
|
||||
@@ -3,36 +3,30 @@
|
||||
@import context._
|
||||
@import gitbucket.core.view.helpers._
|
||||
@html.menu("", repository){
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<ul class="nav nav-tabs nav-stacked side-menu">
|
||||
<div style="overflow: hidden;">
|
||||
<ul class="nav nav-tabs" style="margin-bottom: 20px;">
|
||||
<li@if(active=="code"){ class="active"}>
|
||||
<a href="@url(repository)/search?q=@urlEncode(query)&type=code">
|
||||
Files
|
||||
@if(fileCount != 0){
|
||||
<span class="badge pull-right">@fileCount</span>
|
||||
<span class="badge">@fileCount</span>
|
||||
}
|
||||
Code
|
||||
</a>
|
||||
</li>
|
||||
<li@if(active=="issue"){ class="active"}>
|
||||
<a href="@url(repository)/search?q=@urlEncode(query)&type=issue">
|
||||
Issues
|
||||
@if(issueCount != 0){
|
||||
<span class="badge pull-right">@issueCount</span>
|
||||
<span class="badge">@issueCount</span>
|
||||
}
|
||||
Issue
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<form action="@url(repository)/search" method="GET" class="form-inline">
|
||||
<input type="text" name="q" value="@query" class="form-control" style="width: 80%; margin-bottom: 0px;"/>
|
||||
<input type="submit" value="Search" class="btn btn-default" style="width: 15%;"/>
|
||||
<input type="text" name="q" value="@query" class="form-control" style="width: 400px; margin-bottom: 0px;"/>
|
||||
<input type="submit" value="Search" class="btn btn-default"/>
|
||||
<input type="hidden" name="type" value="@active"/>
|
||||
</form>
|
||||
@body
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -135,12 +135,13 @@ span.header-version {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
/*
|
||||
div.input-group>span.fork {
|
||||
display: table;
|
||||
margin-left: 4px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
div.input-group>span.fork>span.count {
|
||||
background-color: white;
|
||||
@@ -207,6 +208,15 @@ div.main-center {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div.dashboard-sidebar {
|
||||
width: 300px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.dashboard-content {
|
||||
margin-left: 310px;
|
||||
}
|
||||
|
||||
div.body {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 40px;
|
||||
@@ -602,7 +612,7 @@ table.blobview {
|
||||
table-layout: fixed;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
table.table-file-list {
|
||||
margin-bottom: 0px;
|
||||
border: 1px solid #ddd;
|
||||
@@ -614,6 +624,7 @@ table.table-file-list th, table.table-file-list td {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
*/
|
||||
|
||||
table.table-file-list td.latest-commit {
|
||||
padding-top: 4px;
|
||||
@@ -625,7 +636,7 @@ table.table-file-list td {
|
||||
background-color: #F8F8F8;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
/*
|
||||
table.table-file-list .file-icon {
|
||||
padding-right: 1px;
|
||||
}
|
||||
@@ -653,7 +664,7 @@ th, td, .table th, .table td {
|
||||
padding-bottom: 4px;
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
*/
|
||||
div.commit-avatar-image {
|
||||
float: left;
|
||||
margin-right: 4px;
|
||||
|
||||
Reference in New Issue
Block a user