mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
Modify repo history
This commit is contained in:
@@ -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'
|
||||
|
@@ -97,7 +97,11 @@
|
||||
当前路径:
|
||||
{% for name, link in zipped %}
|
||||
{% if not forloop.last %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ link|urlencode }}&history={{ view_history }}">{{ name }}</a> /
|
||||
{% if view_history %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ link|urlencode }}">{{ name }}</a> /
|
||||
{% else %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
@@ -122,7 +126,12 @@
|
||||
{% for dirent in dir_list %}
|
||||
<tr>
|
||||
<td class="icon-container"><img src="{{ MEDIA_URL }}img/folder-icon-24.png" alt="目录" /></td>
|
||||
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}&history={{ view_history }}">{{ dirent.obj_name }}</a></td>
|
||||
{% if view_history %}
|
||||
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.obj_name }}</a></td>
|
||||
{% else %}
|
||||
<td><a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.obj_name }}</a></td>
|
||||
{% endif %}
|
||||
|
||||
<td></td>
|
||||
<td>
|
||||
{% if not view_history and request.user.is_authenticated %}
|
||||
@@ -143,7 +152,12 @@
|
||||
{% for dirent in file_list %}
|
||||
<tr>
|
||||
<td class="icon-container"><img src="{{ MEDIA_URL }}img/{{ dirent.obj_name|file_icon_filter }}" alt="文件" /></td>
|
||||
<td><a class="op" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/view/{{ dirent.props.obj_id }}/?commit_id={{ current_commit.id }}&file_name={{ dirent.props.obj_name }}&p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}&history={{ view_history }}">{{ dirent.props.obj_name }}</a></td>
|
||||
{% if view_history %}
|
||||
<td><a class="op" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/view/{{ dirent.props.obj_id }}/?commit_id={{ current_commit.id }}&file_name={{ dirent.props.obj_name }}&p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.props.obj_name }}</a></td>
|
||||
{% else %}
|
||||
<td><a class="op" href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/view/{{ dirent.props.obj_id }}/?file_name={{ dirent.props.obj_name }}&p={{ path|urlencode }}{{ dirent.obj_name|urlencode }}">{{ dirent.props.obj_name }}</a></td>
|
||||
{% endif %}
|
||||
|
||||
<td>{{ dirent.file_size|filesizeformat }}</td>
|
||||
<td>
|
||||
<div>
|
||||
|
@@ -31,7 +31,11 @@
|
||||
当前路径:
|
||||
{% for name, link in zipped %}
|
||||
{% if not forloop.last %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ link|urlencode }}&history={{ view_history }}">{{ name }}</a> /
|
||||
{% if view_history %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ link|urlencode }}">{{ name }}</a> /
|
||||
{% else %}
|
||||
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
|
12
views.py
12
views.py
@@ -185,12 +185,12 @@ 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)
|
||||
# latest_commit = get_commits(repo_id, 0, 1)[0]
|
||||
@@ -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'
|
||||
|
Reference in New Issue
Block a user