mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
(refs #25)Alert if due date passed.
This commit is contained in:
@@ -317,7 +317,7 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
searchIssue(owner, repoName, condition, filter, userName, (page - 1) * IssueLimit, IssueLimit),
|
searchIssue(owner, repoName, condition, filter, userName, (page - 1) * IssueLimit, IssueLimit),
|
||||||
page,
|
page,
|
||||||
(getCollaborators(owner, repoName) :+ owner).sorted,
|
(getCollaborators(owner, repoName) :+ owner).sorted,
|
||||||
getMilestones(owner, repoName).filter(_.closedDate.isEmpty),
|
getMilestones(owner, repoName),
|
||||||
getLabels(owner, repoName),
|
getLabels(owner, repoName),
|
||||||
countIssue(owner, repoName, condition.copy(state = "open"), filter, userName),
|
countIssue(owner, repoName, condition.copy(state = "open"), filter, userName),
|
||||||
countIssue(owner, repoName, condition.copy(state = "closed"), filter, userName),
|
countIssue(owner, repoName, condition.copy(state = "closed"), filter, userName),
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
|||||||
def assets(implicit context: app.Context): String =
|
def assets(implicit context: app.Context): String =
|
||||||
s"${context.path}/assets"
|
s"${context.path}/assets"
|
||||||
|
|
||||||
|
def isPast(date: Date): Boolean = System.currentTimeMillis > date.getTime
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implicit conversion to add mkHtml() to Seq[Html].
|
* Implicit conversion to add mkHtml() to Seq[Html].
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@milestones.map { milestone =>
|
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||||
<li>
|
<li>
|
||||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||||
@@ -74,12 +74,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
||||||
|
@milestones.find(_.milestoneId == condition.milestoneId.get.get).map { milestone =>
|
||||||
<div class="milestone-progress" style="margin-top: 8px;">
|
<div class="milestone-progress" style="margin-top: 8px;">
|
||||||
@if(closedCount > 0){
|
@if(closedCount > 0){
|
||||||
<span class="milestone-progress" style="width: @((closedCount.toDouble / (openCount + closedCount).toDouble * 100).toInt)%;"></span>
|
<span class="milestone-progress" style="width: @((closedCount.toDouble / (openCount + closedCount).toDouble * 100).toInt)%;"></span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<span class="muted small">@openCount open issues</span>
|
<span class="muted small">@openCount open issues</span>
|
||||||
|
@if(milestone.closedDate.isDefined){
|
||||||
|
@milestone.closedDate.map { closedDate =>
|
||||||
|
<span class="small">Closed in @date(closedDate)</span>
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
@milestone.dueDate.map { dueDate =>
|
||||||
|
@if(isPast(dueDate)){
|
||||||
|
<img src="@assets/common/images/alert.png"/><span class="small milestone-alert">Due in @date(dueDate)</span>
|
||||||
|
} else {
|
||||||
|
<span class="small">Due in @date(dueDate)</span>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
<hr/>
|
<hr/>
|
||||||
<strong>Labels</strong>
|
<strong>Labels</strong>
|
||||||
|
|||||||
@@ -42,9 +42,13 @@
|
|||||||
@if(milestone.closedDate.isDefined){
|
@if(milestone.closedDate.isDefined){
|
||||||
<span class="muted">Closed @datetime(milestone.closedDate.get)</span>
|
<span class="muted">Closed @datetime(milestone.closedDate.get)</span>
|
||||||
} else {
|
} else {
|
||||||
@if(milestone.dueDate.isDefined){
|
@milestone.dueDate.map { dueDate =>
|
||||||
<span class="muted">Due in @date(milestone.dueDate.get)</span>
|
@if(isPast(dueDate)){
|
||||||
|
<img src="@assets/common/images/alert.png"/><span class="muted milestone-alert">Due in @date(dueDate)</span>
|
||||||
} else {
|
} else {
|
||||||
|
<span class="muted">Due in @date(dueDate)</span>
|
||||||
|
}
|
||||||
|
}.getOrElse {
|
||||||
<span class="muted">No due date</span>
|
<span class="muted">No due date</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -441,10 +441,16 @@ a#clear-filter {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.milestone-alert {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #bd2c00;
|
||||||
|
}
|
||||||
|
|
||||||
a.milestone-title {
|
a.milestone-title {
|
||||||
font-size: 120%;
|
font-size: 120%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.milestone-description {
|
div.milestone-description {
|
||||||
border-top: 1px solid #eee;
|
border-top: 1px solid #eee;
|
||||||
color: #666;
|
color: #666;
|
||||||
|
|||||||
BIN
src/main/webapp/assets/common/images/alert.png
Normal file
BIN
src/main/webapp/assets/common/images/alert.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 185 B |
Reference in New Issue
Block a user