1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-21 10:51:17 +00:00

[login] modified UI

This commit is contained in:
llj
2017-07-15 14:16:21 +08:00
parent 60ce1a6bd8
commit 0cd68a9a64
4 changed files with 32 additions and 21 deletions

View File

@@ -83,6 +83,7 @@
.icon-cloud-download:before { content: "\f0ed"; } .icon-cloud-download:before { content: "\f0ed"; }
.icon-download:before { content: "\f01a"; } .icon-download:before { content: "\f01a"; }
.icon-trash:before { content: "\f014"; } .icon-trash:before { content: "\f014"; }
.icon-refresh:before { content: "\f021"; }
.icon-plus:before { content: "\f067"; } .icon-plus:before { content: "\f067"; }
.icon-minus:before { content: "\f068"; } .icon-minus:before { content: "\f068"; }
.icon-pencil:before { content: "\f040"; } .icon-pencil:before { content: "\f040"; }
@@ -1975,6 +1976,9 @@ button.sf-dropdown-toggle:focus {
.captcha { .captcha {
float:right; float:right;
} }
#refresh-captcha {
margin:10px 3px 0 5px;
}
#id_captcha_1 { #id_captcha_1 {
width:auto; width:auto;
height:36px; height:36px;
@@ -1983,11 +1987,12 @@ button.sf-dropdown-toggle:focus {
margin:0; margin:0;
} }
.login-panel { .login-panel {
background:#f4eaea; background:#f5f6f7;
border-radius:3px; border-radius:3px;
padding:10px 60px 20px; padding:20px 60px;
width:390px; width:390px;
margin:0 auto; margin:0 auto;
box-shadow:0 0 8px #a7a6a9;
} }
@media (max-width:389px) { @media (max-width:389px) {
.login-panel { .login-panel {
@@ -1996,9 +2001,15 @@ button.sf-dropdown-toggle:focus {
padding-right: calc((100% - 270px)/2); padding-right: calc((100% - 270px)/2);
} }
} }
.login-panel .logo { .login-panel-logo {
display:block; display:block;
margin:0 auto 18px; margin:0 auto 20px;
}
.login-panel-hd {
font-size:18px;
font-weight:normal;
text-align:center;
margin:5px 0 15px;
} }
.login-panel .input { .login-panel .input {
margin:0; margin:0;
@@ -2019,9 +2030,6 @@ button.sf-dropdown-toggle:focus {
.login-panel .remember { .login-panel .remember {
margin:20px 0 10px; margin:20px 0 10px;
} }
.login-panel .forgot-passwd {
margin-left:18px;
}
.login-panel .submit { .login-panel .submit {
margin:20px 0 15px; margin:20px 0 15px;
border-width:0; border-width:0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 297 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -28,16 +28,18 @@ html, body, #wrapper { height:100%; }
{% endblock %} {% endblock %}
{% block main_content %} {% block main_content %}
<div class="login-panel vh"> <div class="login-panel-outer-container vh">
<img src="{{MEDIA_URL}}img/seafile-transparent-128.png" alt="" width="64" class="logo" /> <div class="login-panel">
<h1 class="login-panel-hd">{% trans "Log In" %}</h1>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
<input type="text" name="login" placeholder="{% trans "Email or Username" %}" value="" class="input name-input" /><br /> <input type="text" name="login" placeholder="{% trans "Email or Username" %}" value="" class="input name-input" /><br />
<input type="password" name="password" placeholder="{% trans "Password" %}" value="" class="input passwd-input" autocomplete="off" /> <input type="password" name="password" placeholder="{% trans "Password" %}" value="" class="input passwd-input" autocomplete="off" />
{% if form.captcha %} {% if form.captcha %}
{{ form.captcha }} <div class="ovhd">
<p class="clear"><a href="#" id="refresh-captcha">{% trans "Not clear? Refresh it." %}</a></p> <span id="refresh-captcha" title="{% trans "Refresh" %}" class="icon-refresh op-icon fright"></span>
{{ form.captcha }}
</div>
{% endif %} {% endif %}
<input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" /> <input type="hidden" name="next" value="{% if next %}{{ next|escape }}{% else %}{{ SITE_ROOT }}{% endif %}" />
@@ -82,22 +84,24 @@ html, body, #wrapper { height:100%; }
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
{% endblock %} {% endblock %}
{% block extra_script %} {% block extra_script %}
<script type="text/javascript"> <script type="text/javascript">
$('.login-panel-outer-container').prepend($($('#logo').html()).addClass('login-panel-logo'));
$('.login-panel-bottom-container').append($('#lang').removeClass('fright')); $('.login-panel-bottom-container').append($('#lang').removeClass('fright'));
var $loginPanel = $('.login-panel'); var $el = $('.login-panel-outer-container');
var loginPanelHeight = $loginPanel.outerHeight(); var elHeight = $el.outerHeight();
var wdHeight = $(window).height(); var wdHeight = $(window).height();
if (wdHeight > loginPanelHeight) { if (wdHeight > elHeight) {
$loginPanel.css({'margin-top': (wdHeight - loginPanelHeight)/2}); $el.css({'margin-top': (wdHeight - elHeight)/2});
} }
$loginPanel.removeClass('vh') $el.removeClass('vh');
$('#lang-context-selector').css({ $('#lang-context-selector').css({
'top': '-' + $('#lang').offset().top + 'px', 'top': '-' + ($('#lang').offset().top - 5) + 'px',
'right': 0 'right': 0
}); });
$('#lang-context-selector .sf-popover-con').css({ $('#lang-context-selector .sf-popover-con').css({
@@ -107,12 +111,10 @@ $('#lang-context-selector .sf-popover-con').css({
$('[name="login"]').focus(); $('[name="login"]').focus();
function setCaptchaInputWidth() { function setCaptchaInputWidth() {
$('#id_captcha_1').outerWidth($('.input').outerWidth() - $('.captcha').width() - 10); $('#id_captcha_1').outerWidth($('.input').outerWidth() - $('.captcha').width() - $('#refresh-captcha').outerWidth(true) - 10);
} }
$(window).load(setCaptchaInputWidth); $(window).load(setCaptchaInputWidth);
$('.captcha').load(setCaptchaInputWidth); $('.captcha').load(setCaptchaInputWidth);
$('#refresh-captcha').parent().css({'text-align':'right', 'margin':0});
$('#refresh-captcha').click(function() { $('#refresh-captcha').click(function() {
$.ajax({ $.ajax({
url: '{% url 'captcha-refresh' %}', url: '{% url 'captcha-refresh' %}',
@@ -128,6 +130,7 @@ $('#refresh-captcha').click(function() {
}); });
return false; return false;
}); });
$('input[type="submit"]').click(function(){ $('input[type="submit"]').click(function(){
if (!$.trim($('input[name="login"]').val())) { if (!$.trim($('input[name="login"]').val())) {
$('.error').removeClass('hide').html("{% trans "Email or username cannot be blank" %}"); $('.error').removeClass('hide').html("{% trans "Email or username cannot be blank" %}");