1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00

Merge branch 'myhome'

Conflicts:
	templates/snippets/shared_in_repos.html
This commit is contained in:
zhengxie
2012-10-09 21:56:41 +08:00
7 changed files with 132 additions and 71 deletions

View File

@@ -197,6 +197,24 @@ ul.with-bg li {
border-style: dashed dashed dashed solid; border-style: dashed dashed dashed solid;
border-left-color: #bbb; border-left-color: #bbb;
} }
.info-item {
border: 1px solid #eee;
border-radius: 2px;
margin-bottom: 12px;
}
.info-item h3,
.info-item p {
margin:0;
}
.info-item-top {
padding: 4px 10px;
border-bottom: 1px solid #eee;
border-top-left-radius: 1px;
border-top-right-radius: 1px;
}
.info-item-bottom {
padding: 8px 10px;
}
/* container */ /* container */
#header, #main, #footer { width:950px; } #header, #main, #footer { width:950px; }
@@ -218,9 +236,8 @@ ul.with-bg li {
} }
#left-panel { #left-panel {
float:right; float:right;
width:220px; width:230px;
border-left:1px solid #E8E8E8; padding-left:10px;
padding-left:20px;
} }
#right-panel { #right-panel {
float:left; float:left;
@@ -567,20 +584,21 @@ ul.with-bg li {
/*myhome*/ /*myhome*/
.home-profile .avatar { .home-profile .avatar {
float:left; float:left;
margin:0 15px 0 11px; margin:0 15px 0 9px;
} }
.mygroup { .mygroup {
display:inline-block; float:left;
width:70px; width:69px;
text-align:center; text-align:center;
word-wrap:break-word; word-wrap:break-word;
vertical-align:top; vertical-align:top;
margin:0 0px 5px 0; margin:0 0px 5px 0;
} }
.mygroup .tip { .mygroup a {
font-size: 0.9em; display:inline-block;
color: #333; width:100%;
} }
#repo-create, #repo-create,
#contact-add, #contact-add,
#group-add, #group-add,
@@ -614,6 +632,36 @@ ul.with-bg li {
width:262px; width:262px;
margin-bottom:10px; margin-bottom:10px;
} }
#repos-tabs {
font-size:1em;
padding:0;
border:0;
min-height:150px;
margin-bottom:75px;
}
#repos-tabs .ui-tabs-nav {
padding:0;
}
#repos-tabs .ui-tabs-nav li {
border:0;
background:none;
}
#repos-tabs .ui-tabs-nav li a {
color:#8A948F;
font-weight:normal;
padding:.3em 0;
margin-right:0.6em;
}
#repos-tabs .ui-tabs-nav .ui-state-active a {
color:#DD4B39;
border-bottom:2px solid #DD4B39;
}
#repos-tabs .ui-tabs-nav li a:hover {
color:#DD4B39;
}
#repos-tabs .ui-tabs-panel {
padding:0;
}
.event-item { .event-item {
margin:10px 0 15px; margin:10px 0 15px;
} }

View File

@@ -14,12 +14,9 @@
{% endblock %} {% endblock %}
{% block right_panel %} {% block right_panel %}
<!-- 我拥有的资料库 --> <!-- 我拥有的资料库 --><!-- 共享给我的资料库 -->
{% include "snippets/my_owned_repos.html" %} {% include "snippets/my_owned_repos.html" %}
<!-- 共享给我的资料库 -->
{% include "snippets/shared_in_repos.html" %}
{% url 'org_repo_share' org.url_prefix as repo_share_url %} {% url 'org_repo_share' org.url_prefix as repo_share_url %}
{% with post_url=repo_share_url tips='必须是团体内部成员或群组。' %} {% with post_url=repo_share_url tips='必须是团体内部成员或群组。' %}
{% include "snippets/repo_share_form.html" %} {% include "snippets/repo_share_form.html" %}

View File

