mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 19:45:57 +01:00
Implementing label management.
This commit is contained in:
31
src/main/twirl/issues/labeledit.scala.html
Normal file
31
src/main/twirl/issues/labeledit.scala.html
Normal file
@@ -0,0 +1,31 @@
|
||||
@(label: Option[model.Label], repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@defining((if(label.isEmpty) ("new", 190, 4) else ("edit", 180, 8))){ case (mode, width, margin) =>
|
||||
<form method="POST" action="@path/@repository.owner/@repository.name/issues/label/@mode" validate="true" @if(mode == "edit"){ style="margin-bottom: 8px;"}>
|
||||
<span id="error-@(mode)LabelName" class="error"></span>
|
||||
<input type="text" name="@(mode)LabelName" id="@(mode)LabelName" style="width: @(width)px; margin-left: @(margin)px; margin-bottom: 0px;" value="@label.map(_.labelName)"@if(mode == "new"){ placeholder="New label name"}/>
|
||||
<div id="@(mode)LabelForm"@if(mode == "new"){ style="display: none;"}>
|
||||
<span id="error-@(mode)Color" class="error"></span>
|
||||
<div class="input-append color bscp" data-color="#@label.map(_.color).getOrElse("888888")" data-color-format="hex" id="@(mode)Color" style="width: @(width)px; margin-bottom: 0px;">
|
||||
<input type="text" class="span3" name="@(mode)Color" value="@label.map(_.color)" readonly style="width: @(width - 12)px; margin-left: @(margin)px;">
|
||||
<span class="add-on"><i style="background-color: #@label.map(_.color).getOrElse("888888");"></i></span>
|
||||
</div>
|
||||
<input type="submit" class="btn" style="margin-left: @(margin)px; margin-bottom: 0px;" value="@if(mode == "new"){Create} else {Save}"/>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
@if(mode == "new"){
|
||||
$(function(){
|
||||
$('#newColor').colorpicker();
|
||||
|
||||
$('#newLabelName').focus(function(){
|
||||
if($('#newLabelForm').css('display') == 'none'){
|
||||
$('#newLabelForm').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$('#editColor').colorpicker();
|
||||
}
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user