Implementing label editing form.

This commit is contained in:
takezoe
2013-06-25 03:26:39 +09:00
parent 65ac07a0fe
commit 613e2a2be2
2 changed files with 25 additions and 3 deletions

View File

@@ -2,7 +2,9 @@
@import context._
@defining((if(label.isEmpty) ("new", 190, 4) else ("edit", 180, 8))){ case (mode, width, margin) =>
<div id="@(mode)LabelForm">
<form method="POST" action="@path/@repository.owner/@repository.name/issues/label/@mode" validate="true" @if(mode == "edit"){ style="margin-bottom: 8px;"}>
<form method="POST"
action="@path/@repository.owner/@repository.name/issues/label/@{if(mode == "new") "new" else label.get.labelId + "/edit"}"
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"}/>
<span id="error-@(mode)Color" class="error"></span>
@@ -26,6 +28,10 @@
$('#editLabelForm').click(function(e){
e.stopPropagation();
});
$.each($('form[validate=true]'), function(i, form){
$(form).submit(validate);
});
}
</script>
</div>