diff --git a/settings.py b/settings.py index 7aaf02ef64..68e7ce1293 100644 --- a/settings.py +++ b/settings.py @@ -207,7 +207,6 @@ HTTP_SERVER_ROOT = "http://localhost:8082" # Seafile-applet address and port, used in repo download CCNET_APPLET_ROOT = "http://localhost:13420" -SEAFILE_VERSION = '0.9.2' SEAHUB_TITLE = 'SeaHub' USE_SUBDOMAIN = False @@ -234,3 +233,5 @@ else: globals()[attr] = getattr(local_settings, attr) LOGIN_URL = SITE_ROOT + 'accounts/login' + +SEAFILE_VERSION = '0.9.4' diff --git a/templates/repo.html b/templates/repo.html index caf523fda9..c3987c3343 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -97,7 +97,11 @@ 当前路径: {% for name, link in zipped %} {% if not forloop.last %} - {{ name }} / + {% if view_history %} + {{ name }} / + {% else %} + {{ name }} / + {% endif %} {% else %} {{ name }} {% endif %} @@ -122,7 +126,12 @@ {% for dirent in dir_list %} 目录 - {{ dirent.obj_name }} + {% if view_history %} + {{ dirent.obj_name }} + {% else %} + {{ dirent.obj_name }} + {% endif %} + {% if not view_history and request.user.is_authenticated %} @@ -143,7 +152,12 @@ {% for dirent in file_list %} 文件 - {{ dirent.props.obj_name }} + {% if view_history %} + {{ dirent.props.obj_name }} + {% else %} + {{ dirent.props.obj_name }} + {% endif %} + {{ dirent.file_size|filesizeformat }}
diff --git a/templates/repo_view_file.html b/templates/repo_view_file.html index 384b5c2c65..c205456235 100644 --- a/templates/repo_view_file.html +++ b/templates/repo_view_file.html @@ -31,7 +31,11 @@ 当前路径: {% for name, link in zipped %} {% if not forloop.last %} - {{ name }} / + {% if view_history %} + {{ name }} / + {% else %} + {{ name }} / + {% endif %} {% else %} {{ name }} {% endif %} diff --git a/views.py b/views.py index 80b55f5e30..576e037b34 100644 --- a/views.py +++ b/views.py @@ -185,11 +185,11 @@ def render_repo(request, repo_id, error=''): return go_error(request, e.msg) # view newest worktree or history worktree - current_commit = seafserv_rpc.get_commit(request.GET.get('commit_id', '')) + commit_id = request.GET.get('commit_id', '') + view_history = True if commit_id else False + current_commit = seafserv_rpc.get_commit(commit_id) if not current_commit: current_commit = get_commits(repo_id, 0, 1)[0] - - view_history = request.GET.get('history', '') # query repo infomation repo_size = seafserv_threaded_rpc.server_repo_size(repo_id) @@ -695,7 +695,11 @@ def repo_del_file(request, repo_id): def repo_view_file(request, repo_id, obj_id): http_server_root = get_httpserver_root() filename = urllib2.quote(request.GET.get('file_name', '').encode('utf-8')) - view_history = request.GET.get('history', '') + commit_id = request.GET.get('commit_id', '') + view_history = True if commit_id else False + current_commit = seafserv_rpc.get_commit(commit_id) + if not current_commit: + current_commit = get_commits(repo_id, 0, 1)[0] if request.is_ajax(): content_type = 'application/json; charset=utf-8'