(refs #151)Add unique checking to group creation.

This commit is contained in:
takezoe
2013-10-14 14:44:26 +09:00
parent 83107c7974
commit 0e7078c479
3 changed files with 22 additions and 8 deletions

View File

@@ -48,7 +48,7 @@ trait UserManagementControllerBase extends AccountManagementControllerBase {
)(EditUserForm.apply) )(EditUserForm.apply)
val newGroupForm = mapping( val newGroupForm = mapping(
"groupName" -> trim(label("Group name" , text(required, maxlength(100), identifier))), "groupName" -> trim(label("Group name" , text(required, maxlength(100), identifier, uniqueUserName))),
"url" -> trim(label("URL" , optional(text(maxlength(200))))), "url" -> trim(label("URL" , optional(text(maxlength(200))))),
"fileId" -> trim(label("File ID" , optional(text()))), "fileId" -> trim(label("File ID" , optional(text()))),
"memberNames" -> trim(label("Member Names" , optional(text()))) "memberNames" -> trim(label("Member Names" , optional(text())))

View File

@@ -8,12 +8,16 @@
<div class="span7"> <div class="span7">
<fieldset> <fieldset>
<label for="groupName" class="strong">Group name</label> <label for="groupName" class="strong">Group name</label>
<div>
<span id="error-groupName" class="error"></span> <span id="error-groupName" class="error"></span>
</div>
<input type="text" name="groupName" id="groupName" value="@account.map(_.userName)"@if(account.isDefined){ readonly}/> <input type="text" name="groupName" id="groupName" value="@account.map(_.userName)"@if(account.isDefined){ readonly}/>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label class="strong">URL (Optional)</label> <label class="strong">URL (Optional)</label>
<div>
<span id="error-url" class="error"></span> <span id="error-url" class="error"></span>
</div>
<input type="text" name="url" id="url" style="width: 300px;" value="@account.map(_.url)"/> <input type="text" name="url" id="url" style="width: 300px;" value="@account.map(_.url)"/>
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@@ -7,7 +7,9 @@
<div class="span6"> <div class="span6">
<fieldset> <fieldset>
<label for="userName" class="strong">Username:</label> <label for="userName" class="strong">Username:</label>
<div>
<span id="error-userName" class="error"></span> <span id="error-userName" class="error"></span>
</div>
<input type="text" name="userName" id="userName" value="@account.map(_.userName)"@if(account.isDefined){ readonly}/> <input type="text" name="userName" id="userName" value="@account.map(_.userName)"@if(account.isDefined){ readonly}/>
</fieldset> </fieldset>
@if(account.map(_.password.nonEmpty).getOrElse(true)){ @if(account.map(_.password.nonEmpty).getOrElse(true)){
@@ -19,18 +21,24 @@
} }
: :
</label> </label>
<div>
<span id="error-password" class="error"></span> <span id="error-password" class="error"></span>
</div>
<input type="password" name="password" id="password" value="" autocomplete="off"/> <input type="password" name="password" id="password" value="" autocomplete="off"/>
</fieldset> </fieldset>
} }
<fieldset> <fieldset>
<label for="fullName" class="strong">Full Name:</label> <label for="fullName" class="strong">Full Name:</label>
<div>
<span id="error-fullName" class="error"></span> <span id="error-fullName" class="error"></span>
</div>
<input type="text" name="fullName" id="fullName" value="@account.map(_.fullName)"/> <input type="text" name="fullName" id="fullName" value="@account.map(_.fullName)"/>
</fieldset> </fieldset>
<fieldset> <fieldset>
<label for="mailAddress" class="strong">Mail Address:</label> <label for="mailAddress" class="strong">Mail Address:</label>
<div>
<span id="error-mailAddress" class="error"></span> <span id="error-mailAddress" class="error"></span>
</div>
<input type="text" name="mailAddress" id="mailAddress" value="@account.map(_.mailAddress)"/> <input type="text" name="mailAddress" id="mailAddress" value="@account.map(_.mailAddress)"/>
</fieldset> </fieldset>
<fieldset> <fieldset>
@@ -44,7 +52,9 @@
</fieldset> </fieldset>
<fieldset> <fieldset>
<label class="strong">URL (Optional):</label> <label class="strong">URL (Optional):</label>
<div>
<span id="error-url" class="error"></span> <span id="error-url" class="error"></span>
</div>
<input type="text" name="url" id="url" style="width: 400px;" value="@account.map(_.url)"/> <input type="text" name="url" id="url" style="width: 400px;" value="@account.map(_.url)"/>
</fieldset> </fieldset>
</div> </div>