mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-04 20:45:58 +01:00
Add check icon to pulldown.
This commit is contained in:
6
src/main/twirl/helper/checkicon.scala.html
Normal file
6
src/main/twirl/helper/checkicon.scala.html
Normal file
@@ -0,0 +1,6 @@
|
||||
@(condition: => Boolean)
|
||||
@if(condition){
|
||||
<i class="icon-ok"></i>
|
||||
} else {
|
||||
<i class="icon-white"></i>
|
||||
}
|
||||
@@ -20,10 +20,10 @@
|
||||
@if(hasWritePermission){
|
||||
<input type="hidden" name="assignedUserName" value=""/>
|
||||
@helper.html.dropdown {
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="">Clear assignee</a></li>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
<li class="divider"></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator">@collaborator</a></li>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-while"></i> @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,10 +32,10 @@
|
||||
@if(hasWritePermission){
|
||||
<input type="hidden" name="milestoneId" value=""/>
|
||||
@helper.html.dropdown {
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="">No milestone</a></li>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li>
|
||||
<li class="divider"></li>
|
||||
@milestones.map { milestone =>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId"><i class="icon-while"></i> @milestone.title</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,12 +74,15 @@
|
||||
$(function(){
|
||||
$('a.assign').click(function(){
|
||||
var userName = $(this).data('name');
|
||||
$('a.assign i.icon-ok').attr('class', 'icon-white');
|
||||
|
||||
if(userName == ''){
|
||||
$('#label-assigned').text('No one will be assigned');
|
||||
} else {
|
||||
$('#label-assigned').html($('<span>')
|
||||
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
|
||||
.append(' well be assigned'));
|
||||
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
$('input[name=assignedUserName]').val(userName);
|
||||
});
|
||||
@@ -87,11 +90,13 @@ $(function(){
|
||||
$('a.milestone').click(function(){
|
||||
var title = $(this).text();
|
||||
var milestoneId = $(this).data('id');
|
||||
$('a.milestone i.icon-ok').attr('class', 'icon-white');
|
||||
|
||||
if(milestoneId == ''){
|
||||
$('#label-milestone').text('No milestone');
|
||||
} else {
|
||||
$('#label-milestone').html($('<span>').append('Milestone: ').append($('<strong>').text(title)));
|
||||
$('a.milestone[data-id=' + milestoneId + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
$('input[name=milestoneId]').val(milestoneId);
|
||||
});
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
</span>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown {
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="">Clear assignee</a></li>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||
<li class="divider"></li>
|
||||
@collaborators.map { collaborator =>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator">@collaborator</a></li>
|
||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-white"></i> @collaborator</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,10 +53,10 @@
|
||||
</span>
|
||||
@if(hasWritePermission){
|
||||
@helper.html.dropdown {
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="">No milestone</a></li>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> No milestone</a></li>
|
||||
<li class="divider"></li>
|
||||
@milestones.map { milestone =>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId"><i class="icon-white"></i> @milestone.title</a></li>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,6 +149,13 @@
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
@if(issue.assignedUserName.isDefined){
|
||||
$('a.assign[data-name=@issue.assignedUserName] i').attr('class', 'icon-ok');
|
||||
}
|
||||
@if(issue.milestoneId.isDefined){
|
||||
$('a.milestone[data-id=@issue.milestoneId] i').attr('class', 'icon-ok');
|
||||
}
|
||||
|
||||
$('#edit').click(function(){
|
||||
$.get('@url(repository)/issues/_data/@issue.issueId',
|
||||
{
|
||||
@@ -167,12 +174,14 @@ $(function(){
|
||||
assignedUserName: userName
|
||||
},
|
||||
function(){
|
||||
$('a.assign i.icon-ok').attr('class', 'icon-white');
|
||||
if(userName == ''){
|
||||
$('#label-assigned').text('No one is assigned');
|
||||
} else {
|
||||
$('#label-assigned').html($('<span>')
|
||||
.append($('<a class="username strong">').attr('href', '@path/' + userName).text(userName))
|
||||
.append(' is assigned'));
|
||||
$('a.assign[data-name=' + userName + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -185,10 +194,12 @@ $(function(){
|
||||
milestoneId: milestoneId
|
||||
},
|
||||
function(){
|
||||
$('a.milestone i.icon-ok').attr('class', 'icon-white');
|
||||
if(milestoneId == ''){
|
||||
$('#label-milestone').text('No milestone');
|
||||
} else {
|
||||
$('#label-milestone').html($('<span>').append('Milestone: ').append($('<strong>').text(title)));
|
||||
$('a.milestone[data-id=' + milestoneId + '] i').attr('class', 'icon-ok');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,11 +53,23 @@
|
||||
}
|
||||
@helper.html.dropdown {
|
||||
@if(condition.milestoneId.isDefined){
|
||||
<li><a href="@condition.copy(milestoneId = None).toURL">Clear milestone filter</a></li>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = None).toURL">
|
||||
<i class="icon-remove-circle"></i> Clear milestone filter
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
<li><a href="@condition.copy(milestoneId = Some(None)).toURL">Issues with no milestone</a></li>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(None)).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(None)) Issues with no milestone
|
||||
</a>
|
||||
</li>
|
||||
@milestones.map { milestone =>
|
||||
<li><a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">@milestone.title</a></li>
|
||||
<li>
|
||||
<a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">
|
||||
@helper.html.checkicon(condition.milestoneId == Some(Some(milestone.milestoneId))) @milestone.title
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
||||
@@ -121,12 +133,36 @@
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="@condition.copy(sort="created", direction="desc").toURL">Newest</a></li>
|
||||
<li><a href="@condition.copy(sort="created", direction="asc" ).toURL">Oldest</a></li>
|
||||
<li><a href="@condition.copy(sort="comments", direction="desc").toURL">Most commented</a></li>
|
||||
<li><a href="@condition.copy(sort="comments", direction="asc" ).toURL">Least commented</a></li>
|
||||
<li><a href="@condition.copy(sort="updated", direction="desc").toURL">Recently updated</a></li>
|
||||
<li><a href="@condition.copy(sort="updated", direction="asc" ).toURL">Least recently updated</a></li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="created", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="comments", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="desc").toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="@condition.copy(sort="updated", direction="asc" ).toURL">
|
||||
@helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<table class="table table-bordered table-hover table-issues">
|
||||
|
||||
Reference in New Issue
Block a user