* add events of login page.

This commit is contained in:
Catouse
2013-09-23 19:52:52 +08:00
parent 245e10b6b5
commit d3e19f9a2d
4 changed files with 131 additions and 6 deletions
+12
View File
@@ -539,6 +539,18 @@ class commonModel extends model
echo html::a(helper::createLink('misc', 'qrCode'), "<i class='icon-mobile-phone icon-large'></i>" . $lang->user->mobileLogin, '', "class='qrCode $color'");
}
/**
* Print QR code Link.
*
* @static
* @access public
* @return void
*/
public static function getQRCodeLink()
{
echo helper::createLink('misc', 'qrCode');
}
/**
* Diff two string. (see phpt)
*
+44 -1
View File
@@ -108,7 +108,10 @@ html,body{background-color: #036;}
width: 212px;
}
#login-panel .panel-content .button-s{
min-width: 120px;
width: 120px;
}
#login-panel .panel-content .button-c{
width: 88px;
}
#login-panel .panel-foot{
text-align: center;
@@ -117,5 +120,45 @@ html,body{background-color: #036;}
background-color: #e5e5e5;
border-top: 1px solid #dfdfdf;
}
.droppanel{
display: none;
margin: 0;
padding: 4px 0;
position: absolute;
left: 0;
top: 55px;
background-color: #fff;
-moz-box-shadow:0px 2px 6px rgba(0,0,0,0.5); -webkit-box-shadow:0px 2px 6px rgba(0,0,0,0.5); box-shadow:0px 2px 6px rgba(0,0,0,0.5);
z-index: 9999;
}
#langs{
left: -166px;
}
#qrcode{
left: -310px;
padding: 0;
}
#qrcode h4{
background-color: #e5e5e5;
line-height: 2em;
padding:5px 15px;
}
.droppanel li{
list-style: none;
min-width: 120px;
font-size: 14px;
}
.droppanel li a{
display: block;
padding: 8px 15px;
border-bottom: 1px dashed #eee;
}
.droppanel li a:hover{
background-color: #e5e5e5;
color: #333;
}
.droppanel li a.active{
background-color: #FAFFBD;
}
#poweredby{float: none; color: #eee;text-align: center;margin-top: 20px;}
#poweredby a{color: #fff;}
+25
View File
@@ -2,4 +2,29 @@ function setForm(){}
$(document).ready(function()
{
$('#account').focus();
$("#lang").click(function(event)
{
$("#langs").toggle();
event.stopPropagation();
});
$(document).click(function(event)
{
$("#langs").hide();
$("#qrcode").hide();
});
$("#langs a").click(function()
{
$("#langs a").removeClass('active');
$(this).addClass("active");
selectLang($(this).attr("data-value"));
});
$("#mobile").click(function(event) {
$("#qrcode").toggle();
event.stopPropagation();
return false;
});
})
+50 -5
View File
@@ -9,6 +9,7 @@
* @version $Id: login.html.php 5084 2013-07-10 01:31:38Z wyd621@gmail.com $
*/
include '../../common/view/header.lite.html.php';
// include '../../common/view/colorbox.html.php';
?>
<div id="container">
@@ -19,7 +20,15 @@ include '../../common/view/header.lite.html.php';
<div class="nav">
<a href="###" id="lang" class="btn" title="Change Language/更换语言/更換語言"><?php echo $config->langs[$this->app->getClientLang()]; ?> <i class="icon-caret-down"></i></a>
<a href="###" id="mobile" class="btn" title="<?php echo $lang->user->mobileLogin; ?>"><i class="icon-mobile-phone icon-2x"></i></a>
div.
<ul class="droppanel" id="langs">
<?php foreach($config->langs as $key => $value):?>
<li><a href="###" data-value="<?php echo $key; ?>" class="<?php echo $key==$this->app->getClientLang()?'active':''; ?>"><?php echo $value; ?></a></li>
<?php endforeach;?>
</ul>
<div class="droppanel" id="qrcode">
<h4><i class="icon-mobile-phone icon-large"></i> <?php echo $lang->user->mobileLogin ?></h4>
<img src="<?php commonModel::getQRCodeLink(); ?>" alt="">
</div>
</div>
</div>
<div class="panel-content" id="login-form">
@@ -50,9 +59,7 @@ include '../../common/view/header.lite.html.php';
</table>
</form>
</div>
<div class="panel-content" id="mobile-access">
</div>
<?php if(isset($demoUsers)):?>
<div id='demoUsers' class="panel-foot">
<span><?php echo $lang->user->loginWithDemoUser; ?></span>
@@ -77,4 +84,42 @@ include '../../common/view/header.lite.html.php';
</div>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
<!-- <form method='post' target='hiddenwin'>
<table align='center' class='table-4'>
<tr>
<td class='rowhead' valign='top'>Language:</td>
<td><?php echo html::select('lang', $config->langs, $this->app->getClientLang(), 'class=select-2 onchange=selectLang(this.value)');?></td>
</tr>
<tr>
<td></td>
<td id='keeplogin'>
<?php echo html::checkBox('keepLogin', $lang->user->keepLogin, $keepLogin);?>
<?php commonModel::printQRCodeLink('white');?>
</td>
</tr>
<tr>
<td colspan='2' class='a-center'>
<?php
echo html::submitButton($lang->login);
if($app->company->guest) echo html::linkButton($lang->user->asGuest, $this->createLink($config->default->module));
echo html::hidden('referer', $referer);
?>
</td>
</tr>
</table>
<?php if(isset($demoUsers)):?>
<div id='demoUsers'>
<?php
echo "<span>" . $lang->user->loginWithDemoUser . "</span>";
$sign = $config->requestType == 'GET' ? '&' : '?';
if(isset($demoUsers['productManager'])) echo html::a(inlink('login') . $sign . "account=productManager&password=123456", $demoUsers['productManager'], 'hiddenwin');
if(isset($demoUsers['projectManager'])) echo html::a(inlink('login') . $sign . "account=projectManager&password=123456", $demoUsers['projectManager'], 'hiddenwin');
if(isset($demoUsers['testManager'])) echo html::a(inlink('login') . $sign . "account=testManager&password=123456", $demoUsers['testManager'], 'hiddenwin');
if(isset($demoUsers['dev1'])) echo html::a(inlink('login') . $sign . "account=dev1&password=123456", $demoUsers['dev1'], 'hiddenwin');
if(isset($demoUsers['tester1'])) echo html::a(inlink('login') . $sign . "account=tester1&password=123456", $demoUsers['tester1'], 'hiddenwin');
?>
</div>
<?php endif;?>
</form> -->
<?php include '../../common/view/footer.lite.html.php';?>