{% extends "myhome_base.html" %}

{% block nav_shareadmin_class %}class="cur"{% endblock %}

{% block right_panel %}
<h3>我共享的同步目录</h3>
{% if out_repos %}
<table class="repo-list">
    <tr>
        <th width="20%">名字</th>
        <th width="25%">共享给</th>
        <th width="45%">描述</th>
        <th width="10%">操作</th>
    </tr>
    {% for repo in out_repos %}
    <tr>
        <td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.name }}</a></td>
        <td>{{ repo.props.shared_email }}</td>
        <td>{{ repo.props.desc }}</td>
        <td>
          <button data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.id }}&to_email={{ repo.props.shared_email }}&gid={{ repo.gid }}" class="cancel-share-btn">取消共享</button>
        </td>
    </tr>
    {% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}

{% endblock %}

{% block extra_script %}
<script type="text/javascript">
$('.cancel-share-btn').click(function() {
    location.href = $(this).attr('data');
});
</script>
{% endblock %}

{% extends "myhome_base.html" %}

{% block nav_shareadmin_class %}class="cur"{% endblock %}

{% block right_panel %}
<h3>我共享的同步目录</h3>
{% if out_repos %}
<table class="repo-list">
    <tr>
        <th width="20%">名字</th>
        <th width="25%">共享给</th>
        <th width="45%">描述</th>
        <th width="10%">操作</th>
    </tr>
    {% for repo in out_repos %}
    <tr>
        <td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.name }}</a></td>
        <td>{{ repo.props.shared_email }}</td>
        <td>{{ repo.props.desc }}</td>
        <td>
          {% if repo.gid %}
          <button data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.id }}&to_email={{ repo.props.shared_email }}&gid={{ repo.gid }}" class="cancel-share-btn">取消共享</button>
          {% else %}
          <button data="{{ SITE_ROOT }}shareadmin/removeshare/?repo_id={{ repo.props.id }}&to_email={{ repo.props.shared_email }}" class="cancel-share-btn">取消共享</button>
          {% endif %}
        </td>
    </tr>
    {% endfor %}
</table>
{% else %}
<p>暂无</p>
{% endif %}

{% endblock %}

{% block extra_script %}
<script type="text/javascript">
$('.cancel-share-btn').click(function() {
    location.href = $(this).attr('data');
});
</script>
{% endblock %}

Fix bug in unshare repo
Fix bug in unshare repo
