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;
|
||||
background-image: url('../img/sync-20.png');
|
||||
}
|
||||
.latest-commit {
|
||||
#repo-latest-commit,
|
||||
#file-commit-info {
|
||||
word-wrap:break-word;
|
||||
border: 1px solid #C5D5DD;
|
||||
border-radius: 4px;
|
||||
margin-top:10px;
|
||||
}
|
||||
.latest-commit .commit-msg,
|
||||
.latest-commit .meta-info {
|
||||
#file-commit-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;
|
||||
margin:0;
|
||||
}
|
||||
.latest-commit .commit-msg {
|
||||
#repo-latest-commit .commit-msg,
|
||||
#file-commit-info .latest-commit {
|
||||
width:928px;
|
||||
padding:8px 10px;
|
||||
background: #E6F1F6;
|
||||
@@ -776,18 +783,28 @@ ul.with-bg li {
|
||||
border-top-left-radius:3px;
|
||||
border-top-right-radius:3px;
|
||||
}
|
||||
.latest-commit .commit-msg .more {
|
||||
#repo-latest-commit .commit-msg .more {
|
||||
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;
|
||||
}
|
||||
.latest-commit .author .avatar,
|
||||
.latest-commit .author .name,
|
||||
.latest-commit .time {
|
||||
#repo-latest-commit .author .avatar,
|
||||
#repo-latest-commit .author .name,
|
||||
#repo-latest-commit .time,
|
||||
#file-commit-info .name,
|
||||
#file-commit-info .avatar,
|
||||
#file-commit-info span {
|
||||
vertical-align:middle;
|
||||
}
|
||||
.latest-commit .time {
|
||||
#repo-latest-commit .time {
|
||||
color:#666;
|
||||
margin-left:5px;
|
||||
}
|
||||
@@ -1055,7 +1072,7 @@ ul.with-bg li {
|
||||
background:#dedede;
|
||||
border-radius:3px;
|
||||
-moz-border-radius:3px;
|
||||
margin-top:23px;
|
||||
margin-top:12px;
|
||||
}
|
||||
#file-op {
|
||||
padding:8px 10px;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
{% if not repo.props.encrypted or password_set %}
|
||||
{% if can_access %}
|
||||
<div class="latest-commit">
|
||||
<div id="repo-latest-commit">
|
||||
<p class="commit-msg ovhd">
|
||||
<span class="fleft">
|
||||
{{ current_commit.props.desc|translate_commit_desc }}
|
||||
|
@@ -39,16 +39,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="file">
|
||||
<div id="file-op">
|
||||
<div id="file-contributors" style="float:left">
|
||||
<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 %}
|
||||
<span class="file-contributor" data="{{user}}">
|
||||
{{ user|email2nickname}}<a href="{% url 'user_profile' user %}">{% avatar user 24 %}</a>
|
||||
</span>
|
||||
<a href="{% url 'user_profile' user %}" class="name" title="{{ user|email2nickname}}">{% avatar user 20 %}</a>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="file">
|
||||
<div id="file-op">
|
||||
<button id="open-local" data="{{path}}{{dirent.obj_name}}">打开本地文件</button>
|
||||
{% 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>
|
||||
|
2
views.py
2
views.py
@@ -1094,6 +1094,7 @@ def repo_view_file(request, repo_id):
|
||||
comments = comments_plus_one[:per_page]
|
||||
|
||||
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', {
|
||||
'repo': repo,
|
||||
@@ -1126,6 +1127,7 @@ def repo_view_file(request, repo_id):
|
||||
'document_swf_exists': document_swf_exists,
|
||||
'DOCUMENT_CONVERTOR_ROOT': DOCUMENT_CONVERTOR_ROOT,
|
||||
'contributors': contributors,
|
||||
'latest_contributor': latest_contributor,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
def repo_file_get(raw_path):
|
||||
|
Reference in New Issue
Block a user