1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

improved repo; modified header

This commit is contained in:
llj 2012-05-05 20:35:08 +08:00
parent 0da0fa73a5
commit c560463eb8
4 changed files with 48 additions and 61 deletions

View File

@ -17,6 +17,7 @@ ul > li { list-style:none; }
.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; }
img { border:none; }
/* table */
table { border-spacing: 0; border-collapse: collapse; width:100%; table-layout:fixed; margin:3px 0 5px; }
td, th { padding: 3px; word-break:break-word; }
@ -44,7 +45,7 @@ tr.first { background-color: #00FF00; }
#other-info { color: #ccc; text-align:right; }
#other-info .wish { font-style:italic; margin-bottom:10px; }
#other-info .version { font-size: 12px; }
#header .nav { border-bottom: 1px solid #ddd; }
#header .nav { border-bottom: 1px solid #ddd; margin-top:8px; }
#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; }
@ -55,13 +56,11 @@ tr.first { background-color: #00FF00; }
h2 { font-size:18px; color:#808; margin-bottom:8px; }
h3 { font-size:14px; color:#808; font-weight:normal; }
ol { margin:0; padding:0px 0 0 2em; list-style-position:inside; }
ul { padding:0 0 0 0; margin: 8px 0 8px 0; }
ul > li { background: url('../img/li.gif') no-repeat scroll; background-position:left 6px; padding-left:10px; }
/* #main ul.ui-tabs-nav > li { background: none; } */
#main ol > li { }
#main li { line-height:20px; }
#main img.click { margin-left:2px; cursor:pointer; }
/* profile */
.avatar_op .pic { float:left; margin-right:15px; }
.avatar_op .text { float:left; }
@ -198,38 +197,28 @@ input.ccnet_id { width: 400px; }
margin-bottom: 12px;
}
/*repo page*/
#repo-page h2 {
margin-bottom:16px;
}
#repo-page .side {
color:#333;
padding-top:33px;
width:230px;
width:260px;
}
#repo-page .main {
width:680px;
width:650px;
}
#repo-page .more {
font-weight:normal;
font-size:12px;
color:#080;
}
#repo-page h2 {
margin-bottom:12px;
.latest-commit {
word-wrap:break-word;
}
#repo-page h3 {
margin-top:24px;
}
.recent-commit {
margin:0;
}
.recent-commit li {
padding:0;
background:none;
color:#222;
}
.recent-commit .author {
.latest-commit .author {
font-style:italic;
margin-left:4px;
}
.recent-commit .time {
.latest-commit .time {
color:#666;
margin-left:2px;
}

View File

@ -36,7 +36,7 @@
<div id="header">
<div class="top-info ovhd">
<a href="{{ SITE_ROOT }}" class="fleft"><img src="{{ MEDIA_URL }}img/logo.png" title="Seafile" alt="Seafile logo" /></a>
<div id="other-info">
<div id="other-info" class="fright">
<p class="wish">Hope our efforts will bring you benefits.</p>
<p class="version">服务器版本: {{ seafile_version }}</p>
</div>

View File

@ -3,46 +3,42 @@
{% block main_panel %}
<div id="repo-page" class="ovhd">
<h2>{{repo.props.name}}</h2>
<div class="side fright">
<p>{{repo.props.desc}}</p>
<p>大小:{{ repo_size|filesizeformat }}</p>
<p class="mgt10">
<span class="item-name">WEB匿名访问:</span>
{% if is_owner %}
{% if repo_ap == 'public' %}
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" checked="checked" autocomplete="off" /><label for="repo-access-switch">开启</label>
{% else %}
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" autocomplete="off" /><label for="repo-access-switch">开启</label>
{% endif %}
<br /><span class="tip">开启后,任何人都能够访问该目录</span>
{% else %}
<span>只有同步目录拥有者可设置</span>
{% endif %}
</p>
</div>
<div class="main fleft">
<h2>{{repo.props.name}}</h2>
<ul class="recent-commit">
{% for commit in recent_commits %}
<li>
{{ commit.props.desc }}
<span class="author">
{% if commit.props.creator_name %}
by {{ commit.props.creator_name }}
{% else %}
未知
{% if not repo.props.encrypted %}
<p class="latest-commit mgt10">
{{ latest_commit.props.desc }}<br />
<span class="author">by
{% if latest_commit.props.creator_name %}
{{ latest_commit.props.creator_name }}
{% else %}
未知
{% endif %}
</span>
<span class="time">{{ commit.props.ctime|tsstr_sec }}</span>
</li>
{% endfor %}
</ul>
<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/" class="more">更多...</a>
<h3>子目录及文件</h3>
{% if repo.props.encrypted %}
<p>该同步目录已加密,不能在线查看。</p>
{% else %}
<span class="time">{{ latest_commit.props.ctime|tsstr_sec }}</span>
</p>
<a href="{{ SITE_ROOT }}repo/history/{{repo.props.id}}/" class="more">更多历史...</a>
<p class="mgt10">
<span class="item-name">WEB匿名访问:</span>
{% if is_owner %}
{% if repo_ap == 'public' %}
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" checked="checked" autocomplete="off" /><label for="repo-access-switch">开启</label>
{% else %}
<input type="checkbox" name="repo-access-switch" id="repo-access-switch" autocomplete="off" /><label for="repo-access-switch">开启</label>
{% endif %}
<br /><span class="tip">开启后,任何人都能够访问该目录</span>
{% else %}
<span>只有同步目录拥有者可设置</span>
{% endif %}
</p>
{% endif %}
</div>
<div class="main fleft">
{% if not repo.props.encrypted %}
<table class="repo-list">
<tr>
<th width="60%">名字</th>
@ -64,6 +60,8 @@
</tr>
{% endfor %}
</table>
{% else %}
<p>该同步目录已加密,不能在线查看。</p>
{% endif %}
</div>
<div id="public-access-start-confirm" class="hide">

View File

@ -178,8 +178,6 @@ def repo(request, repo_id):
repo = get_repo(repo_id)
if repo == None:
raise Http404
recent_commits = get_commits(repo_id, 0, 3)
is_owner = False
if request.user.is_authenticated():
@ -188,8 +186,10 @@ def repo(request, repo_id):
repo_size = seafserv_threaded_rpc.server_repo_size(repo_id)
latest_commit = {}
dirs = []
if not repo.props.encrypted:
latest_commit = get_commits(repo_id, 0, 1)[0]
if not request.GET.get('root_id'):
# use HEAD commit's root id
commit = seafserv_rpc.get_commit(repo.props.head_cmmt_id)
@ -209,7 +209,7 @@ def repo(request, repo_id):
return render_to_response('repo.html', {
"repo": repo,
"recent_commits": recent_commits,
"latest_commit": latest_commit,
"is_owner": is_owner,
"repo_ap": repo_ap,
"repo_size": repo_size,