diff --git a/media/css/seahub.css b/media/css/seahub.css index ae828489bb..2592f9e09a 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -175,7 +175,7 @@ ul.with-bg li { line-height:20px; background: #fff url('../img/li.gif') no-repeat scroll left 6px; } -#paginator { margin-top:10px; } +#paginator { margin:10px; } .tri-bg { /*triangle bg, */ display:inline-block; font-size:0; @@ -634,15 +634,35 @@ ul.with-bg li { } /*repo page*/ +#repo-basic-info { + color:#333; + background:#fafafa; + border:1px solid #ddd; + border-radius:3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + margin: 10px 0; +} +#repo-basic-info .desc, +#repo-basic-info .size { + padding:5px 10px; + margin:0; +} +#repo-basic-info .desc { + border-bottom:1px solid #ddd; +} .path, .access-notice { margin: 0.8em 0 0.4em; } -.repo-op button { +.repo-op { + text-align:right; +} +.repo-op button, +#repo-download-btn { height:25px; background:#f5f5f5 scroll no-repeat 3px 48%; } #upload-file { padding-left:19px; background-image:url('../img/upload.png'); - margin-right:5px; } #add-new-dir { padding-left:23px; @@ -652,20 +672,51 @@ ul.with-bg li { padding-left:23px; background-image:url('../img/new-file-icon.png'); } -.more-op { +.repo-file-list-outer-container, +.commit-list-outer-container { + padding:3px; + background:#eee; + border-radius:3px; + margin:20px 0 25px; +} +.repo-file-list-inner-container, +.commit-list-inner-container { + min-height:250px; + background:#fff; + border:1px solid #ddd; + border-radius:3px; +} +.repo-file-list-not-show { + padding-left:10px; +} +.repo-file-list-topbar { + padding:8px 10px; + border-bottom:1px solid #ddd; +} +.repo-file-list-topbar .path { + line-height:25px; + margin:0; +} +.repo-file-list { + margin:15px 0 0; +} +.displayed-op { + display:inline; + margin-right:8px; +} +.repo-file-list .more-op-icon { cursor:pointer; } -.op-list { +.repo-file-list .hidden-op { position:absolute; left:18px; background:#fff; padding:6px 1px; border:1px solid #eee; border-radius:5px; - -moz-border-radius:5px; z-index:10; } -.op-list li a { +.hidden-op li a { display:block; padding:0 12px; } @@ -694,33 +745,51 @@ ul.with-bg li { border-top-color:#333; } #rename-form .new-name { - margin-top:8px; -} -.latest-commit .more:hover { - text-decoration:none; + min-width:180px; + margin-top:6px; } .icon-container { text-align:center; } -.latest-commit-time-author { - color:#333; - font-size:13px; - font-weight:normal; +#repo-download-btn { + font-size:14px; + height:26px; + padding:0 5px 0 27px; + background-image: url('../img/sync-20.png'); } .latest-commit { word-wrap:break-word; + border: 1px solid #C5D5DD; + border-radius: 4px; + margin-top:10px; } -.latest-commit .author { - font-style:italic; +.latest-commit .commit-msg, +.latest-commit .meta-info { + padding:4px 10px; + margin:0; +} +.latest-commit .commit-msg { + width:928px; + padding:8px 10px; + background: #E6F1F6; + border-bottom: 1px solid #D8E6EC; + border-top-left-radius:3px; + border-top-right-radius:3px; +} +.latest-commit .commit-msg .more { + margin-left:10px; +} +.latest-commit .author .avatar { + border-radius:3px; +} +.latest-commit .author .avatar, +.latest-commit .author .name, +.latest-commit .time { + vertical-align:middle; } .latest-commit .time { color:#666; - margin-left:2px; -} -.repo-history { - font-weight:normal; - font-size:16px; - margin: 4px 0 12px 0; + margin-left:5px; } .lsch { font-size:12px; @@ -735,12 +804,30 @@ ul.with-bg li { max-height:550px; overflow:auto; } +#ls-ch .latest-commit-time-author { + color:#333; + font-size:13px; + font-weight:normal; +} #ls-ch ul { padding:0 0 6px 0; } #dirs { /* file mv */ margin-top:8px; } +/* repo-history */ +#history-back-to-repo { + margin-top:5px; +} +.commit-list { + margin:0 0 20px; +} +.commit-list .time { + padding-left:10px; +} +.commit-list .avatar { + border-radius:2px; +} /*repo-share-form*/ #email, #email_or_group, diff --git a/media/js/utils.js b/media/js/utils.js index 5c00a65a7f..1a4a52e771 100644 --- a/media/js/utils.js +++ b/media/js/utils.js @@ -18,10 +18,6 @@ $('#yes-btn').click(function() { location.href = Op_url; }); -//handle table -$("table tr:nth-child(even)").addClass("even"); -$("table tr:nth-child(odd)").addClass("odd"); - //highlight the tr when mouse hover on it $("table tr:gt(0)").hover( function() { diff --git a/templates/repo.html b/templates/repo.html index 6e16fb1394..193d157520 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -1,6 +1,6 @@ {% extends base_template %} -{% load seahub_tags %} +{% load seahub_tags avatar_tags %} {% load url from future %} {% block info_bar_message %} @@ -14,133 +14,159 @@ {% endblock %} {% block main_panel %} -

{{repo.props.name}}

-
-

基本信息

-

{{repo.props.desc}}

-

大小:{{ repo_size|filesizeformat }}

- - {% if not repo.props.encrypted or password_set %} - {% if can_access %} -
-

最新修改 - {% if request.user.is_authenticated %} - (更多) - {% endif %} -

-

{{ current_commit.props.desc|translate_commit_desc }}

-

- by - {% if current_commit.props.creator_name %} - {{ current_commit.props.creator_name|short_email }} - {% else %} - 未知 - {% endif %} - - {{ current_commit.props.ctime|translate_commit_time }} -

-
- {% endif %} - {% endif %} +
+

{{repo.props.name}}

+ {% if not repo.props.encrypted or password_set %} + {% if can_access %} + + {% endif %} + {% endif %}
- -
- {% if repo.props.encrypted and not password_set %} -

该目录已加密。如需在线查看里面的内容,请输入解密密码。密码只会在服务器上暂存1小时。

-
- - - -
- {% for error in form.errors.values %} -

{{ error|escape }}

- {% endfor %} - -
+
+

{{repo.props.desc}}

+

大小:{{ repo_size|filesizeformat }}

+
+ + {% if not repo.props.encrypted or password_set %} + {% if can_access %} +
+

+ + {{ current_commit.props.desc|translate_commit_desc }} + 详情 + + {% if request.user.is_authenticated %} + 更多历史 + {% endif %} +

+

+ + {% if current_commit.props.creator_name %} + {% avatar current_commit.props.creator_name 20 %} + {{ current_commit.props.creator_name|short_email }} + {% else %} + 未知 + {% endif %} + + {{ current_commit.props.ctime|translate_commit_time }} +

+
+
+ {% endif %} + {% endif %} - {% else %} - {% if not can_access %} -

无法在线查看该同步目录。

- {% else %} -

- 当前路径: - {% for name, link in zipped %} - {% if not forloop.last %} +

+
+ {% if repo.props.encrypted and not password_set %} +
+

该目录已加密。如需在线查看里面的内容,请输入解密密码。密码只会在服务器上暂存1小时。

+
+ + + + + {% for error in form.errors.values %} +

{{ error|escape }}

+ {% endfor %} + +
+
+ + {% else %} + {% if not can_access %} +
+

无法在线查看该同步目录。

+
+ {% else %} +
+

+ 当前路径: + {% for name, link in zipped %} + {% if not forloop.last %} {{ name }} / - {% else %} - {{ name }} - {% endif %} - {% endfor %} -

- {% if request.user.is_authenticated %} -
- - - -
- {% endif %} - - - - - - - - - - {% for dirent in dir_list %} - - - - - - - - {% endfor %} + {% endfor %} +

+ {% if request.user.is_authenticated %} +
+ + + +
+ {% endif %} + +
名字大小操作
目录 - {{ dirent.obj_name }} - - {% if request.user.is_authenticated %} -
- 更多操作 - -
+ {% else %} + {{ name }} {% endif %} -
+ + + + + + - {% for dirent in file_list %} - - - + {% for dirent in dir_list %} + + + - - - - {% endfor %} -
名字大小操作
文件 - {{ dirent.props.obj_name }} -
目录 + {{ dirent.obj_name }} + {{ dirent.file_size|filesizeformat }} -
- 更多操作 - -
-
- {% endif %} - {% endif %} + + + {% if request.user.is_authenticated %} +
+
+ 重命名 +
+ 更多操作 + +
+ {% endif %} + + + {% endfor %} + + {% for dirent in file_list %} + + 文件 + + {{ dirent.props.obj_name }} + + + {{ dirent.file_size|filesizeformat }} + +
+ + 更多操作 + +
+ + + {% endfor %} + + {% endif %} + {% endif %} +
{% csrf_token %} @@ -204,26 +230,27 @@ diff --git a/templates/repo_history.html b/templates/repo_history.html index 49cbfa37cc..5bba928527 100644 --- a/templates/repo_history.html +++ b/templates/repo_history.html @@ -2,137 +2,87 @@ {% load seahub_tags avatar_tags %} {% load url from future %} -{% block left_panel %} -

操作

- -{% endblock %} - -{% block right_panel %} -

{{repo.props.name}} 修改历史

- - - - - - - - - {% for commit in commits %} - - - - {% if commit.creator_name %} - - {% else %} - - {% endif %} - - - - {% if not forloop.last %} - - {% else %} - - {% endif %} - - {% endfor %} -
修改时间修改者描述操作
{{ commit.ctime|translate_commit_time }} - {% avatar commit.creator_name 16 %} - {{ commit.creator_name|email2nickname }} - 未知 - {{ commit.props.desc|translate_commit_desc }} - {% if not forloop.last %} - 详情 - {% endif %} - - 浏览 - 还原 -
-
- {% if current_page != 1 %} - 上一页 - {% endif %} - {% if page_next %} - 下一页 - {% endif %} - 每页: - {% if per_page == 25 %} - 25 - {% else %} - 25 - {% endif %} - {% if per_page == 50 %} - 50 - {% else %} - 50 - {% endif %} - {% if per_page == 100 %} - 100 - {% else %} - 100 - {% endif %} +{% block main_panel %} +
+

{{repo.props.name}} 修改历史

+
+
+
+ + + + + + + -
+ {% for commit in commits %} + + + + {% if commit.creator_name %} + + {% else %} + + {% endif %} + + + + {% if not forloop.last %} + + {% else %} + + {% endif %} + + {% endfor %} +
修改时间修改者描述操作
{{ commit.ctime|translate_commit_time }} + {% avatar commit.creator_name 16 %} + {{ commit.creator_name|email2nickname }} + 未知 + {{ commit.props.desc|translate_commit_desc }} + {% if not forloop.last %} + 详情 + {% endif %} + + 浏览 + 还原 +
+
+ {% if current_page != 1 %} + 上一页 + {% endif %} + {% if page_next %} + 下一页 + {% endif %} + 每页: + {% if per_page == 25 %} + 25 + {% else %} + 25 + {% endif %} + {% if per_page == 50 %} + 50 + {% else %} + 50 + {% endif %} + {% if per_page == 100 %} + 100 + {% else %} + 100 + {% endif %} +
+
+
+
{% endblock %} {% block extra_script %} {% endblock %} diff --git a/templates/snippets/list_commit_detail.html b/templates/snippets/list_commit_detail.html new file mode 100644 index 0000000000..e49a280c95 --- /dev/null +++ b/templates/snippets/list_commit_detail.html @@ -0,0 +1,49 @@ + $('.lsch').click(function() { + var time = '(' + $(this).attr('data') + ')'; + $.ajax({ + url: $(this).attr('href'), + dataType: 'json', + cache: false, + contentType: 'application/json; charset=utf-8', + success: function(data) { + var title = '

修改详情' + time + '

', + con = ''; + var show = function(data_) { + con += '
    '; + for (var i = 0, len = data_.length; i < len; i++) { + con += '
  • ' + data_[i] + '
  • '; + } + con += '
'; + }; + if (data['new'].length > 0) { + con += '

新文件

'; + show(data['new']); + } + if (data['removed'].length > 0) { + con += '

删除的文件

'; + show(data['removed']); + } + if (data['renamed'].length > 0) { + con += '

重命名或移动的文件

'; + show(data['renamed']); + } + if (data['modified'].length > 0) { + con += '

修改的文件

'; + show(data['modified']); + } + if (data['newdir'].length > 0) { + con += '

新目录

'; + show(data['newdir']); + } + if (data['deldir'].length > 0) { + con += '

删除的目录

'; + show(data['deldir']); + } + if (!con) { + con = '

没有文件被改动

'; + } + $('#ls-ch').html(title + con).modal({appendTo:'#main', maxHeight: window.innerHeight - 57, autoResize:true}); + } + }); + return false; + });