1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 21:30:39 +00:00

redesigned top nav

This commit is contained in:
llj
2014-01-17 13:34:55 +08:00
parent be11504f21
commit 0a13c6484b
16 changed files with 168 additions and 139 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -837,16 +837,15 @@ textarea:-moz-placeholder {/* for FF */
margin:0 auto; margin:0 auto;
} }
#header { #header {
padding:6px 0; padding:16px 0;
background:#f4f4f4; background:#f4f4f7 url('../img/nav.png') center top repeat-x;
border-bottom:1px solid #e3e4e5;
width:100%; width:100%;
font-size: 14px; font-size: 14px;
font-weight: bold;
border-bottom:1px solid #ddd;
margin-bottom:25px; margin-bottom:25px;
} }
#header-inner { #header-inner {
height:40px; height:32px;
width:950px; width:950px;
margin:0 auto; margin:0 auto;
} }
@@ -915,76 +914,54 @@ textarea:-moz-placeholder {/* for FF */
text-decoration:underline; text-decoration:underline;
} }
/* top-bar */ /* top-bar */
.top-bar-inner { #msg-count {
background:#2d2d2d; position:relative;
margin:10px 32px 0 25px;
cursor:pointer;
} }
.top-bar-con { #msg-count .num {
height:24px; position:absolute;
width:950px; color:#fff;
margin:0 auto; font-size:12px;
line-height:1;
padding:1px 2px;
background:#feac74;
border:1px solid #cb8a5d;
top:0;
left:15px;
}
#account {
position:relative; position:relative;
} }
.top-bar-con .account { #account .avatar {
text-align:right;
position:relative;
}
.top-bar-con .top-link {
display:inline-block;
height:24px;
padding:0 3px;
line-height:24px;
color:#ddd;
font-weight:normal;
vertical-align:middle; vertical-align:middle;
} border-radius:1000px;
.top-link .icon-wrench {
margin-right:7px;
}
.top-link .icon-caret-right {
margin-left:7px;
} }
#my-info { #my-info {
color:#fff; cursor: pointer;
font-weight:bold; color: #d6d6d6;
} }
.top-bar-con .spliter { #user-info-popup .avatar {
display:inline-block; float:left;
height:16px;
line-height:16px;
vertical-align:middle;
border-right:1px solid #aaa;
margin:0 3px;
} }
.top-bar-con .btn { #user-info-popup .txt {
padding:0 6px; margin-left:45px;
border-radius:2px;
line-height:16px;
margin-right:2px;
vertical-align:middle;
} }
.top-bar-con .msg-count { #account .manage {
color:red; position:absolute;
left:60px;
top:-16px;
} }
.top-bar-con .avatar { #account .manage .a:hover {
border-radius: 2px;
vertical-align:middle;
}
.top-bar-con .top-link:hover {
text-decoration:none; text-decoration:none;
background:#a0a;
} }
#lang-context-selector { #lang-context-selector {
position:absolute; position:absolute;
top:24px; top:60px;
text-align:left;
border:1px solid #bbb; border:1px solid #bbb;
background:#fff; background:#fff;
min-width:65px;
padding:5px 0; padding:5px 0;
z-index: 1000;
box-shadow: 0 2px 4px rgba(0,0,0,.2); box-shadow: 0 2px 4px rgba(0,0,0,.2);
-moz-box-shadow: -1px 1px 1px rgba(0,0,0,.2);
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,.2);
} }
#lang-context-selector a, #lang-context-selector a,
#to-group a { #to-group a {
@@ -998,9 +975,6 @@ textarea:-moz-placeholder {/* for FF */
background:#eee; background:#eee;
text-decoration:none; text-decoration:none;
} }
.top-bar-con .icon-signout {
font-size:15px;
}
#send-msg-popup, #send-msg-popup,
#user-info-popup { #user-info-popup {
background:#fff; background:#fff;
@@ -1018,13 +992,18 @@ textarea:-moz-placeholder {/* for FF */
#user-info-popup { #user-info-popup {
width:200px; width:200px;
text-align:left; text-align:left;
top:24px; top:48px;
font-size:13px;
} }
#user-info-popup .item { #user-info-popup .item {
display:block; display:block;
padding:8px 18px; padding:8px 18px;
border-top:1px solid #ddd; border-top:1px solid #ddd;
} }
#user-info-popup a.item {
color:#333;
font-weight:normal;
}
#user-info-popup a.item:hover { #user-info-popup a.item:hover {
background:#fafafa; background:#fafafa;
text-decoration:none; text-decoration:none;
@@ -1068,7 +1047,7 @@ textarea:-moz-placeholder {/* for FF */
} }
#header .nav { #header .nav {
float:left; float:left;
padding-top:16px; padding-top:8px;
font-size:15px; font-size:15px;
} }
#header .nav li { #header .nav li {
@@ -2479,7 +2458,7 @@ textarea:-moz-placeholder {/* for FF */
position:relative; position:relative;
} }
#top-search-form { #top-search-form {
margin-top:14px; margin-top:7px;
} }
.search-input, .search-input,
.search-form .search-submit { .search-form .search-submit {
@@ -2489,7 +2468,7 @@ textarea:-moz-placeholder {/* for FF */
vertical-align:top; vertical-align:top;
} }
.search-input { .search-input {
width:172px; width:160px;
outline:0; outline:0;
} }
.search-form .icon-caret-down { .search-form .icon-caret-down {
@@ -2502,7 +2481,6 @@ textarea:-moz-placeholder {/* for FF */
width:500px; width:500px;
padding:18px; padding:18px;
height:auto; height:auto;
font-weight:normal;
box-shadow:0 0 10px #ddd; box-shadow:0 0 10px #ddd;
z-index:100;/* for pages with jquery tabs*/ z-index:100;/* for pages with jquery tabs*/
} }

BIN
media/img/admin_in.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
media/img/admin_out.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
media/img/bell.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
media/img/nav.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,4 +1,7 @@
$('.top-bar-con .account').css('margin-left', $('.top-bar-con .manage').width() + 10); $('.checkbox-orig').click(function() {
$(this).parent().toggleClass('checkbox-checked');
});
$('#title-panel, #left-panel, #right-panel').each(function() { // for ie 7 $('#title-panel, #left-panel, #right-panel').each(function() { // for ie 7
if ($(this).children().length == 0) { if ($(this).children().length == 0) {
$(this).addClass('hide'); $(this).addClass('hide');
@@ -21,7 +24,7 @@ $(document).ready(function(){
cache: false, cache: false,
success: function(data) { success: function(data) {
if (data['count'] > 0) { if (data['count'] > 0) {
msg_ct.html(data['count']).addClass('msg-count'); $('.num', msg_ct).html(data['count']).removeClass('hide');
} }
} }
}); });
@@ -50,8 +53,7 @@ $('#msg-count').click(function() {
cache: false, cache: false,
success: function(data) { success: function(data) {
loading_tip.addClass('hide'); loading_tip.addClass('hide');
popup.html(data['html']); $('#space-traffic').html(data['html']);
$('.item:first', popup).css({'border':0});
} }
}); });
} else { } else {
@@ -98,30 +100,6 @@ $("tr:gt(0)", $('table')).hover(
); );
$('input, textarea').placeholder(); $('input, textarea').placeholder();
$('.checkbox-orig').click(function() {
$(this).parent().toggleClass('checkbox-checked');
});
(function() {
var lang_context = $('#lang-context'),
lang_selector = $('#lang-context-selector');
$(window).load(function() { // after the small images, icons loaded.
lang_selector.css({'right': lang_context.parent().width() - lang_context.position().left - lang_context.outerWidth()});
});
lang_context.click(function() {
lang_selector.toggleClass('hide');
return false;
}).focus(function() { $(this).blur(); });
$(document).click(function(e) {
var element = e.target || e.srcElement;
if (element.id != 'lang-context-selector' && element.id != 'lang-context') {
lang_selector.addClass('hide');
}
});
})();
// clear repo enc info when log out // clear repo enc info when log out
$('#logout').click(function() { $('#logout').click(function() {

View File

@@ -9,7 +9,7 @@ except ImportError:
### User avatar settings ### ### User avatar settings ###
AVATAR_DEFAULT_SIZE = getattr(settings, 'AVATAR_DEFAULT_SIZE', 80) AVATAR_DEFAULT_SIZE = getattr(settings, 'AVATAR_DEFAULT_SIZE', 80)
AVATAR_STORAGE_DIR = getattr(settings, 'AVATAR_STORAGE_DIR', 'avatars') AVATAR_STORAGE_DIR = getattr(settings, 'AVATAR_STORAGE_DIR', 'avatars')
AVATAR_DEFAULT_URL = getattr(settings, 'AVATAR_DEFAULT_URL', 'avatar/img/default.jpg') AVATAR_DEFAULT_URL = getattr(settings, 'AVATAR_DEFAULT_URL', 'avatar/img/default.png')
AVATAR_DEFAULT_NON_REGISTERED_URL = getattr(settings, 'AVATAR_DEFAULT_NON_REGISTERED_URL', '/avatars/default-non-register.jpg') AVATAR_DEFAULT_NON_REGISTERED_URL = getattr(settings, 'AVATAR_DEFAULT_NON_REGISTERED_URL', '/avatars/default-non-register.jpg')
AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (AVATAR_DEFAULT_SIZE,)) AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (AVATAR_DEFAULT_SIZE,))

View File

@@ -8,6 +8,7 @@
<div class="side-textnav"> <div class="side-textnav">
<ul class="side-textnav-tabs"> <ul class="side-textnav-tabs">
<li class="tab"><a href="#user-basic-info">{% trans "Profile" %}</a></li> <li class="tab"><a href="#user-basic-info">{% trans "Profile" %}</a></li>
<li class="tab"><a href="#lang-setting">{% trans "Language" %}</a></li>
{% if not force_server_crypto %} {% if not force_server_crypto %}
<li class="tab"><a href="#enc-lib-setting">{% trans "Encrypted Libraries" %}</a></li> <li class="tab"><a href="#enc-lib-setting">{% trans "Encrypted Libraries" %}</a></li>
{% endif %} {% endif %}
@@ -61,6 +62,16 @@
</form> </form>
</div> </div>
<div class="setting-item" id="lang-setting">
<h3>{% trans "Language Setting" %}</h3>
<a href="#" id="lang-context" data-lang="{{ LANGUAGE_CODE }}">{{ LANGUAGE_CODE|language_name_local }} <span class="icon-caret-down"></span></a>
<ul id="lang-context-selector" class="hide">
{% for LANG in LANGUAGES %}
<li><a href="{% url 'i18n' %}?lang={{ LANG.0 }}">{{ LANG.1 }}</a></li>
{% endfor %}
</ul>
</div>
{% if not force_server_crypto %} {% if not force_server_crypto %}
<div class="setting-item" id="enc-lib-setting"> <div class="setting-item" id="enc-lib-setting">
<h3>{% trans "Encrypted Libraries Setting" %}</h3> <h3>{% trans "Encrypted Libraries Setting" %}</h3>
@@ -149,5 +160,25 @@ $('#default-lib-form').submit(function() {
return false; return false;
} }
}); });
(function() {
var lang_context = $('#lang-context'),
lang_selector = $('#lang-context-selector');
lang_context.parent().css({'position':'relative'});
lang_selector.css({'top': lang_context.position().top + lang_context.height() + 3});
lang_context.click(function() {
lang_selector.toggleClass('hide');
return false;
}).focus(function() { $(this).blur(); });
$(document).click(function(e) {
var element = e.target || e.srcElement;
if (element.id != 'lang-context-selector' && element.id != 'lang-context') {
lang_selector.addClass('hide');
}
});
})();
</script> </script>
{% endblock %} {% endblock %}

