mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-23 01:07:35 +00:00
64 lines
2.5 KiB
HTML
64 lines
2.5 KiB
HTML
{% load i18n %}
|
|
{% include 'snippets/list_commit_detail.html' %}
|
|
function reqEvents(start) {
|
|
$('#events-loading').removeClass('hide');
|
|
$.ajax({
|
|
url:'{{SITE_ROOT}}events/?start=' + start{% if org %} + '&org_id={{ org.org_id }}'{% endif %},
|
|
dataType: 'json',
|
|
cache: false,
|
|
success: function(data) {
|
|
$('#events').append(data['html']);
|
|
$('.event-item').each(function(index) {
|
|
if (index > 0 && $(this).children('.pic').attr('data') == $(this).prev().children('.pic').attr('data')) {
|
|
$(this).children('.pic').addClass('hide');
|
|
}
|
|
});
|
|
if (start == 0) {
|
|
$('#events').removeClass('hide');
|
|
}
|
|
$('#events-loading').addClass('hide');
|
|
if (data['more']) {
|
|
$('#events-more').data('start', start + 10).removeClass('hide');
|
|
} else {
|
|
$('#events-more').addClass('hide');
|
|
}
|
|
if ($.browser.mozilla || $.browser.msie) {
|
|
$('#events a').focus(function() {
|
|
$(this).blur();
|
|
});
|
|
}
|
|
$('.lsch').click(function() {
|
|
listCommitDetails($(this).data('url'), $(this).data('time'));
|
|
return false;
|
|
});
|
|
$('.lsch-encrypted').click(function() {
|
|
if ($(this).data('passwordset')) {
|
|
listCommitDetails($(this).data('url'), $(this).data('time'));
|
|
} else {
|
|
var form = $('#repo-decrypt-form');
|
|
form.find('input[name="repo_id"]').val($(this).data('repoid'));
|
|
form.find('.op-target').html($(this).data('reponame'));
|
|
form.data({'url':$(this).data('url'), 'time':$(this).data('time')}).modal({appendTo:'#main'});
|
|
}
|
|
return false;
|
|
});
|
|
},
|
|
error: function() {
|
|
var str = '{% trans "Unknown error." %} ';
|
|
if ($('#events-more').hasClass('hide')) {
|
|
str += '{% trans "Please refresh the page later." %}';
|
|
} else {
|
|
str += '{% trans "Please try again later." %}';
|
|
}
|
|
$('#events-loading').addClass('hide');
|
|
$('#events-error').html(str).removeClass('hide');
|
|
}
|
|
});
|
|
}
|
|
reqEvents(0);
|
|
$('#events-more').click(function() {
|
|
$(this).addClass('hide');
|
|
reqEvents($(this).data('start'));
|
|
});
|
|
{% include 'snippets/repo_decrypt_js.html' %}
|