Commit 7e4f12b3 authored by Alina Habibulina's avatar Alina Habibulina

auth form -v4

parent 06e1d4c2
......@@ -55,4 +55,4 @@
background-color: #49b785;
border-color: #49b785;
color: #ffffff;
}
\ No newline at end of file
}
......@@ -18,6 +18,6 @@
<div id ="form_player_container" align ="center">
<div id ="form_player_div" ></div>
</div>
<div id="authForm"></div>
<div id ="authForm"></div>
</body>
</html>
\ No newline at end of file
......@@ -7,22 +7,19 @@ var portal = {
player : null,
clearPlayer : function() {
if(portal.player) {
portal.player.destroy();
}
},
createPlayer : function(formCode){
createPlayer : function(dataId){
portal.clearPlayer();
portal.player = AS.FORMS.createPlayer();
portal.player.showFormByCode(formCode);
portal.player.view.appendTo($('#form_player_div'));
}
};
AS.SERVICES.unAuthorized = function()
{
CreateAuthForm();
portal.player.view.setEditable(_.isUndefined(dataId));
portal.player.showFormData("097a00e2-430c-436d-92e5-c2ea8edc5b30", 1, dataId);
portal.player.view.appendTo($('#form_player_div'));
}
};
function CreateAuthForm(){
......@@ -81,19 +78,19 @@ var authFunc = function(){
jQuery(".submit").on( "click", function(event){
AS.OPTIONS.login = $("input#login").val();
AS.OPTIONS.password = $("input#password").val();
var xhr = new XMLHttpRequest();
AS.FORMS.ApiUtils.simpleAsyncGet('rest/api', xhr);
if (xhr.status != 200) {
portal.createPlayer();
$(".form_player_container").show();
portal.createPlayer("timesheet");
$(".login-form").remove();
} else {
CreateAuthForm();
}
});
};
AS.SERVICES.unAuthorized = function()
{
$(".authForm").remove();
CreateAuthForm();
};
$(document).ready(function(){
CreateAuthForm();
$(".error").hide();
});
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment