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

improved several pages

This commit is contained in:
llj
2012-03-22 20:33:27 +08:00
parent 16ebf72499
commit b181af9598
9 changed files with 124 additions and 83 deletions

View File

@@ -1,25 +1,27 @@
body,div,h1,h2,h3,h4,h5,h6,p,ul,li,blockquote,form,input,img { margin:0; padding:0; }
body,div,h1,h2,h3,h4,h5,h6,p,ul,li,blockquote,form,input,button,img { margin:0; padding:0; }
ul > li { list-style:none; }
.error { color:red; }
.float_left { float:left; }
.hidden { display:none }
.clear { clear:both;line-height:0;font-size:0 }
.clear { clear:both; }
.fleft { float:left }
.fright { float:right }
.cleft { clear:left }
.show { display:block }
.hide { display:none }
.errorlist { color: red; }
.ovhd { overflow:hidden; }
.bold { font-weight:bold; }
.label { color:#333; font-size:12px; font-style:normal; }
a { color:#ee8833; text-decoration:none; font-weight:bold; }
a:hover { color: #ff9933; text-decoration: underline; }
/* table */
table.default { border: 1px solid; cellspacing: 0; border-collapse: collapse; }
table.default td, table.default th { padding: 3px; border: 1px solid #000; }
table.default th { color:#808; }
table.default tr.even { background-color: #FAFAFA; }
table.default tr.odd { background-color: #E0E0E0; }
table.default tr.first { background-color: #00FF00; }
table { border-spacing: 0; border-collapse: collapse; }
td, th { padding: 3px; border: 1px solid #aaa; }
th { color:#808; }
tr.even { background-color: #FAFAFA; }
tr.odd { background-color: #E0E0E0; }
tr.first { background-color: #00FF00; }
/* container */
#wrapper { font: 13px/1.5 Arial, Helvetica, sans-serif; }
#header, #main, #footer { width:950px; }
@@ -50,13 +52,14 @@ div.logo { margin-top: 0px; }
#header ul.nav { padding: 0; }
#header .nav li { float: left; height: 18px; padding: 0px 25px 4px 0; background: none; }
#header .nav a, #header .nav a:visited { color:#8A948F; font-weight:bold; text-decoration:none; }
#header .nav a.cur { color: #000; }
#header .nav a:hover { color: #ff9933; text-decoration: underline; }
div.nav-separator { clear: both; border-top: #DDD 1px solid; border-bottom: none; border-left: none; border-right: none; margin: 0px 0px 21px 0px; padding: 0px; }
/* footer */
#footer a { color:#333; text-decoration:none; }
/* main */
h2 { font-size:18px; color:#808; padding:4px 0 2px 0px; margin: 0; }
h3 { font-size:14px; color:#808; margin-top:10px; font-weight:normal; }
h2 { font-size:18px; color:#808; }
h3 { font-size:14px; color:#808; font-weight:normal; }
p { line-height: 20px; margin: 2px 0 12px 0; }
ol { margin:0; padding:0px 0 0 2em; list-style-position:inside; }
ul { padding:0 0 0 0; margin: 0 0 8px 0; }
@@ -78,10 +81,28 @@ ul > li { background: url('../img/li.gif') no-repeat scroll; background-position
.ele_info { float:right; width:450px; }
/* input button */
textarea { border: 1px solid #80B0B0; }
input { border: 1px solid #80B0B0; }
input[type=submit] { border: 1px solid #80B0B0; background: #EEE; color: #080; padding:0 2px; border-radius: 3px; -moz-border-radius:3px; }
input[type=submit]:hover { border: 1px solid #80B0B0; background: #FFF; }
#main form label { display: inline-block; margin:2px 0px; }
input {
height:20px;
line-height:20px;
margin:2px 0;
border: 1px solid #80B0B0;
}
input[type=submit], button { color: #080; height:25px; padding:3px 8px; background: #EEE; cursor:pointer; border: 1px solid #80B0B0; border-radius: 3px; -moz-border-radius:3px; margin-top:5px; }
input[type=submit]:hover, button:hover { border: 1px solid #80B0B0; background: #FFF; }
button {
margin:0;
}
label { display: inline-block; margin:2px 0px; }
#user-add-form label {
width:5em;
text-align:right;
}
#user-add-form .submit {
margin-left:5em;
}
.login .submit {
margin-left:3em;
}
/* form */
/* forms */
@@ -150,4 +171,4 @@ div.home-page h2 { font-style: italic; }
span.small-action-link { font-size: 9px; }
input.ccnet_id { width: 400px; }
.notification { background:#FDF; width:580px; margin:10px 0; border:1px solid #faf; padding-left:2px; }
.notification { background:#FDF; width:580px; margin:10px 0; border:1px solid #faf; padding:10px; }

View File

@@ -11,18 +11,19 @@
{% block right_panel %}
<h3>当前设置</h3>
<p>个人 ID: {{ profile.ccnet_user_id }}</p>
<h2>当前设置</h2>
<ul>
{% if profile.ccnet_user_id %}
<li><span class="bold">个人 ID</span>{{ profile.ccnet_user_id }}</li>
{% else %}
<li><span class="bold">个人 ID</span>您还没绑定。<a href="{% url profile_setting %}">现在绑定</a></li>
{% endif %}
{% if profile_timestamp %}
<p>加密后的帐号文件上传时间: {{ profile_timestamp }}
<a href="{{ SITE_ROOT }}profile/download/?user_id={{profile.ccnet_user_id}}">
点此下载
</a>
</p>
<li><span class="bold">帐号文件:</span>您的加密后的帐号文件上传{{ profile_timestamp }} <a href="{{ SITE_ROOT }}profile/download/?user_id={{profile.ccnet_user_id}}">点此下载</a></li>
{% else %}
<p>帐号文件未上传,请在本地 seafile 界面 "帐号" 标签下上传</p>
<li><span class="bold">帐号文件:</span>您的帐号文件还未上传,请在本地 seafile 界面 "帐号" 标签下上传</li>
{% endif %}
</ul>
{% endblock %}

View File

@@ -1,8 +1,9 @@
{% extends "myhome_base.html" %}
{% block title %}添加用户{% endblock %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block main_panel %}
<h2>添加用户</h2>
<form action="" method="post" class="reg">
<form action="" method="post" id="user-add-form">
<label for="id_email">邮箱:</label>
{{ form.email }}
{% if form.email.errors %}

View File

@@ -6,12 +6,9 @@
<meta name="keywords" content="文件 共享" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/seahub.css" />
<link rel="icon" type="image/png" href="{{ MEDIA_URL }}img/favicon.png" />
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.simplemodal.1.4.1.min.js"></script>
{% block extra_style %}{% endblock %}
</head>
<body>
@@ -20,7 +17,7 @@
<div class="top-bar">
<div class="top-bar-in">
{% if request.user.is_authenticated %}
欢迎, {{ request.user.email }}
欢迎, {{ request.user }}
<a href="{{ SITE_ROOT }}profile/">设置</a>
{% if request.user.is_staff %}
<a href="{{ SITE_ROOT }}admin/">管理</a>
@@ -34,9 +31,9 @@
</div>
</div>
<div id="header">
<div class="logo">
<div class="logo ovhd">
<img src="{{ MEDIA_URL }}img/logo.png" id="logo-img" title="Seafile" alt="Seafile logo" />
{% if request.user.is_authenticated %}
{% if request.user.user_id %}
<div id="user-info">
<span>个人 ID:</span>{{user.user_id}}
</div>
@@ -83,20 +80,18 @@
<div id="right-panel">
{% block right_panel %}{% endblock %}
</div>
<div id="main-panel">
<div id="main-panel" class="clear">
{% block main_panel %}{% endblock %}
</div>
<div class="clear"></div>
</div>
<div id="footer">
<div id="footer" class="ovhd">
<p class="fleft">Copyright © 2012 海文互知. All rights reserved.</p>
<p class="fright">Contact | About</p>
<div class="clear"></div>
</div>
</div><!-- wrapper -->
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.simplemodal.1.4.1.min.js"></script>
{% block extra_script %}{% endblock %}
</body>
</html>

View File

@@ -1,8 +1,9 @@
{% extends "myhome_base.html" %}
{% block nav_home_class %}class="cur"{% endblock %}
{% block left_panel %}
<h3>已用空间</h3>
{{ quota_usage|filesizeformat }} / 4 GB
<p>{{ quota_usage|filesizeformat }} / 4 GB</p>
{% endblock %}
@@ -10,7 +11,7 @@
{% if not user.user_id %}
<div class="notification">
你还没有绑定 Ccnet/Seafile 公钥 ID, 现在<a href="{{ SITE_ROOT }}profile/edit/">绑定</a>
你还没有绑定 Ccnet/Seafile 公钥 ID 现在<a href="{{ SITE_ROOT }}profile/edit/">绑定</a>
</div>
{% endif %}
@@ -19,7 +20,7 @@
{% else %}
<h3>{{ owner }}的同步目录</h3>
{% endif %}
{% if owned_repos %}
<table class="repo-list default">
<tr>
<th>名字</th>
@@ -37,12 +38,16 @@
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
{% if not owner %}
<h3>我用过的同步目录</h3>
{% else %}
<h3>{{ owner }}用过的同步目录</h3>
{% endif %}
{% if fetched_repos %}
<table class="repo-list default">
<tr>
<th>名字</th>
@@ -60,5 +65,7 @@
</tr>
{% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}
{% endblock %}

View File

@@ -2,14 +2,14 @@
{% block nav %}
<ul class="nav">
<li>
<a href="{{ SITE_ROOT }}home/my/">我的页面</a>
<a href="{{ SITE_ROOT }}home/my/" {% block nav_home_class %}{% endblock %}>我的页面</a>
</li>
{% if request.user.is_staff %}
<li>
<a href="{{ SITE_ROOT }}seafadmin/">目录管理</a>
</li>
<li>
<a href="{{ SITE_ROOT }}useradmin/">用户管理</a>
<a href="{{ SITE_ROOT }}useradmin/" {% block nav_useradmin_class %}{% endblock %}>用户管理</a>
</li>
{% endif %}
<li>

View File

@@ -3,14 +3,12 @@
{% block main_panel %}
<h2>用户登录</h2>
<form action="" method="post" class="login">
<label for="username"> 号:</label>
<input type="text" name="username" value="" id="username"><br />
<label for="password"> 码:</label>
<input type="password" name="password" value="" id="password"><br />
{% if form.errors %}
<p class="error">抱歉,您输入的用户名或密码不正确</p>
{% endif %}
<input type="submit" value="提交" class="lo-reg" />
<label for="username">帐号:</label>
<input type="text" name="username" value="用户名或注册邮箱" style="color:#666;" /><br />
<label for="password">密码:</label>
<input type="password" name="password" value="" /><br />
<p class="error hide"></p>
<input type="submit" value="提交" class="submit" />
<a href="{{ SITE_ROOT }}accounts/password/reset/">忘记密码?</a>
{% if next %}
<input type="hidden" name="next" value="{{ next|escape }}" />
@@ -18,13 +16,27 @@
<input type="hidden" name="next" value="{{ SITE_ROOT }}" />
{% endif %}
</form>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
document.getElementById('username').value = '用户名或注册邮箱';
document.getElementById('username').style.color = '#666';
document.getElementById('username').onclick = function() {
document.getElementById('username').value = '';
document.getElementById('username').style.color = '#000';
var Username_default = $.trim($('input[name="username"]').attr('value'));
$('input[name="username"]').click(function(){
$(this).attr('value','');
$(this).removeAttr('style');
});
$('input[type="submit"]').click(function(){
if ($.trim($('input[name="username"]').attr('value')) == Username_default || !$.trim($('input[name="username"]').attr('value'))) {
$('.error').removeClass('hide').html('请输入帐号。');
return false;
}
if (!$.trim($('input[name="password"]').attr('value'))) {
$('.error').removeClass('hide').html('请输入密码。');
return false;
}
});
{% if form.errors %}
$('.error').removeClass('hide').html('您输入的帐号或密码不正确');
{% endif %}
</script>
{% endblock %}

View File

@@ -4,8 +4,8 @@
{% block main_panel %}
<p>感谢参与.</p>
<p>感谢参与</p>
<p><a href="{{ SITE_ROOT }}accounts/login/" class="re_login">重新登录</a></p>
<a href="{{ SITE_ROOT }}accounts/login/">重新登录</a>
{% endblock %}

View File

@@ -1,6 +1,6 @@
{% extends "myhome_base.html" %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
{% block left_panel %}
<ul>
<li><a href="{{ SITE_ROOT }}useradmin/add/">添加用户</a></li>
@@ -11,23 +11,23 @@
{% block right_panel %}
<h2>所有用户</h2>
<table class="user-list default">
<table class="user-list">
<tr>
<th></th>
<td>是否激活</td>
<td>个人 ID</td>
<td>角色</td>
<td>操作</td>
<th></th>
<th>是否激活</th>
<th>个人 ID</th>
<th>角色</th>
<th>操作</th>
</tr>
{% for user in users %}
<tr>
<td>{{ user.email }}</td>
<td>{{ user.is_active }}
{% if not user.is_active %}
<span class="small-action-link">(<a href="{{ SITE_ROOT }}useradmin/activate/{{ user.id }}/">激活</a>)</span>
{% if user.is_active %}
<td>已激活</td>
{% else %}
<td><button data="{{ SITE_ROOT }}useradmin/activate/{{ user.id }}/" class="activate">激活</button></td>
{% endif %}
</td>
{% if user.profile %}
<td>{{ user.profile.ccnet_user_id }}</td>
<td>
@@ -68,26 +68,30 @@
{% endblock %}
{% block extra_script %}
<script>
<script type="text/javascript">
$('.activate').each(function(){
$(this).click(function(){
location.href = $(this).attr('data');
});
});
$(function() {
$(".add-role-btn").each(function(index, item) {
item.onclick = function() {
url = "{{ SITE_ROOT }}useradmin/" + $(item).attr("userid") + "/role/add/";
$("#add-role-form").attr( { action: url } );
$("#add-role-form #user_email").html($(item).attr("email"));
$(".add-role-btn").each(function() {
$(this).click(function() {
var url = "{{ SITE_ROOT }}useradmin/" + $(this).attr("userid") + "/role/add/";
$("#add-role-form").attr('action', url);
$("#add-role-form #user_email").html($(this).attr("email"));
$("#add-role-form").modal({appendTo: "#main"});
}
});
});
//delete user dialog
var del_user_id = "";
$(".remove-user-btn").each(function(index, item) {
item.onclick = function() {
del_user_id = $(item).attr("userid");
$(".remove-user-btn").each(function() {
$(this).click(function() {
del_user_id = $(this).attr("userid");
$("#dialog-delete-confirm").modal({appendTo: "#main"});
}
});
});
$("button.remove-user-confirm-btn").click(function() {