1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-21 19:37:28 +00:00

[repo] redesigned ui, mainly 'repo-top'

This commit is contained in:
llj
2014-02-21 16:47:34 +08:00
parent 63c6fc0b5b
commit 686cb0a200
6 changed files with 38 additions and 60 deletions

View File

@@ -897,14 +897,10 @@ textarea:-moz-placeholder {/* for FF */
text-decoration:none;
}
/********** container ***********/
#main, #footer,
#repo-top .block-inner,
#repo-file-list {
#main, #footer {
width:950px;
}
#main,
#repo-top .block-inner,
#repo-file-list {
#main {
margin:0 auto;
}
#header {
@@ -938,12 +934,17 @@ textarea:-moz-placeholder {/* for FF */
#left-panel h3:first-child {
margin-top: 0px;
}
#right-panel .hd, .tabnav {
#right-panel .hd,
.tabnav,
.repo-file-list-topbar {
padding:10px;
background:#f2f2f2;
margin-bottom:.5em;
border-radius:2px;
}
.repo-file-list-topbar {
margin-bottom:0;
}
#right-panel .hd h3,
#right-panel h3.hd {
height:29px;
@@ -973,7 +974,8 @@ textarea:-moz-placeholder {/* for FF */
text-decoration:underline;
}
#right-panel .hd button,
.tabnav button {
.tabnav button,
.repo-file-list-topbar button {
height:29px;
background:#fff;
}
@@ -1406,16 +1408,20 @@ textarea:-moz-placeholder {/* for FF */
/*repo page*/
#repo-top {
padding-bottom:15px;
border-bottom:1px solid #ddd;
margin-bottom:5px;
box-shadow:0 1px 1px #ddd;
}
#repo-top .hd,
#repo-basic-info {
margin: 10px 0;
display:inline-block;
}
#repo-top .hd {
margin-right:15px;
}
#repo-basic-info .desc {
font-size:1.2em;
}
#repo-basic-info .link-icon {
margin:0 5px 0 15px;
}
.split {
border-left:2px solid #888;
padding-left:1em;
@@ -1429,19 +1435,11 @@ textarea:-moz-placeholder {/* for FF */
.repo-op {
text-align:right;
}
.repo-top-op-btn,
.file-op button,
#file-op button,
.repo-op .op-btn {
*margin-left:5px;/* for ie 7*/
}
.repo-top-op-btn,
.repo-op .op-btn {
background-color:#f5f5f5;
}
.repo-op .op-btn:hover {
background-color:#fff;
}
.repo-op .op-btn [class^="icon-"],
.repo-op .op-btn [class^="sf-icon-"] {
margin-right:3px;
@@ -1472,10 +1470,6 @@ textarea:-moz-placeholder {/* for FF */
.repo-file-list-not-show {
padding-left:10px;
}
.repo-file-list-topbar {
padding:8px 0;
border-bottom:1px solid #ddd;
}
.repo-file-list-inner-container .repo-file-list-topbar {
padding:8px 10px;
}
@@ -1519,12 +1513,15 @@ textarea:-moz-placeholder {/* for FF */
#repo-file-list .fixed-hd {
position:fixed;
width:950px;
background:#fff;
top:0;
z-index:11; /*make it on top of dirent op(popup)*/
border-color:#efefef; /*for repo-file-list-topbar*/
}
#repo-file-list .repo-file-list-topbar.fixed-hd {
width:930px;
}
.repo-file-list .fixed-hd th {
background:#fff;
-webkit-box-shadow:0 2px 2px -1px #aaa;
box-shadow:0 2px 2px -3px #aaa;
}

BIN
media/img/lib_setting.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
media/img/lib_trash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -5,7 +5,6 @@
{% block sub_title %}{{repo.name}} - {% endblock %}
{% block extra_style %}
<style type="text/css">
#main { width:auto; }
#footer { display:none; }
{% if repo.encrypted and repo.enc_version == 2 and not server_crypto %}
#main { display:none; }
@@ -17,31 +16,26 @@
{% block main_panel %}
<div id="repo-top">
<div class="block-inner">
<div class="w100 ovhd">
<h2 class="fleft">{{repo.props.name}}{% if user_perm == 'r' %} <span class="tip vam">({% trans "Read-Only" %})</span>{% endif %}</h2>
<div class="fright">
<h2 class="hd">{{repo.props.name}}{% if user_perm == 'r' %} <span class="tip vam">({% trans "Read-Only" %})</span>{% endif %}</h2>
<div id="repo-basic-info">
<span class="desc" title="{{repo.props.desc}}">{{ repo.props.desc|truncatechars:25 }}</span>
<span class="size split">{% trans 'Size: ' %}{{ repo_size|filesizeformat }}</span>
<span class="split">
{% if show_repo_download_button %}
<button id="repo-download-btn" class="repo-top-op-btn"><span class="icon-cloud-download"></span>{% trans "Download"%}</button>
<a href="{{ SITE_ROOT }}seafile_access_check/?repo_id={{repo.props.id}}" target="_blank">{% trans "Download" %}</a>
{% endif %}
{% if is_repo_owner %}
<button id="repo-setting-btn" data="{% url 'repo_settings' repo.id %}" class="repo-top-op-btn"><span class="icon-cog"></span>{% trans "Settings" %}</button>
<a id="repo-setting-btn" href="{% url 'repo_settings' repo.id %}"><img class="link-icon vam" src="{{ MEDIA_URL }}img/lib_setting.png" alt="" /><span class="vam">{% trans "Settings" %}</span></a>
{% endif %}
{% if user_perm == 'rw' %}
<button id="recycle-btn" data="{% url 'repo_recycle_view' repo.id %}" class="repo-top-op-btn"><span class="icon-trash"></span>{% trans "Trash"%}</button>
<a id="recycle-btn" href="{% url 'repo_recycle_view' repo.id %}"><img class="link-icon vam" src="{{ MEDIA_URL }}img/lib_trash.png" alt="" /><span class="vam">{% trans "Trash"%}</span></a>
{% endif %}
</div>
</span>
</div>
<p id="repo-basic-info">
<span class="desc">{{repo.props.desc}}</span>
<span class="size split">{% trans 'Size: ' %}{{ repo_size|filesizeformat }}</span>
</p>
<div id="repo-latest-commit">
<!--div id="repo-latest-commit">
{% include 'snippets/current_commit.html' %}
</div>
</div>
</div-->
</div>
{% if repo.enc_version == 2 and not server_crypto and repo.encrypted %}
@@ -365,19 +359,6 @@ function decrypt_repo() {
}
{% endif %}
//download, trash, repo setting
$('#repo-download-btn').click(function() {
window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id={{repo.props.id}}');
});
$('#recycle-btn').click(function() {
location.href = $(this).attr('data');
});
$('#repo-setting-btn').click(function () {
location.href = $(this).attr('data');
});
function setDirentsOpPos() {
var dirents_op = $('#dirents-op');
dirents_op.css({
@@ -762,7 +743,6 @@ function encAndSubmitFile(file, fd, submit_url) {
success: function(data) {
$.modal.close();
reqDirData('{% url 'repo_dir_data' repo.id %}?p=' + e(cur_path));
updateCmt();
showMsg("{% trans "Done!" %}", 'info');
setTimeout(function() { $('.messages').addClass('hide'); }, 1500);
},
@@ -818,7 +798,6 @@ $('#upload-file').click(function () {
$.modal.close();
if (upload_success) {
reqDirData('{% url 'repo_dir_data' repo.id %}?p=' + e(cur_path));
updateCmt();
}
}
});
@@ -1333,7 +1312,6 @@ $('.file-update', context).click(function() {
$.modal.close();
if (upload_success) {
reqDirData('{% url 'repo_dir_data' repo.id %}?p=' + e(cur_path));
updateCmt();
}
}
});
@@ -1506,7 +1484,6 @@ $('#add-new-file-form, #add-new-dir-form, #rename-form, #mv-form').submit(functi
}
}
});
updateCmt();
};
}
post_data['dirent_name'] = dirent_name;
@@ -1684,7 +1661,7 @@ $(window).scroll(function() {
file_topbar = $('.repo-file-list-topbar'),
repo_file_list = $('#repo-file-list'),
list_hd = $('.repo-file-list tr:first'),
repo_top_left = $('.block-inner', repo_top).offset().left,
repo_top_left = repo_top.offset().left,
file_topbar_h = file_topbar.outerHeight(true);
if ($(window).scrollTop() > repo_top.offset().top + repo_top.outerHeight(true) + 1) {

View File

@@ -26,6 +26,9 @@
{% endif %}
{% endif %}
</div>
<div id="repo-latest-commit" class="clear">
{% include 'snippets/current_commit.html' %}
</div>
</div>
<table class="repo-file-list">

View File

@@ -277,6 +277,7 @@ def list_dir(request, repo_id):
'more_start': more_start,
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
"sub_lib_enabled": sub_lib_enabled,
'current_commit': head_commit,
}
html = render_to_string('snippets/repo_dir_data.html', ctx,
context_instance=RequestContext(request))