View File

@@ -223,7 +223,7 @@ AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png', '.jpeg', '.gif')
AVATAR_STORAGE_DIR = 'avatars' AVATAR_STORAGE_DIR = 'avatars'
AVATAR_HASH_USERDIRNAMES = True AVATAR_HASH_USERDIRNAMES = True
AVATAR_GRAVATAR_BACKUP = False AVATAR_GRAVATAR_BACKUP = False
AVATAR_DEFAULT_URL = '/avatars/default.jpg' AVATAR_DEFAULT_URL = '/avatars/default.png'
AVATAR_DEFAULT_NON_REGISTERED_URL = '/avatars/default-non-register.jpg' AVATAR_DEFAULT_NON_REGISTERED_URL = '/avatars/default-non-register.jpg'
AVATAR_MAX_AVATARS_PER_USER = 1 AVATAR_MAX_AVATARS_PER_USER = 1
AVATAR_CACHE_TIMEOUT = 14 * 24 * 60 * 60 AVATAR_CACHE_TIMEOUT = 14 * 24 * 60 * 60
@@ -305,8 +305,8 @@ SITE_NAME = 'Seafile'
# Path to the Logo Imagefile (relative to the media path) # Path to the Logo Imagefile (relative to the media path)
LOGO_PATH = 'img/seafile_logo.png' LOGO_PATH = 'img/seafile_logo.png'
# logo size. the unit is 'px' # logo size. the unit is 'px'
LOGO_WIDTH = 156 LOGO_WIDTH = 149
LOGO_HEIGHT = 39 LOGO_HEIGHT = 32
# css to modify the seafile css (e.g. css/my_site.css) # css to modify the seafile css (e.g. css/my_site.css)
BRANDING_CSS = '' BRANDING_CSS = ''

