1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-17 14:37:58 +00:00
seahub/templates/userinfo.html

143 lines
4.4 KiB
HTML
Raw Normal View History

{% extends "admin_base.html" %}
2012-11-01 07:09:14 +00:00
{% load i18n avatar_tags %}
{% load url from future %}
{% block nav_useradmin_class %}class="cur"{% endblock %}
2012-04-13 05:21:48 +00:00
{% block left_panel %}
2012-11-01 07:09:14 +00:00
<div class="info-item">
<h3 class="info-item-top">{% trans "Profile" %}</h3>
<div class="info-item-bottom home-profile ovhd">
{% avatar email 48 %}
2012-11-01 07:09:14 +00:00
{% if nickname %}
<p class="fleft">{{ nickname }}</p>
{% endif %}
</div>
</div>
<div class="info-item">
<div class="info-item-top">
2012-11-01 07:09:14 +00:00
<h3 class="inbl">{% trans "Space Used" %}</h3>
<a href="#" class="set-quota op">{% trans "Set Quota" %}</a>
</div>
<div class="info-item-bottom">
{% if CALC_SHARE_USAGE %}
<p>{% trans "Total" %}: {{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}</p>
<p>{% trans "Used" %}: {{ my_usage|filesizeformat }}</p>
<p>{% trans "Sharing" %}: {{ share_usage|filesizeformat }}</p>
{% else %}
<p>{{ quota_usage|filesizeformat }} {% if quota > 0 %}/ {{ quota|filesizeformat }} {% endif %}</p>
{% endif %}
</div>
</div>
2012-04-13 05:21:48 +00:00
{% endblock %}
2012-04-13 05:21:48 +00:00
{% block right_panel %}
2012-11-01 07:09:14 +00:00
<h3>{% trans "Owned" %}</h3>
{% if owned_repos %}
<table>
<tr>
<th width="4%"><!--icon--></th>
2012-11-01 07:09:14 +00:00
<th width="30%">{% trans "Name" %}</th>
<th width="46%">{% trans "Description" %}</th>
<th width="20%">{% trans "Operations" %}</th>
</tr>
{% for repo in owned_repos %}
<tr>
2012-11-09 11:16:31 +00:00
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png" title="{% trans "Read-Write" %}" alt="{% trans "directory icon" %}" /></td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}/">{{ repo.props.name }}</a></td>
<td>{{ repo.props.desc }}</td>
<td>
2012-11-09 11:16:31 +00:00
<a href="#" data-url="{{ SITE_ROOT }}repo/remove/{{ repo.props.id }}/?next={{ request.path }}" data-target="{{ repo.props.name }}" class="remove-user-repo op">{% trans "Delete" %}</a>
</td>
</tr>
{% endfor %}
</table>
{% else %}
2012-11-01 07:09:14 +00:00
<p>{% trans "Empty" %}</p>
{% endif %}
2012-11-01 07:09:14 +00:00
<h3>{% trans "Shared" %}</h3>
{% if in_repos %}
<table>
<tr>
<th width="4%"><!--icon--></th>
2012-11-01 07:09:14 +00:00
<th width="30%">{% trans "Name" %}</th>
<th width="26%">{% trans "Share From" %}</th>
<th width="40%">{% trans "Description" %}</th>
</tr>
{% for repo in in_repos %}
<tr>
2012-11-01 07:09:14 +00:00
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png" title="{% trans "Read-Write" %}" alt="目录icon" /></td>
<td><a href="{{ SITE_ROOT }}repo/{{ repo.props.id }}">{{ repo.props.repo_name }}</a></td>
<td>{{ repo.props.user }}</td>
<td>{{ repo.props.repo_desc }}</td>
</tr>
{% endfor %}
</table>
{% else %}
2012-11-01 07:09:14 +00:00
<p>{% trans "Empty" %}</p>
{% endif %}
2012-04-13 05:21:48 +00:00
<form id="set-quota-form" method="post" class="hide">{% csrf_token %}
2012-11-01 07:09:14 +00:00
<label>{% trans "Set user storage limit" %}</label><br />
<input type="hidden" name="email" value="{{ email }}" />
<input type="text" name="quota" /> MB <br />
2012-11-01 07:09:14 +00:00
<p class="tip">{% trans "Tip: 0 means default limit" %}</p>
<p class="error hide"></p>
2012-11-01 07:09:14 +00:00
<input type="submit" value="{% trans "Submit" %}" class="submit" />
</form>
2012-04-13 05:21:48 +00:00
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
$('.set-quota').click(function() {
$("#set-quota-form").modal({appendTo: "#main"});
return false;
});
$('#set-quota-form .submit').click(function() {
var self = $(this);
self.attr('disabled', 'disabled');
$.ajax({
url: '{% url 'views.user_info' email %}',
type: 'POST',
dataType: 'json',
cache: 'false',
beforeSend: prepareCSRFToken,
data: {
'email': $('#set-quota-form input[name="email"]').val(),
'quota': $('#set-quota-form input[name="quota"]').val()
},
success: function(data) {
if (data['success']) {
location.reload(true);
} else {
apply_form_error('set-quota-form', data['error']);
self.removeAttr('disabled');
}
},
error: function(data, textStatus, jqXHR) {
var errors = $.parseJSON(data.responseText);
$.each(errors, function(index, value) {
apply_form_error('set-quota-form', value[0]);
});
self.removeAttr('disabled');
}
});
return false;
});
addConfirmTo($('.remove-user-repo'), {
'title':'{% trans "Delete Library" %}',
'con':'{% trans "Are you sure you want to delete %s ?" %}'
});
</script>
2012-04-13 05:21:48 +00:00
{% endblock %}