mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-02 07:47:32 +00:00
Modify profile page, and remove ccnet conf related fucntion
This commit is contained in:
parent
87a3f94e88
commit
cfd96c763d
@ -1,42 +0,0 @@
|
|||||||
{% extends "profile/profile_base.html" %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block left_panel %}
|
|
||||||
<h3>操作</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
|
||||||
<li><a href="{{ SITE_ROOT}}profile/userids/">列出所有计算机</a></li>
|
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block right_panel %}
|
|
||||||
<h2>当前设置</h2>
|
|
||||||
<ul>
|
|
||||||
<li><span class="bold">提示:</span>如需上传配置文件,请在本地 seafile 界面 "配置" 标签下上传</li>
|
|
||||||
</ur>
|
|
||||||
|
|
||||||
<table class="profile-dict">
|
|
||||||
<tr>
|
|
||||||
<th width="33%">计算机</th>
|
|
||||||
<th width="67">配置文件上传时间</th>
|
|
||||||
</tr>
|
|
||||||
{% if profile_dict %}
|
|
||||||
{% for peername,profile_ts in profile_dict.items %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ peername }}</td>
|
|
||||||
{% if profile_ts %}
|
|
||||||
<td>上传于{{ profile_ts }} <a href="{{ SITE_ROOT }}profile/download/?user_id={{ user_id }}">点此下载</a></td>
|
|
||||||
{% else %}
|
|
||||||
<td>未上传</td>
|
|
||||||
{% endif %}
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
{% else %}
|
|
||||||
<tr>
|
|
||||||
<td>暂无</td>
|
|
||||||
<td>—— ——</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</table>
|
|
||||||
{% endblock %}
|
|
@ -5,7 +5,6 @@
|
|||||||
<h3>操作</h3>
|
<h3>操作</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
||||||
<li><a href="{{ SITE_ROOT}}profile/userids/">列出所有计算机</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
from django.conf.urls.defaults import *
|
from django.conf.urls.defaults import *
|
||||||
|
|
||||||
urlpatterns = patterns('profile.views',
|
urlpatterns = patterns('profile.views',
|
||||||
url(r'^$', 'show_profile'),
|
url(r'^$', 'list_userids', name="list_userids"),
|
||||||
url(r'^ccnet/$', 'get_ccnet_profile'),
|
# url(r'^ccnet/$', 'get_ccnet_profile'),
|
||||||
# url(r'^edit/$', 'set_profile', name="profile_setting"),
|
# url(r'^edit/ccnet/$', 'set_ccnet_profile', name="ccnet_profile_setting"),
|
||||||
url(r'^edit/ccnet/$', 'set_ccnet_profile', name="ccnet_profile_setting"),
|
# url(r'^download/$', 'download_profile', name="profile_download"),
|
||||||
url(r'^download/$', 'download_profile', name="profile_download"),
|
|
||||||
url(r'userids/$', 'list_userids', name="list_userids")
|
|
||||||
)
|
)
|
||||||
|
@ -12,35 +12,6 @@ from models import UserCcnetConf
|
|||||||
|
|
||||||
from seaserv import ccnet_rpc, translate_time_usec, get_binding_userids
|
from seaserv import ccnet_rpc, translate_time_usec, get_binding_userids
|
||||||
|
|
||||||
@login_required
|
|
||||||
def show_profile(request):
|
|
||||||
userid_list = get_binding_userids(request.user.username)
|
|
||||||
|
|
||||||
profile_dict = {}
|
|
||||||
|
|
||||||
for user_id in userid_list:
|
|
||||||
try:
|
|
||||||
profile_timestamp = ccnet_rpc.get_user_profile_timestamp(user_id)
|
|
||||||
profile_timestamp = translate_time_usec(profile_timestamp)
|
|
||||||
except:
|
|
||||||
profile_timestamp = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
peernames = ccnet_rpc.get_peernames_by_userid(user_id)
|
|
||||||
for peername in peernames.split('\n'):
|
|
||||||
if not peername:
|
|
||||||
continue
|
|
||||||
profile_dict[peername] = profile_timestamp
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return render_to_response('profile/profile.html', {
|
|
||||||
'userid_list': userid_list,
|
|
||||||
'profile_dict': profile_dict,
|
|
||||||
},
|
|
||||||
context_instance=RequestContext(request))
|
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def get_ccnet_profile(request):
|
def get_ccnet_profile(request):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user