mirror of https://github.com/apache/archiva.git
[MRM-1598] use bootstrap css 2.x . fix modal login
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1239817 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
14d506abd7
commit
f7078be3dd
|
@ -289,13 +289,13 @@ displayRestError=function(data,idToAppend){
|
|||
* @param errorMap
|
||||
* @param errorList
|
||||
*/
|
||||
customShowError=function(validator, errorMap, errorList) {
|
||||
$( "#main-content div.clearfix" ).removeClass( "error" );
|
||||
$( "#main-content span.help-inline" ).remove();
|
||||
customShowError=function(formId, validator, errorMap, errorList) {
|
||||
$( "#"+formId+" div.control-group" ).removeClass( "error" );
|
||||
$( "#"+formId+" span.help-inline" ).remove();
|
||||
for ( var i = 0; errorList[i]; i++ ) {
|
||||
var error = errorList[i];
|
||||
var field = $("#"+error.element.id);
|
||||
field.parents( "div.clearfix" ).addClass( "error" );
|
||||
field.parents( "div.control-group" ).addClass( "error" );
|
||||
field.parent().append( "<span class=\"help-inline\">" + error.message + "</span>" );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,22 +18,22 @@
|
|||
-->
|
||||
<div id="modal-login" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<a href="#" class="close">×</a>
|
||||
<a href="#" class="close" data-dismiss="modal">×</a>
|
||||
<h3>${$.i18n.prop('login.section.title')}</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="modal-login-content">
|
||||
<form id="user-login-form">
|
||||
<div id="modal-login-err-message" class="alert-message error" style="display:none"></div>
|
||||
<form id="user-login-form" class="form-horizontal">
|
||||
<div id="modal-login-err-message" class="alert alert-error" style="display:none"></div>
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<label for="user-login-form-username">${$.i18n.prop('username')}</label>
|
||||
<div class="input">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="user-login-form-username">${$.i18n.prop('username')}</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="user-login-form-username" name="user-login-form-username" class="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label for="user-login-form-password">${$.i18n.prop('password')}</label>
|
||||
<div class="input">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="user-login-form-password">${$.i18n.prop('password')}</label>
|
||||
<div class="controls">
|
||||
<input type="password" id="user-login-form-password" name="user-login-form-password" class="required" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -41,7 +41,7 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class="modal-footer" id="modal-login-footer">
|
||||
<button class="btn primary" onclick="return login();" id="modal-login-ok">${$.i18n.prop('login')}</button>
|
||||
<button class="btn primary" id="modal-login-ok">${$.i18n.prop('login')}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -314,8 +314,10 @@ $(function() {
|
|||
loginBox=function(){
|
||||
|
||||
screenChange();
|
||||
if (window.modalLoginWindow!=null){
|
||||
window.modalLoginWindow=null;
|
||||
}
|
||||
if (window.modalLoginWindow==null) {
|
||||
$.log("window.modalLoginWindow==null");
|
||||
window.modalLoginWindow = $("#modal-login").modal();
|
||||
window.modalLoginWindow.bind('hidden', function () {
|
||||
$("#modal-login-err-message").hide();
|
||||
|
@ -324,18 +326,14 @@ $(function() {
|
|||
|
||||
$("#user-login-form").validate({
|
||||
showErrors: function(validator, errorMap, errorList) {
|
||||
customShowError(validator,errorMap,errorMap);
|
||||
customShowError("user-login-form",validator,errorMap,errorMap);
|
||||
}
|
||||
});
|
||||
$("#modal-login").delegate("#modal-login-ok", "click keydown keypress", function(e) {
|
||||
e.preventDefault();
|
||||
$.log("loginBox before login");
|
||||
login();
|
||||
});
|
||||
$("#modal-login").show();
|
||||
window.modalLoginWindow.modal('show');
|
||||
$.log("window.modalLoginWindow= modal show");
|
||||
$("#modal-login").focus();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue