1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-16 06:03:35 +00:00
seahub/templates/seafile_access_check.html

43 lines
1.5 KiB
HTML

{% extends "myhome_base.html" %}
{% load i18n %}
{% block main_panel %}
<div class="text-panel">
<p id="msg-wait">{% trans 'Preparing, please wait...' %}</p>
<p id="msg-client" class="error hide">{% trans "No running Seafile client is detected. If you're sure Seafile client is running, click the following link to continue downloading:" %} <br/><a href="{{ download_url }}">{{ download_url|slice:"40" }}...</a></p>
<p id="msg-version" class="error hide">{% trans "Your Seafile client is out of date, please upgrade to latest version." %}<a href="http://www.seafile.com/download">{% trans "Click to download." %}</a></p>
</div>
{% endblock %}
{% block extra_script %}
<script type="text/javascript">
$(function() {
var req_success = false;
var version_mismatch = false;
$.ajax({
url: '{{ applet_root }}/seafile_access_check/',
dataType: 'jsonp',
jsonpCallback: 'xx',
crossDomain: true,
success: function(version) {
if (version < 2) {
version_mismatch = true;
} else {
req_success = true;
location.href = '{{ SITE_ROOT }}download/repo/?repo_id={{ repo_id }}';
}
}
});
setTimeout(function() {
$('#msg-wait').addClass('hide');
if (version_mismatch) {
$('#msg-version').removeClass('hide');
} else if (!req_success) {
$('#msg-client').removeClass('hide');
}
}, 3000);
});
</script>
{% endblock %}