mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 05:55:51 +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),
|
||||
page,
|
||||
(getCollaborators(owner, repoName) :+ owner).sorted,
|
||||
getMilestones(owner, repoName).filter(_.closedDate.isEmpty),
|
||||
getMilestones(owner, repoName),
|
||||
getLabels(owner, repoName),
|
||||
countIssue(owner, repoName, condition.copy(state = "open"), 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 =
|
||||
s"${context.path}/assets"
|
||||
|
||||
def isPast(date: Date): Boolean = System.currentTimeMillis > date.getTime
|
||||
|
||||
/**
|
||||
* Implicit conversion to add mkHtml() to Seq[Html].
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||
</a>
|
||||
</li>
|
||||
@milestones.map { milestone =>
|
||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||
@@ -74,12 +74,27 @@
|
||||
}
|
||||
}
|
||||
@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;">
|
||||
@if(closedCount > 0){
|
||||
<span class="milestone-progress" style="width: @((closedCount.toDouble / (openCount + closedCount).toDouble * 100).toInt)%;"></span>
|
||||
}
|
||||
</div>
|
||||
<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/>
|
||||
<strong>Labels</strong>
|
||||
|
||||
@@ -42,9 +42,13 @@
|
||||
@if(milestone.closedDate.isDefined){
|
||||
<span class="muted">Closed @datetime(milestone.closedDate.get)</span>
|
||||
} else {
|
||||
@if(milestone.dueDate.isDefined){
|
||||
<span class="muted">Due in @date(milestone.dueDate.get)</span>
|
||||
@milestone.dueDate.map { dueDate =>
|
||||
@if(isPast(dueDate)){
|
||||
<img src="@assets/common/images/alert.png"/><span class="muted milestone-alert">Due in @date(dueDate)</span>
|
||||
} else {
|
||||
<span class="muted">Due in @date(dueDate)</span>
|
||||
}
|
||||
}.getOrElse {
|
||||
<span class="muted">No due date</span>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,10 +441,16 @@ a#clear-filter {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
span.milestone-alert {
|
||||
font-weight: bold;
|
||||
color: #bd2c00;
|
||||
}
|
||||
|
||||
a.milestone-title {
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.milestone-description {
|
||||
border-top: 1px solid #eee;
|
||||
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