View File

@@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block sys_admin %}<a href="{{ SITE_ROOT }}home/my/" class="top-link">{% trans "Exit System Admin" %}<span class="icon-caret-right"></span></a>{% endblock %} {% block sys_admin %}<a href="{{ SITE_ROOT }}home/my/" title="{% trans "Exit System Admin" %}"><img src="{{ MEDIA_URL }}img/admin_out.png" alt="" /></a>{% endblock %}
{% block nav %} {% block nav %}
<ul class="nav"> <ul class="nav">

View File

@@ -30,43 +30,6 @@
{% endif %} {% endif %}
{% endblock info_bar_message %} {% endblock info_bar_message %}
<div id="top-bar">
<div class="top-bar-inner">
<div class="top-bar-con">
{% if request.user.is_staff %}
<div class="manage fleft">
{% block sys_admin %}<a href="{{ SITE_ROOT }}sys/useradmin/" class="top-link"><span class="icon-wrench"></span>{% trans "System Admin" %}</a>{% endblock %}
</div>
{% endif %}
<div class="account">
{% if request.user.is_authenticated %}
{% avatar request.user 16 %} <a href="#" data-url="{% url 'space_and_traffic' %}" class="top-link" id="my-info">{{ request.user }} <span class="icon-caret-down"></span></a>
<div id="user-info-popup" class="hide">
<img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
</div>
<span class="spliter"></span>
<button class="btn" data-cturl="{% url 'unseen_notices_count' %}" data-pgurl="{% url 'user_notification_list' %}" id="msg-count" title="{% trans "unread notices" %}">0</button>
{% else %}
<a href="{{ SITE_ROOT }}accounts/login/" class="top-link">{% trans "Log In" %}</a>
{% if enable_signup %}
<a href="{{ SITE_ROOT }}accounts/register/" class="top-link">{% trans "Signup" %}</a>
{% endif %}
{% endif %}
<a href="#" id="lang-context" data-lang="{{ LANGUAGE_CODE }}" class="top-link">{{ LANGUAGE_CODE|language_name_local }} <span class="icon-caret-down"></span></a>
<ul class="hide" id="lang-context-selector">
{% for LANG in LANGUAGES %}
<li><a href="{% url 'i18n' %}?lang={{ LANG.0 }}">{{ LANG.1 }}</a></li>
{% endfor %}
</ul>
{% if request.user.is_authenticated %}
<a href="{{ SITE_ROOT }}accounts/logout/" class="icon-signout top-link" title="{% trans "Log out" %}" id="logout"></a>
{% endif %}
</div>
</div>
</div>
</div>
<div id="header"> <div id="header">
<div id="header-inner"> <div id="header-inner">
{% block notice_panel %}{% endblock %} {% block notice_panel %}{% endblock %}
@@ -79,9 +42,43 @@
</a> </a>
{% block nav %}{% endblock %} {% block nav %}{% endblock %}
{% if has_file_search and request.user.is_authenticated %} {% if request.user.is_authenticated %}
<div class="fright">
{% if has_file_search %}
{% include 'snippets/search_form.html' %} {% include 'snippets/search_form.html' %}
{% endif %} {% endif %}
<div data-cturl="{% url 'unseen_notices_count' %}" data-pgurl="{% url 'user_notification_list' %}" id="msg-count" title="{% trans "unread notices" %}" class="fleft">
<img src="{{ MEDIA_URL }}img/bell.png" alt="" />
<span class="num hide">0</span>
</div>
<div id="account" class="fright">
<div id="my-info" data-url="{% url 'space_and_traffic' %}">
{% avatar request.user 36 %} <span class="icon-caret-down vam"></span>
</div>
<div id="user-info-popup" class="hide">
<div class="item ovhd">
{% avatar request.user 36 %}
<div class="txt">
{{ request.user.username|email2nickname }} <br />
{{ request.user.username}}
</div>
</div>
<div id="space-traffic">
<img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
</div>
<a class="item" href="{{ SITE_ROOT }}profile/">{% trans "Settings" %}</a>
<a href="{{ SITE_ROOT }}accounts/logout/" class="item" title="{% trans "Log out" %}" id="logout">{% trans "Log out" %}</a>
</div>
{% if request.user.is_staff %}
<div class="manage">
{% block sys_admin %}<a href="{{ SITE_ROOT }}sys/useradmin/" title="{% trans "System Admin" %}" class="a"><img src="{{ MEDIA_URL }}img/admin_in.png" alt="" /></a>{% endblock %}
</div>
{% endif %}
</div>
</div>
{% endif %}
</div> </div>
</div> </div>

