mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
Clean up shared repo listing code and add permission for public repos.
This commit is contained in:
@@ -4,6 +4,13 @@
|
||||
<input id="repo-name" type="text" name="repo_name" value="" /><br />
|
||||
<label>描述:</label><br/>
|
||||
<textarea id="repo-desc" name="repo_desc"></textarea>
|
||||
{% if create_shared_repo %}
|
||||
<label style="display:block">共享权限:</label>
|
||||
<select name="permission">
|
||||
<option value="rw" selected="selected">可读写</option>
|
||||
<option value="r">只可浏览</option>
|
||||
</select>
|
||||
{% endif %}
|
||||
<div class="repo-create-encryption">
|
||||
<input type="checkbox" name="encryption" id="encrypt-switch" /><label>加密</label><br />
|
||||
<label>密码:</label><span class="tip">(3到15个字符)</span><br />
|
||||
|
@@ -31,6 +31,9 @@ $('#repo-create-submit').click(function() {
|
||||
data: {
|
||||
'repo_name': $('#repo-name').val(),
|
||||
'repo_desc': $('#repo-desc').val(),
|
||||
{% if create_shared_repo %}
|
||||
'permission': $('#repo-create-form select[name="permission"]').val(),
|
||||
{% endif %}
|
||||
'encryption': $('#encrypt-switch').attr('checked') ? 1 : 0,
|
||||
'passwd': passwd.val(),
|
||||
'passwd_again': passwd_again.val()
|
||||
|
@@ -1,12 +1,14 @@
|
||||
<form id="repo-share-form" action="{{ post_url }}" method="post" name="repo-share-form" class="hide">
|
||||
{% if allow_public_share %}
|
||||
<label>邮箱或群组,输入 all 共享到公共资料:</label><br />
|
||||
{% else %}
|
||||
<label>邮箱或群组:</label><br />
|
||||
{% endif %}
|
||||
<textarea id="email_or_group" name="email_or_group"></textarea>
|
||||
<div>
|
||||
<select id="share-permission" name="permission">
|
||||
<option value="rw" selected="selected">可读写</option>
|
||||
<option value="r">只可浏览</option>
|
||||
</select>
|
||||
</div>
|
||||
<select name="permission">
|
||||
<option value="rw" selected="selected">可读写</option>
|
||||
<option value="r">只可浏览</option>
|
||||
</select>
|
||||
<input id="repo_id" type="hidden" name="repo_id" value="" />
|
||||
<p class="tip">{{ tips }}</p>
|
||||
<p class="error hide"></p>
|
||||
|
@@ -14,17 +14,19 @@
|
||||
{% for repo in in_repos %}
|
||||
<tr>
|
||||
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png" alt="目录icon" /></td>
|
||||
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.name }}</a></td>
|
||||
<td>{{ repo.props.desc }}</td>
|
||||
{% if repo.latest_modify %}
|
||||
<td>{{ repo.latest_modify|translate_commit_time }}</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.shared_email|email2nickname }}</td>
|
||||
<td>{{ repo.props.user|email2nickname }}</td>
|
||||
<td>
|
||||
<img src="{{ MEDIA_URL }}img/download-20.png" data="{{ repo.props.id }}" class="download-btn op-icon vh" title="下载到本地" alt="下载" />
|
||||
<img src="{{ MEDIA_URL }}img/delete-20.png" data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.id }}&from={{ repo.shared_email }}&to={{ request.user }}" class="unshare-btn op-icon vh" title="取消共享" alt="取消共享" />
|
||||
{% 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 %}
|
||||
|
Reference in New Issue
Block a user