mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
[repo_view_file]modified contributors
This commit is contained in:
@@ -757,18 +757,25 @@ ul.with-bg li {
|
|||||||
padding:0 5px 0 27px;
|
padding:0 5px 0 27px;
|
||||||
background-image: url('../img/sync-20.png');
|
background-image: url('../img/sync-20.png');
|
||||||
}
|
}
|
||||||
.latest-commit {
|
#repo-latest-commit,
|
||||||
|
#file-commit-info {
|
||||||
word-wrap:break-word;
|
word-wrap:break-word;
|
||||||
border: 1px solid #C5D5DD;
|
border: 1px solid #C5D5DD;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin-top:10px;
|
margin-top:10px;
|
||||||
}
|
}
|
||||||
.latest-commit .commit-msg,
|
#file-commit-info {
|
||||||
.latest-commit .meta-info {
|
margin-top:16px;
|
||||||
|
}
|
||||||
|
#repo-latest-commit .commit-msg,
|
||||||
|
#repo-latest-commit .meta-info,
|
||||||
|
#file-commit-info .latest-commit,
|
||||||
|
#file-commit-info .contributors {
|
||||||
padding:4px 10px;
|
padding:4px 10px;
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
.latest-commit .commit-msg {
|
#repo-latest-commit .commit-msg,
|
||||||
|
#file-commit-info .latest-commit {
|
||||||
width:928px;
|
width:928px;
|
||||||
padding:8px 10px;
|
padding:8px 10px;
|
||||||
background: #E6F1F6;
|
background: #E6F1F6;
|
||||||
@@ -776,18 +783,28 @@ ul.with-bg li {
|
|||||||
border-top-left-radius:3px;
|
border-top-left-radius:3px;
|
||||||
border-top-right-radius:3px;
|
border-top-right-radius:3px;
|
||||||
}
|
}
|
||||||
.latest-commit .commit-msg .more {
|
#repo-latest-commit .commit-msg .more {
|
||||||
margin-left:10px;
|
margin-left:10px;
|
||||||
}
|
}
|
||||||
.latest-commit .author .avatar {
|
#file-commit-info .contributors {
|
||||||
|
color:#666;
|
||||||
|
}
|
||||||
|
#file-commit-info .contributors .avatar {
|
||||||
|
margin-right:5px;
|
||||||
|
}
|
||||||
|
#repo-latest-commit .author .avatar,
|
||||||
|
#file-commit-info .avatar {
|
||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
}
|
}
|
||||||
.latest-commit .author .avatar,
|
#repo-latest-commit .author .avatar,
|
||||||
.latest-commit .author .name,
|
#repo-latest-commit .author .name,
|
||||||
.latest-commit .time {
|
#repo-latest-commit .time,
|
||||||
|
#file-commit-info .name,
|
||||||
|
#file-commit-info .avatar,
|
||||||
|
#file-commit-info span {
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
}
|
}
|
||||||
.latest-commit .time {
|
#repo-latest-commit .time {
|
||||||
color:#666;
|
color:#666;
|
||||||
margin-left:5px;
|
margin-left:5px;
|
||||||
}
|
}
|
||||||
@@ -1055,7 +1072,7 @@ ul.with-bg li {
|
|||||||
background:#dedede;
|
background:#dedede;
|
||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
-moz-border-radius:3px;
|
-moz-border-radius:3px;
|
||||||
margin-top:23px;
|
margin-top:12px;
|
||||||
}
|
}
|
||||||
#file-op {
|
#file-op {
|
||||||
padding:8px 10px;
|
padding:8px 10px;
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
{% if not repo.props.encrypted or password_set %}
|
{% if not repo.props.encrypted or password_set %}
|
||||||
{% if can_access %}
|
{% if can_access %}
|
||||||
<div class="latest-commit">
|
<div id="repo-latest-commit">
|
||||||
<p class="commit-msg ovhd">
|
<p class="commit-msg ovhd">
|
||||||
<span class="fleft">
|
<span class="fleft">
|
||||||
{{ current_commit.props.desc|translate_commit_desc }}
|
{{ current_commit.props.desc|translate_commit_desc }}
|
||||||
|
@@ -15,40 +15,42 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="w100 ovhd">
|
<div class="w100 ovhd">
|
||||||
<p class="path fleft">
|
<p class="path fleft">
|
||||||
当前路径:
|
当前路径:
|
||||||
{% for name, link in zipped %}
|
{% for name, link in zipped %}
|
||||||
{% if not forloop.last %}
|
{% if not forloop.last %}
|
||||||
{% if view_history %}
|
{% if view_history %}
|
||||||
<a href="{% url 'repo_history_view' repo.id %}?commit_id={{ current_commit.id }}&p={{ link|urlencode }}">{{ name }}</a> / {% else %}
|
<a href="{% url 'repo_history_view' 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> /
|
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
{{ name }}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="file-op fright">
|
|
||||||
{% if not view_history %}
|
|
||||||
<input id="shared-link" class="hide" type="text" readonly="readonly" value="{{ file_shared_link }}" />
|
|
||||||
<button data="{{ SITE_ROOT }}sharedlink/get/?repo_id={{ repo.id }}&p={{ path|urlencode }}&file_name={{ file_name }}" id="get-shared-link">获取分享地址</button>
|
|
||||||
<button id="send-shared-link" class="hide">发送</button>
|
|
||||||
<button data="{{ SITE_ROOT }}sharedlink/remove/?t={{ fileshare.token }}" id="rm-shared-link" class="hide">删除</button>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{{ name }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="file-op fright">
|
||||||
|
{% if not view_history %}
|
||||||
|
<input id="shared-link" class="hide" type="text" readonly="readonly" value="{{ file_shared_link }}" />
|
||||||
|
<button data="{{ SITE_ROOT }}sharedlink/get/?repo_id={{ repo.id }}&p={{ path|urlencode }}&file_name={{ file_name }}" id="get-shared-link">获取分享地址</button>
|
||||||
|
<button id="send-shared-link" class="hide">发送</button>
|
||||||
|
<button data="{{ SITE_ROOT }}sharedlink/remove/?t={{ fileshare.token }}" id="rm-shared-link" class="hide">删除</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="file-commit-info">
|
||||||
|
<p class="latest-commit">{% avatar latest_contributor 20 %} <a href="{% url 'user_profile' latest_contributor %}" class="name">{{ latest_contributor|email2nickname }}</a> 做了最新修改</p>
|
||||||
|
<p class="contributors">
|
||||||
|
<span>{{ contributors|length }} 个贡献者</span>
|
||||||
|
{% for user in contributors %}
|
||||||
|
<a href="{% url 'user_profile' user %}" class="name" title="{{ user|email2nickname}}">{% avatar user 20 %}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="file">
|
<div id="file">
|
||||||
<div id="file-op">
|
<div id="file-op">
|
||||||
<div id="file-contributors" style="float:left">
|
|
||||||
<span>{{ contributors|length }} 个贡献者</span>
|
|
||||||
{% for user in contributors %}
|
|
||||||
<span class="file-contributor" data="{{user}}">
|
|
||||||
{{ user|email2nickname}}<a href="{% url 'user_profile' user %}">{% avatar user 24 %}</a>
|
|
||||||
</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<button id="open-local" data="{{path}}{{dirent.obj_name}}">打开本地文件</button>
|
<button id="open-local" data="{{path}}{{dirent.obj_name}}">打开本地文件</button>
|
||||||
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
|
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
|
||||||
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view" id="view-original">原始文件</button>
|
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view" id="view-original">原始文件</button>
|
||||||
|
2
views.py
2
views.py
@@ -1094,6 +1094,7 @@ def repo_view_file(request, repo_id):
|
|||||||
comments = comments_plus_one[:per_page]
|
comments = comments_plus_one[:per_page]
|
||||||
|
|
||||||
contributors = get_file_contributors(repo_id, path.encode('utf-8'), file_path_hash, obj_id)
|
contributors = get_file_contributors(repo_id, path.encode('utf-8'), file_path_hash, obj_id)
|
||||||
|
latest_contributor = contributors[0]
|
||||||
|
|
||||||
return render_to_response('repo_view_file.html', {
|
return render_to_response('repo_view_file.html', {
|
||||||
'repo': repo,
|
'repo': repo,
|
||||||
@@ -1126,6 +1127,7 @@ def repo_view_file(request, repo_id):
|
|||||||
'document_swf_exists': document_swf_exists,
|
'document_swf_exists': document_swf_exists,
|
||||||
'DOCUMENT_CONVERTOR_ROOT': DOCUMENT_CONVERTOR_ROOT,
|
'DOCUMENT_CONVERTOR_ROOT': DOCUMENT_CONVERTOR_ROOT,
|
||||||
'contributors': contributors,
|
'contributors': contributors,
|
||||||
|
'latest_contributor': latest_contributor,
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
def repo_file_get(raw_path):
|
def repo_file_get(raw_path):
|
||||||
|
Reference in New Issue
Block a user