View File

@@ -1,6 +1,32 @@
{% extends "myhome_base.html" %} {% extends "myhome_base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Log In" %}{% endblock %} {% block title %}{% trans "Log In" %}{% endblock %}
{% block extra_style %}
<style type="text/css">
#lang {
font-weight:normal;
font-size:13px;
margin-top:12px;
}
#lang-context:hover {
text-decoration:none;
}
</style>
{% endblock %}
{% block nav %}
<div class="fright" id="lang">
<a href="#" id="lang-context" data-lang="{{ LANGUAGE_CODE }}">{{ LANGUAGE_CODE|language_name_local }} <span class="icon-caret-down"></span></a>
<ul id="lang-context-selector" class="hide">
{% for LANG in LANGUAGES %}
<li><a href="{% url 'i18n' %}?lang={{ LANG.0 }}">{{ LANG.1 }}</a></li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% block main_panel %} {% block main_panel %}
<div class="narrow-panel"> <div class="narrow-panel">
<h2>{% trans "Log In" %}</h2> <h2>{% trans "Log In" %}</h2>
@@ -79,5 +105,26 @@ $(function() {
$(this).attr('tabindex', index + 1); $(this).attr('tabindex', index + 1);
}); });
}); });
(function() {
var lang_context = $('#lang-context'),
lang_selector = $('#lang-context-selector');
lang_context.parent().css({'position':'relative'});
lang_selector.css({'top': lang_context.position().top + lang_context.height() + 3});
lang_context.click(function() {
lang_selector.toggleClass('hide');
return false;
}).focus(function() { $(this).blur(); });
$(document).click(function(e) {
var element = e.target || e.srcElement;
if (element.id != 'lang-context-selector' && element.id != 'lang-context') {
lang_selector.addClass('hide');
}
});
})();
</script> </script>
{% endblock %} {% endblock %}

