mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Remove uniqId from template arguments
This commit is contained in:
@@ -2,45 +2,45 @@
|
|||||||
prefix: String = "",
|
prefix: String = "",
|
||||||
style : String = "",
|
style : String = "",
|
||||||
right : Boolean = false,
|
right : Boolean = false,
|
||||||
filter: String = "",
|
filter: String = "")(body: Html)
|
||||||
uniqId: String = scala.util.Random.alphanumeric.take(4).mkString)(body: Html)
|
@defining(if(filter.isEmpty) "" else filter + "-" + scala.util.Random.alphanumeric.take(4).mkString){ filterId =>
|
||||||
@filterId = @{filter.toString.replaceAll("[^a-zA-Z0-9_]","_") + uniqId }
|
<div class="btn-group" @if(style.nonEmpty){style="@style"}>
|
||||||
<div class="btn-group" @if(style.nonEmpty){style="@style"}>
|
<button
|
||||||
<button
|
class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
|
||||||
class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
|
@if(value.isEmpty){
|
||||||
@if(value.isEmpty){
|
<i class="octicon octicon-gear"></i>
|
||||||
<i class="octicon octicon-gear"></i>
|
|
||||||
} else {
|
|
||||||
@if(prefix.nonEmpty){
|
|
||||||
<span class="muted">@prefix:</span>
|
|
||||||
}
|
|
||||||
<span class="strong">@value</span>
|
|
||||||
}
|
|
||||||
<span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<ul class="dropdown-menu@if(right){ pull-right}">
|
|
||||||
@if(filter.nonEmpty) {
|
|
||||||
<li><input id="@filterId-input" type="text" class="form-control input-sm dropdown-filter-input" placeholder="@filter"/></li>
|
|
||||||
}
|
|
||||||
@body
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@if(filter.nonEmpty) {
|
|
||||||
<script>
|
|
||||||
$(window).load(function(){
|
|
||||||
$('#@{filterId}-input').parent().click(function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
$('#@{filterId}-input').keyup(function() {
|
|
||||||
var inputVal = $('#@{filterId}-input').val();
|
|
||||||
$.each($('#@{filterId}-input').parent().parent().find('a'), function(index, elem) {
|
|
||||||
if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >=0 ) {
|
|
||||||
$(elem).parent().show();
|
|
||||||
} else {
|
} else {
|
||||||
$(elem).parent().hide();
|
@if(prefix.nonEmpty){
|
||||||
|
<span class="muted">@prefix:</span>
|
||||||
|
}
|
||||||
|
<span class="strong">@value</span>
|
||||||
}
|
}
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu@if(right){ pull-right}">
|
||||||
|
@if(filterId.nonEmpty) {
|
||||||
|
<li><input id="@filterId-input" type="text" class="form-control input-sm dropdown-filter-input" placeholder="@filter"/></li>
|
||||||
|
}
|
||||||
|
@body
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@if(filterId.nonEmpty) {
|
||||||
|
<script>
|
||||||
|
$(window).load(function(){
|
||||||
|
$('#@{filterId}-input').parent().click(function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
$('#@{filterId}-input').keyup(function() {
|
||||||
|
var inputVal = $('#@{filterId}-input').val();
|
||||||
|
$.each($('#@{filterId}-input').parent().parent().find('a'), function(index, elem) {
|
||||||
|
if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >=0 ) {
|
||||||
|
$(elem).parent().show();
|
||||||
|
} else {
|
||||||
|
$(elem).parent().hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
</script>
|
||||||
});
|
}
|
||||||
</script>
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user