Commit fa5b129b authored by Valentin Skripnikov's avatar Valentin Skripnikov

Merge branch 'a.habibulina-dev' into 'a.habibulina'

A.habibulina dev

See merge request !29
parents b017f1ba 55b90248
.login-form{
left: 50%;
transform: translate(-50%, 0);
width: 320px;
height: 230px;
background-color: white;
position: absolute;
border-color: #24282B;
border-style: none solid solid;
border-width: 1px;
top: 150px;
}
.header{
background-color: #4C5256;
position: relative;
padding: 12px;
color: white;
font-family: arial, tahoma, sans-serif;
font-size: 13pt;
font-weight: bold;
cursor: pointer;
}
.error{
margin-top: 5px;
color: red;
font-family: arial, tahoma, sans-serif;
font-size: 15pt;
}
.login{
position: static;
margin-top: 25px;
width: 250px;
display: inline-block;
height: 20px;
size: 50px;
}
.password {
position: static;
margin-top: 15px;
width: 250px;
display: inline-block;
height: 20px;
}
.submit{
margin-top: 15px;
width: 100px;
position: relative;
height: 35px;
border-radius: 5px;
background-color: #49b785;
border-color: #49b785;
color: #ffffff;
}
......@@ -5,17 +5,19 @@
<title>TimeSheet</title>
<script>
FORM_PLAYER_URL_PREFIX = "http:/intern-dev.arta.kz/Synergy/";
FORM_PLAYER_URL_PREFIX = "http://intern-dev.arta.kz/Synergy/";
</script>
<link rel ="stylesheet" href ="http://intern-dev.arta.kz/Synergy/js/form.player.css"/>
<script src ="http://intern-dev.arta.kz/Synergy/js/vendor.js" type ="text/javascript"></script>
<script src ="http://intern-dev.arta.kz/Synergy/js/form.player.js" type ="text/javascript"></script>
<script src ="js/Player.js"></script>
<link href ="css/beau.css" rel ="stylesheet"/>
</head>
<body>
<div id ="form_player_container">
<div id ="form_player_container" align ="center">
<div id ="form_player_div" ></div>
</div>
<div id ="authForm"></div>
</body>
</html>
\ No newline at end of file
......@@ -7,21 +7,90 @@ 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'));
}
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(){
var forma = document.createElement("form");
forma.className = "login-form";
forma.setAttribute('id',"login-form");
forma.setAttribute('align',"center");
var authHeader = document.createTextNode('Введите логин и пароль');
var authErr = document.createTextNode('Неверный логин или пароль');
var Hdiv = document.createElement("div");
Hdiv.className = "header";
Hdiv.appendChild(authHeader);
var Ediv = document.createElement("div");
Ediv.className = "error";
Ediv.appendChild(authErr);
Ediv.setAttribute('id',"error");
var textInp = document.createElement("input");
textInp.className = "login";
textInp.setAttribute('type',"text");
textInp.setAttribute('name',"login");
textInp.setAttribute('id',"login");
textInp.setAttribute('placeholder',"Логин");
textInp.setAttribute('align',"center");
var pasInp = document.createElement("input");
pasInp.className = "password";
pasInp.setAttribute('type',"password");
pasInp.setAttribute('name',"password");
pasInp.setAttribute('id',"password");
pasInp.setAttribute('placeholder',"Пароль");
pasInp.setAttribute('align',"center");
var submitBtn = document.createElement("input");
submitBtn.className = "submit";
submitBtn.setAttribute('type',"submit");
submitBtn.setAttribute('value',"Войти");
submitBtn.setAttribute('id',"submit");
submitBtn.setAttribute('align',"center");
forma.appendChild(Hdiv);
forma.appendChild(Ediv);
forma.appendChild(textInp);
forma.appendChild(pasInp);
forma.appendChild(submitBtn);
document.getElementById("authForm").appendChild(forma);
authFunc();
};
var authFunc = function(){
jQuery(".submit").on( "click", function(event){
AS.OPTIONS.login = $("input#login").val();
AS.OPTIONS.password = $("input#password").val();
portal.createPlayer();
$(".form_player_container").show();
$(".login-form").remove();
});
};
AS.SERVICES.unAuthorized = function()
{
$(".login-form").remove();
CreateAuthForm();
};
$(document).ready(function(){
AS.OPTIONS.login = "intern";
AS.OPTIONS.password = "intern";
portal.createPlayer("timesheet");
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