@@ -5,8 +5,9 @@
{% block nav_myhome_class %}class="cur"{% endblock %} {% block nav_myhome_class %}class="cur"{% endblock %}
{% block left_panel %} {% block left_panel %}
<h3>我的基本信息</h3> <div class="info-item">
<div class="home-profile w100 ovhd"> <h3 class="info-item-top">我的基本信息</h3>
<div class="info-item-bottom home-profile ovhd">
<a href="{{ SITE_ROOT }}profile/" class="no-deco">{% avatar myname 48 %}</a> <a href="{{ SITE_ROOT }}profile/" class="no-deco">{% avatar myname 48 %}</a>
{% if nickname %} {% if nickname %}
<p class="fleft">{{ nickname }}</p> <p class="fleft">{{ nickname }}</p>
@@ -14,10 +15,12 @@
<p class="fleft">暂无昵称 <a href="{{ SITE_ROOT }}profile/"><img src="{{ MEDIA_URL }}img/edit_12.png" alt="编辑" title="编辑" /></a></p> <p class="fleft">暂无昵称 <a href="{{ SITE_ROOT }}profile/"><img src="{{ MEDIA_URL }}img/edit_12.png" alt="编辑" title="编辑" /></a></p>
{% endif %} {% endif %}
</div> </div>
</div>
{% if grpmsg_list or grpmsg_reply_list or orgmsg_list %} {% if grpmsg_list or grpmsg_reply_list or orgmsg_list %}
<h3>提醒...</h3> <div class="info-item">
<ul> <h3 class="info-item-top">提醒...</h3>
<ul class="info-item-bottom">
{% if grpmsg_list %} {% if grpmsg_list %}
<li> <li>
群组 群组
@@ -34,10 +37,13 @@
<li><a href="{% url 'org_msg' %}" class="no-bold">{{ orgmsg_list|length }}条团体消息</a></li> <li><a href="{% url 'org_msg' %}" class="no-bold">{{ orgmsg_list|length }}条团体消息</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div>
{% endif %} {% endif %}
<h3>已用空间</h3> <div class="info-item">
<p>{{ quota_usage|filesizeformat }} {% if cloud_mode %}/ 2 GB {% endif %}</p> <h3 class="info-item-top">已用空间</h3>
<p class="info-item-bottom">{{ quota_usage|filesizeformat }} {% if cloud_mode %}/ 2 GB {% endif %}</p>
</div>
<!-- 我的群组 --> <!-- 我的群组 -->
{% with groups=joined_groups %} {% with groups=joined_groups %}
@@ -46,12 +52,9 @@
{% endblock %} {% endblock %}
{% block right_panel %} {% block right_panel %}
<!-- 我拥有的资料库 --> <!-- 我拥有的资料库 --><!-- 共享给我的资料库 -->
{% include "snippets/my_owned_repos.html" %} {% include "snippets/my_owned_repos.html" %}
<!-- 共享给我的资料库 -->
{% include "snippets/shared_in_repos.html" %}
{% if events %} {% if events %}
<h3>最近事件</h3> <h3>最近事件</h3>
<ul id="events" class="hide"> <ul id="events" class="hide">

View File

