1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

combined 'public home' & 'public info'

This commit is contained in:
llj
2013-02-06 13:37:06 +08:00
parent 3f31e7ac0c
commit 8260133d7e
3 changed files with 64 additions and 6 deletions

View File

@@ -17,9 +17,6 @@
<a href="{{ SITE_ROOT }}contacts/" {% block nav_contacts_class %}{% endblock %}>{% trans "Contacts" %}</a>
</li>
{% if not cloud_mode %}
<li>
<a href="{% url 'public_home' %}" {% block nav_publichome_class %}{% endblock %}>{% trans "Public Library" %}</a>
</li>
<li>
<a href="{% url 'seahub.views.pubinfo' %}" {% block nav_pubinfo_class %}{% endblock %}>{% trans "Public Info" %}</a>
</li>

View File

@@ -12,14 +12,66 @@
<li class="member">{% avatar member.email 16 %}<a class="name" href="{{ SITE_ROOT }}profile/{{ member.email }}/">{{ member.email|email2nickname }}</a></li>
{% endfor %}
</ul>
{% include "snippets/user_profile_html.html" %}
{% else %}
<p>{% trans "Empty"%}</p>
{% endif %}
{% endblock %}
{% block right_panel %}
<h3>{% trans "Libraries & Groups" %}</h3>
<div id="tabs">
<div class="ovhd">
<ul id="tabs-nav" class="fleft">
<li><a href="#repos">{% trans "Libraries" %}</a></li>
<li><a href="#grps">{% trans "Groups" %}</a></li>
</ul>
<button id="repo-create" class="add fright">{% trans "New Library"%}</button>
</div>
<div id="repos" class="hide">
{% if public_repos %}
<table>
<tr>
<th width="4%"><!--icon--></th>
<th width="20%">{% trans "Name"%}</th>
<th width="33%">{% trans "Description"%}</th>
<th width="15%">{% trans "Last Update"%}</th>
<th width="15%">{% trans "Share From"%}</th>
<th width="13%">{% trans "Operations"%}</th>
</tr>
{% for repo in public_repos %}
<tr>
<td>
{% if repo.user_perm == 'rw' %}
<img src="{{MEDIA_URL}}img/sync-folder-20.png" title="{% trans "Read-Write"%}" alt="目录icon" />
{% else %}
<img src="{{MEDIA_URL}}img/folder-no-write-20.png" title="{% trans "Read-Only"%}" alt="目录icon" />
{% endif %}
</td>
<td><a href="{% url '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_seahub_time }}</td>
{% else %}
<td>--</td>
{% endif %}
<td>{{ repo.props.user|email2nickname }}</td>
<td>
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.repo_id }}" class="download-btn op-icon vh" title="{% trans "Download"%}" alt="{% trans "Download"%}" />
</td>
</tr>
{% endfor %}
</table>
{% else %}
<div class="empty-tips">
<h2 class="center-contents">{% trans "No public library" %}</h2>
<p>{% blocktrans %}You can create a public library by clicking "New Library" button, others can view and download this library.{% endblocktrans %}</p>
</div>
{% endif %}
{% include "snippets/repo_create_form.html" %}
</div>
<div id="grps" class="hide">
{% if groups %}
<h3>{% trans "Groups"%}</h3>
<ul class="group-list w100 ovhd">
{% for group in groups %}
<li class="group fleft">
@@ -40,13 +92,19 @@
<p> {% blocktrans %}You can click "Add Group" button under "Group" label to create a group. {% endblocktrans %}</p>
</div>
{% endif %}
<!-- user profile -->
{% include "snippets/user_profile_html.html" %}
</div>
</div>
{% endblock %}
{% block extra_script %}
{% include "snippets/user_profile_js.html" %}
<script type="text/javascript">
{% include "snippets/myhome_extra_script.html" %}
{% url 'seahub.views.public_repo_create' as repo_create_url %}
{% with post_url=repo_create_url %}
{% include "snippets/repo_create_js.html" %}
{% endwith %}
{% url 'group_list' as group_add_url %}
{% with post_url=group_add_url %}
{% include "snippets/group_add_js.html" %}

View File

@@ -2802,11 +2802,14 @@ def pubinfo(request):
# Users are not allowed to see public information when in cloud mode.
raise Http404
else:
public_repos = list_inner_pub_repos(request.user.username)
groups = get_personal_groups(-1, -1)
users = get_emailusers(-1, -1)
return render_to_response('pubinfo.html', {
'groups': groups,
'users': users,
'public_repos': public_repos,
'create_shared_repo': True,
}, context_instance=RequestContext(request))
def repo_set_password(request):