mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-10-29 09:36:16 +01:00
(refs #508)Add search filter box to the dashboard
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package app
|
||||
|
||||
import service._
|
||||
import util.{UsersAuthenticator, Keys}
|
||||
import util.{StringUtil, UsersAuthenticator, Keys}
|
||||
import util.Implicits._
|
||||
import service.IssuesService.IssueSearchCondition
|
||||
|
||||
class DashboardController extends DashboardControllerBase
|
||||
with IssuesService with PullRequestService with RepositoryService with AccountService
|
||||
@@ -12,8 +13,21 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
self: IssuesService with PullRequestService with RepositoryService with AccountService
|
||||
with UsersAuthenticator =>
|
||||
|
||||
get("/dashboard/issues/repos")(usersOnly {
|
||||
searchIssues("created_by")
|
||||
get("/dashboard/issues")(usersOnly {
|
||||
val q = request.getParameter("q")
|
||||
val account = context.loginAccount.get
|
||||
Option(q).map { q =>
|
||||
val condition = IssueSearchCondition(q, Map[String, Int]())
|
||||
q match {
|
||||
case q if(q.contains("is:pr")) => redirect(s"/dashboard/pulls?q=${StringUtil.urlEncode(q)}")
|
||||
case q if(q.contains(s"author:${account.userName}")) => redirect(s"/dashboard/issues/created_by${condition.toURL}")
|
||||
case q if(q.contains(s"assignee:${account.userName}")) => redirect(s"/dashboard/issues/assigned${condition.toURL}")
|
||||
case q if(q.contains(s"mentions:${account.userName}")) => redirect(s"/dashboard/issues/mentioned${condition.toURL}")
|
||||
case _ => searchIssues("created_by")
|
||||
}
|
||||
} getOrElse {
|
||||
searchIssues("created_by")
|
||||
}
|
||||
})
|
||||
|
||||
get("/dashboard/issues/assigned")(usersOnly {
|
||||
@@ -29,7 +43,20 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
})
|
||||
|
||||
get("/dashboard/pulls")(usersOnly {
|
||||
searchPullRequests("created_by")
|
||||
val q = request.getParameter("q")
|
||||
val account = context.loginAccount.get
|
||||
Option(q).map { q =>
|
||||
val condition = IssueSearchCondition(q, Map[String, Int]())
|
||||
q match {
|
||||
case q if(q.contains("is:issue")) => redirect(s"/dashboard/issues?q=${StringUtil.urlEncode(q)}")
|
||||
case q if(q.contains(s"author:${account.userName}")) => redirect(s"/dashboard/pulls/created_by${condition.toURL}")
|
||||
case q if(q.contains(s"assignee:${account.userName}")) => redirect(s"/dashboard/pulls/assigned${condition.toURL}")
|
||||
case q if(q.contains(s"mentions:${account.userName}")) => redirect(s"/dashboard/pulls/mentioned${condition.toURL}")
|
||||
case _ => searchPullRequests("created_by")
|
||||
}
|
||||
} getOrElse {
|
||||
searchPullRequests("created_by")
|
||||
}
|
||||
})
|
||||
|
||||
get("/dashboard/pulls/created_by")(usersOnly {
|
||||
@@ -44,15 +71,21 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
searchPullRequests("mentioned")
|
||||
})
|
||||
|
||||
private def getOrCreateCondition(key: String) = {
|
||||
session.putAndGet(key, if(request.hasQueryString){
|
||||
val q = request.getParameter("q")
|
||||
if(q == null){
|
||||
IssueSearchCondition(request)
|
||||
} else {
|
||||
IssueSearchCondition(q, Map[String, Int]())
|
||||
}
|
||||
} else session.getAs[IssueSearchCondition](key).getOrElse(IssueSearchCondition()))
|
||||
}
|
||||
|
||||
private def searchIssues(filter: String) = {
|
||||
import IssuesService._
|
||||
|
||||
// condition
|
||||
val condition = session.putAndGet(Keys.Session.DashboardIssues,
|
||||
if(request.hasQueryString) IssueSearchCondition(request)
|
||||
else session.getAs[IssueSearchCondition](Keys.Session.DashboardIssues).getOrElse(IssueSearchCondition())
|
||||
)
|
||||
|
||||
val condition = getOrCreateCondition(Keys.Session.DashboardIssues)
|
||||
val userName = context.loginAccount.get.userName
|
||||
val userRepos = getUserRepositories(userName, context.baseUrl, true).map(repo => repo.owner -> repo.name)
|
||||
val filterUser = Map(filter -> userName)
|
||||
@@ -63,7 +96,11 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
page,
|
||||
countIssue(condition.copy(state = "open" ), filterUser, false, userRepos: _*),
|
||||
countIssue(condition.copy(state = "closed"), filterUser, false, userRepos: _*),
|
||||
condition,
|
||||
filter match {
|
||||
case "assigned" => condition.copy(assigned = Some(userName))
|
||||
case "mentioned" => condition.copy(mentioned = Some(userName))
|
||||
case _ => condition.copy(author = Some(userName))
|
||||
},
|
||||
filter,
|
||||
getGroupNames(userName))
|
||||
}
|
||||
@@ -72,12 +109,7 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
import IssuesService._
|
||||
import PullRequestService._
|
||||
|
||||
// condition
|
||||
val condition = session.putAndGet(Keys.Session.DashboardPulls, {
|
||||
if(request.hasQueryString) IssueSearchCondition(request)
|
||||
else session.getAs[IssueSearchCondition](Keys.Session.DashboardPulls).getOrElse(IssueSearchCondition())
|
||||
})
|
||||
|
||||
val condition = getOrCreateCondition(Keys.Session.DashboardPulls)
|
||||
val userName = context.loginAccount.get.userName
|
||||
val allRepos = getAllRepositories(userName)
|
||||
val filterUser = Map(filter -> userName)
|
||||
@@ -88,7 +120,11 @@ trait DashboardControllerBase extends ControllerBase {
|
||||
page,
|
||||
countIssue(condition.copy(state = "open" ), filterUser, true, allRepos: _*),
|
||||
countIssue(condition.copy(state = "closed"), filterUser, true, allRepos: _*),
|
||||
condition,
|
||||
filter match {
|
||||
case "assigned" => condition.copy(assigned = Some(userName))
|
||||
case "mentioned" => condition.copy(mentioned = Some(userName))
|
||||
case _ => condition.copy(author = Some(userName))
|
||||
},
|
||||
filter,
|
||||
getGroupNames(userName))
|
||||
}
|
||||
|
||||
@@ -401,8 +401,7 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
} else {
|
||||
IssueSearchCondition(q, getMilestones(owner, repoName).map(x => (x.title, x.milestoneId)).toMap)
|
||||
}
|
||||
}
|
||||
else session.getAs[IssueSearchCondition](sessionKey).getOrElse(IssueSearchCondition())
|
||||
} else session.getAs[IssueSearchCondition](sessionKey).getOrElse(IssueSearchCondition())
|
||||
)
|
||||
|
||||
issues.html.list(
|
||||
|
||||
@@ -326,6 +326,7 @@ object IssuesService {
|
||||
milestoneId: Option[Option[Int]] = None,
|
||||
author: Option[String] = None,
|
||||
assigned: Option[String] = None,
|
||||
mentioned: Option[String] = None,
|
||||
state: String = "open",
|
||||
sort: String = "created",
|
||||
direction: String = "desc",
|
||||
@@ -339,12 +340,14 @@ object IssuesService {
|
||||
|
||||
def nonEmpty: Boolean = !isEmpty
|
||||
|
||||
def toFilterString: String =
|
||||
(List(
|
||||
def toFilterString: String = (
|
||||
List(
|
||||
Some(s"is:${state}"),
|
||||
author.map(author => s"author:${author}"),
|
||||
assigned.map(assignee => s"assignee:${assignee}")
|
||||
).flatten ++ labels.map(label => s"label:${label}") ++
|
||||
assigned.map(assignee => s"assignee:${assignee}"),
|
||||
mentioned.map(mentioned => s"mentions:${mentioned}")
|
||||
).flatten ++
|
||||
labels.map(label => s"label:${label}") ++
|
||||
List(
|
||||
milestoneId.map { _ match {
|
||||
case Some(x) => s"milestone:${milestoneId}"
|
||||
@@ -357,8 +360,11 @@ object IssuesService {
|
||||
case ("comments", "asc" ) => Some("sort:comments-asc")
|
||||
case ("updated" , "desc") => Some("sort:updated-desc")
|
||||
case ("updated" , "asc" ) => Some("sort:updated-asc")
|
||||
}
|
||||
).flatten).mkString(" ")
|
||||
},
|
||||
visibility.map(visibility => s"visibility:${visibility}")
|
||||
).flatten ++
|
||||
groups.map(group => s"group:${group}")
|
||||
).mkString(" ")
|
||||
|
||||
def toURL: String =
|
||||
"?" + List(
|
||||
@@ -410,15 +416,16 @@ object IssuesService {
|
||||
conditions.get("milestone").flatMap(_.headOption) match {
|
||||
case None => None
|
||||
case Some("none") => Some(None)
|
||||
case Some(x) => Some(milestones.get(x))
|
||||
case Some(x) => milestones.get(x).map(x => Some(x))
|
||||
},
|
||||
conditions.get("author").flatMap(_.headOption),
|
||||
conditions.get("assignee").flatMap(_.headOption),
|
||||
None,
|
||||
conditions.get("is").getOrElse(Seq.empty).filter(x => x == "open" || x == "closed").headOption.getOrElse("open"),
|
||||
sort,
|
||||
direction,
|
||||
None, // TODO??
|
||||
Set.empty // TODO??
|
||||
conditions.get("visibility").flatMap(_.headOption),
|
||||
conditions.get("group").map(_.toSet).getOrElse(Set.empty)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -434,6 +441,7 @@ object IssuesService {
|
||||
},
|
||||
param(request, "author"),
|
||||
param(request, "assigned"),
|
||||
None,
|
||||
param(request, "state", Seq("open", "closed")).getOrElse("open"),
|
||||
param(request, "sort", Seq("created", "comments", "updated")).getOrElse("created"),
|
||||
param(request, "direction", Seq("asc", "desc")).getOrElse("desc"),
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
@html.main("Issues"){
|
||||
@dashboard.html.tab("issues")
|
||||
<div class="container">
|
||||
@issuesnavi(filter, "issues", condition)
|
||||
@issueslist(issues, page, openCount, closedCount, condition, filter, groups)
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
@*
|
||||
<ul class="nav nav-pills-group pull-left fill-width">
|
||||
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/issues/created_by@condition.toURL">Created</a></li>
|
||||
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/issues/assigned@condition.toURL">Assigned</a></li>
|
||||
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/issues/mentioned@condition.toURL">Mentioned</a></li>
|
||||
</ul>
|
||||
*@
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
<tr>
|
||||
<th style="background-color: #eee;">
|
||||
|
||||
22
src/main/twirl/dashboard/issuesnavi.scala.html
Normal file
22
src/main/twirl/dashboard/issuesnavi.scala.html
Normal file
@@ -0,0 +1,22 @@
|
||||
@(filter: String,
|
||||
active: String,
|
||||
condition: service.IssuesService.IssueSearchCondition)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<ul class="nav nav-pills-group pull-left fill-width">
|
||||
<li class="@if(filter == "created_by"){active} first">
|
||||
<a href="@path/dashboard/@active/created_by@condition.copy(author = None, assigned = None).toURL">Created</a>
|
||||
</li>
|
||||
<li class="@if(filter == "assigned"){active}">
|
||||
<a href="@path/dashboard/@active/assigned@condition.copy(author = None, assigned = None).toURL">Assigned</a>
|
||||
</li>
|
||||
<li class="@if(filter == "mentioned"){active} last">
|
||||
<a href="@path/dashboard/@active/mentioned@condition.copy(author = None, assigned = None).toURL">Mentioned</a>
|
||||
</li>
|
||||
<li class="pull-right">
|
||||
<form method="GET" id="search-filter-form" action="@path/dashboard/@active" style="margin-bottom: 0px;">
|
||||
<input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;"
|
||||
value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -10,6 +10,7 @@
|
||||
@html.main("Pull Requests"){
|
||||
@dashboard.html.tab("pulls")
|
||||
<div class="container">
|
||||
@issuesnavi(filter, "pulls", condition)
|
||||
@pullslist(issues, page, openCount, closedCount, condition, filter, groups)
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -8,11 +8,31 @@
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@import service.IssuesService.IssueInfo
|
||||
@*
|
||||
<ul class="nav nav-pills-group pull-left fill-width">
|
||||
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/pulls/created_by@condition.toURL">Created</a></li>
|
||||
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/pulls/assigned@condition.toURL">Assigned</a></li>
|
||||
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/pulls/mentioned@condition.toURL">Mentioned</a></li>
|
||||
<li class="pull-right">
|
||||
<div class="input-prepend" style="margin-bottom: 0px;">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;">
|
||||
Filter
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="?q=is:open">Open issues and pull requests</a></li>
|
||||
<li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li>
|
||||
<li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li>
|
||||
<li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li>
|
||||
<li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
*@
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
<tr>
|
||||
<th style="background-color: #eee;">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<img src="@assets/common/images/menu-pulls.png">
|
||||
Pull Requests
|
||||
</a>
|
||||
<a href="@path/dashboard/issues/repos" @if(active == "issues"){ class="active"}>
|
||||
<a href="@path/dashboard/issues" @if(active == "issues"){ class="active"}>
|
||||
<img src="@assets/common/images/menu-issues.png">
|
||||
Issues
|
||||
</a>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@import view.helpers._
|
||||
@html.main(s"New Issue - ${repository.owner}/${repository.name}", Some(repository)){
|
||||
@html.menu("issues", repository){
|
||||
@tab("issues", false, repository)
|
||||
@navigation("issues", false, repository)
|
||||
<br/><br/><hr style="margin-bottom: 10px;">
|
||||
<form action="@url(repository)/issues/new" method="POST" validate="true">
|
||||
<div class="row-fluid">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@import view.helpers._
|
||||
@html.main(s"Labels - ${repository.owner}/${repository.name}"){
|
||||
@html.menu("issues", repository){
|
||||
@issues.html.tab("labels", hasWritePermission, repository)
|
||||
@issues.html.navigation("labels", hasWritePermission, repository)
|
||||
<br>
|
||||
<table class="table table-bordered table-hover table-issues" id="new-label-table" style="display: none;">
|
||||
<tr><td></td></tr>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@import view.helpers._
|
||||
@html.main((if(target == "issues") "Issues" else "Pull requests") + s" - ${repository.owner}/${repository.name}", Some(repository)){
|
||||
@html.menu(target, repository){
|
||||
@tab(target, true, repository, Some(condition))
|
||||
@navigation(target, true, repository, Some(condition))
|
||||
@listparts(target, issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission)
|
||||
@if(hasWritePermission){
|
||||
<form id="batcheditForm" method="POST">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<h4>New milestone</h4>
|
||||
<div class="muted">Create a new milestone to help organize your issues and pull requests.</div>
|
||||
} else {
|
||||
@issues.html.tab("milestones", false, repository)
|
||||
@issues.html.navigation("milestones", false, repository)
|
||||
<br><br>
|
||||
}
|
||||
<hr style="margin-top: 12px; margin-bottom: 18px;" class="fill-width"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@import view.helpers._
|
||||
@html.main(s"Milestones - ${repository.owner}/${repository.name}"){
|
||||
@html.menu("issues", repository){
|
||||
@issues.html.tab("milestones", hasWritePermission, repository)
|
||||
@issues.html.navigation("milestones", hasWritePermission, repository)
|
||||
<br>
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
<tr>
|
||||
|
||||
58
src/main/twirl/issues/navigation.scala.html
Normal file
58
src/main/twirl/issues/navigation.scala.html
Normal file
@@ -0,0 +1,58 @@
|
||||
@(active: String,
|
||||
newButton: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
condition: Option[service.IssuesService.IssueSearchCondition] = None)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<ul class="nav nav-pills-group pull-left fill-width">
|
||||
<li class="@if(active == "issues" ){active} first"><a href="@url(repository)/issues">Issues</a></li>
|
||||
<li class="@if(active == "pulls" ){active}"><a href="@url(repository)/pulls">Pull requests</a></li>
|
||||
<li class="@if(active == "labels" ){active}"><a href="@url(repository)/issues/labels">Labels</a></li>
|
||||
<li class="@if(active == "milestones"){active} last"><a href="@url(repository)/issues/milestones">Milestones</a></li>
|
||||
<li class="pull-right">
|
||||
<form method="GET" id="search-filter-form" style="margin-bottom: 0px;">
|
||||
@condition.map { condition =>
|
||||
@if(loginAccount.isDefined){
|
||||
<div class="input-prepend" style="margin-bottom: 0px;">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;">
|
||||
Filter
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="?q=is:open">Open issues and pull requests</a></li>
|
||||
<li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li>
|
||||
<li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li>
|
||||
<li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li>
|
||||
@*
|
||||
<li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li>
|
||||
*@
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
|
||||
</div>
|
||||
} else {
|
||||
<input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
|
||||
}
|
||||
}
|
||||
@if(loginAccount.isDefined){
|
||||
<div class="btn-group">
|
||||
@if(newButton){
|
||||
@if(active == "issues"){
|
||||
<a class="btn btn-success" href="@url(repository)/issues/new" style="height: 24px;">New issue</a>
|
||||
}
|
||||
@if(active == "pulls"){
|
||||
<a class="btn btn-success" href="@url(repository)/compare" style="height: 24px;">New pull request</a>
|
||||
}
|
||||
@if(active == "labels"){
|
||||
<a class="btn btn-success" href="javascript:void(0);" id="new-label-button" style="height: 24px;">New label</a>
|
||||
}
|
||||
@if(active == "milestones"){
|
||||
<a class="btn btn-success" href="@url(repository)/issues/milestones/new" style="height: 24px;">New milestone</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -1,52 +0,0 @@
|
||||
@(active: String,
|
||||
newButton: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo,
|
||||
condition: Option[service.IssuesService.IssueSearchCondition] = None)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
<ul class="nav nav-pills-group pull-left fill-width">
|
||||
<li class="@if(active == "issues" ){active} first"><a href="@url(repository)/issues">Issues</a></li>
|
||||
<li class="@if(active == "pulls" ){active}"><a href="@url(repository)/pulls">Pull requests</a></li>
|
||||
<li class="@if(active == "labels" ){active}"><a href="@url(repository)/issues/labels">Labels</a></li>
|
||||
<li class="@if(active == "milestones"){active} last"><a href="@url(repository)/issues/milestones">Milestones</a></li>
|
||||
<li class="pull-right">
|
||||
@condition.map { condition =>
|
||||
<form method="GET" id="search-filter-form">
|
||||
<div class="input-prepend" style="margin-bottom: 0px;">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;">
|
||||
Filter
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Open issues and pull requests</a></li>
|
||||
<li><a href="#">Your issues</a></li>
|
||||
<li><a href="#">Your pull requests</a></li>
|
||||
<li><a href="#">Everything assigned to you</a></li>
|
||||
<li><a href="#">Everything mentioning you</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
@if(loginAccount.isDefined){
|
||||
<div class="btn-group">
|
||||
@if(newButton){
|
||||
@if(active == "issues"){
|
||||
<a class="btn btn-success" href="@url(repository)/issues/new" style="height: 24px;">New issue</a>
|
||||
}
|
||||
@if(active == "pulls"){
|
||||
<a class="btn btn-success" href="@url(repository)/compare" style="height: 24px;">New pull request</a>
|
||||
}
|
||||
@if(active == "labels"){
|
||||
<a class="btn btn-success" href="javascript:void(0);" id="new-label-button" style="height: 24px;">New label</a>
|
||||
}
|
||||
@if(active == "milestones"){
|
||||
<a class="btn btn-success" href="@url(repository)/issues/milestones/new" style="height: 24px;">New milestone</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user