@@ -1,16 +1,18 @@
{% load group_avatar_tags %} {% load group_avatar_tags %}
<h3>我的群组</h3> <div class="info-item">
<h3 class="info-item-top">我的群组</h3>
{% if groups %} {% if groups %}
<ul> <ul class="info-item-bottom ovhd">
{% for group in groups %} {% for group in groups %}
<li class="mygroup"> <li class="mygroup">
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/" class="no-deco"> <a href="{{ SITE_ROOT }}group/{{ group.props.id }}/" class="no-deco">
<img src="{% grp_avatar_url group.props.id 48 %}" alt="{{ group.props.group_name }}的图标" title="{{ group.props.group_name }}" class="avatar" /> <img src="{% grp_avatar_url group.props.id 48 %}" alt="{{ group.props.group_name }}的图标" title="{{ group.props.group_name }}" class="avatar" />
</a><br /> </a>
<a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a> <a href="{{ SITE_ROOT }}group/{{ group.props.id }}/">{{ group.props.group_name }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
<p>暂无</p> <p class="info-item-bottom">暂无</p>
{% endif %} {% endif %}
</div>

View File

@@ -1,6 +1,14 @@
{% load seahub_tags %} {% load seahub_tags %}
<h3>我拥有的资料库</h3> <h3>资料库</h3>
<button id="repo-create">新建资料库</button> <div id="repos-tabs">
<div class="ovhd">
<ul class="fleft">
<li><a href="#my-own-repos" onfocus="this.blur()">我拥有的</a></li>
<li><a href="#repos-shared-to-me" onfocus="this.blur()">共享给我的</a></li>
</ul>
<button id="repo-create" class="fright">新建资料库</button>
</div>
<div id="my-own-repos">
{% if owned_repos %} {% if owned_repos %}
<table> <table>
<tr> <tr>
@@ -31,3 +39,47 @@
{% else %} {% else %}
<p class="empty-repo-tips">您可以新建一个资料库来组织您的文件资料,比如为每个项目创建一个资料库,每个资料库可以单独地同步和共享。</p> <p class="empty-repo-tips">您可以新建一个资料库来组织您的文件资料,比如为每个项目创建一个资料库,每个资料库可以单独地同步和共享。</p>
{% endif %} {% endif %}
</div>
<div id="repos-shared-to-me">
{% if in_repos %}
<table>
<tr>
<th width="4%"><!--icon--></th>
<th width="20%">名字</th>
<th width="36%">描述</th>
<th width="15%">更新时间</th>
<th width="15%">共享来源</th>
<th width="10%">操作</th>
</tr>
{% for repo in in_repos %}
<tr>
<td>
{% if repo.user_perm == 'rw' %}
<img src="{{MEDIA_URL}}img/sync-folder-20.png" title="可读写" alt="目录icon" />
{% else %}
<img src="{{MEDIA_URL}}img/folder-no-write-20.png" title="只读" alt="目录icon" />
{% endif %}
</td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.repo_id }}">{{ repo.props.repo_name }}</a></td>
<td>{{ repo.props.repo_desc }}</td>
{% if repo.props.last_modified %}
<td>{{ repo.props.last_modified|translate_commit_time }}</td>
{% else %}
<td>--</td>
{% endif %}
<td>{{ repo.props.user|email2nickname }}</td>
<td>
{% if repo.user_perm == 'rw' %}
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.repo_id }}" class="download-btn op-icon vh" title="下载到本地" alt="下载" />
{% endif %}
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ repo.props.user }}&to={{ request.user }}" class="unshare-btn op-icon vh" title="取消共享" alt="取消共享" />
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p class="empty-repo-tips">您的朋友可以将他的资料库共享给您,这些资料库会显示在这里。</p>
{% endif %}
</div>
</div>

View File

@@ -1,4 +1,5 @@
{% load seahub_tags avatar_tags %} {% load seahub_tags avatar_tags %}
$('#repos-tabs').tabs();
$(function() { $(function() {
//repo-share-form share-list autocomplete //repo-share-form share-list autocomplete
var share_list = [], contact_email, group_name, group_name_py; var share_list = [], contact_email, group_name, group_name_py;

View File

@@ -1,42 +0,0 @@
{% load seahub_tags %}
<h3>共享给我的资料库</h3>
{% if in_repos %}
<table>
<tr>
<th width="4%"><!--icon--></th>
<th width="20%">名字</th>
<th width="36%">描述</th>
<th width="15%">更新时间</th>
<th width="15%">共享来源</th>
<th width="10%">操作</th>
</tr>
{% for repo in in_repos %}
<tr>
<td>
{% if repo.user_perm == 'rw' %}
<img src="{{MEDIA_URL}}img/sync-folder-20.png" title="可读写" alt="目录icon" />
{% else %}
<img src="{{MEDIA_URL}}img/folder-no-write-20.png" title="只读" alt="目录icon" />
{% endif %}
</td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.repo_id }}">{{ repo.props.repo_name }}</a></td>
<td>{{ repo.props.repo_desc }}</td>
{% if repo.props.last_modified %}
<td>{{ repo.props.last_modified|translate_commit_time }}</td>
{% else %}
<td>--</td>
{% endif %}
<td>{{ repo.props.user|email2nickname }}</td>
<td>
{% if repo.user_perm == 'rw' %}
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.repo_id }}" class="download-btn op-icon vh" title="下载到本地" alt="下载" />
{% endif %}
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.repo_id }}&from={{ repo.props.user }}&to={{ request.user }}" class="unshare-btn op-icon vh" title="取消共享" alt="取消共享" />
</td>
</tr>
{% endfor %}
</table>
{% else %}
<p class="empty-repo-tips">您的朋友可以将他的资料库共享给您,这些资料库会显示在这里。</p>
{% endif %}