View File

@@ -1,5 +1,5 @@
{% load i18n %} {% load i18n %}
<form id="top-search-form" method="get" action="{% url 'search' %}" class="search-form fright"> <form id="top-search-form" method="get" action="{% url 'search' %}" class="search-form fleft">
{% if search_repo_id %} {% if search_repo_id %}
<input class="search-input" name="q" placeholder="{% if search_wiki %}{% trans "Search files in this wiki" %}{% else %}{% trans "Search files in this library" %}{% endif %}" value="{{ keyword }}" /> <input class="search-input" name="q" placeholder="{% if search_wiki %}{% trans "Search files in this wiki" %}{% else %}{% trans "Search files in this library" %}{% endif %}" value="{{ keyword }}" />
<input type="hidden" name="search_repo" value="{{ search_repo_id }}" /> <input type="hidden" name="search_repo" value="{{ search_repo_id }}" />

View File

@@ -23,5 +23,3 @@
{% if ENABLE_PAYMENT %} {% if ENABLE_PAYMENT %}
<a class="item" href="{% url 'plan' %}">{% trans "Payment" %}</a> <a class="item" href="{% url 'plan' %}">{% trans "Payment" %}</a>
{% endif %} {% endif %}
<a class="item" href="{{ SITE_ROOT }}profile/">{% trans "Settings" %}</a>