mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-14 15:35:35 +00:00
67 lines
2.2 KiB
HTML
67 lines
2.2 KiB
HTML
<!-- <script type="text/javascript"> -->
|
|
{% load i18n %}
|
|
function get_commit_diff(url, callback) {
|
|
$.ajax({
|
|
url: url,
|
|
dataType: 'json',
|
|
cache: false,
|
|
contentType: 'application/json; charset=utf-8',
|
|
success: function(data) {
|
|
var con = '';
|
|
var show = function(data_) {
|
|
con += '<ul>';
|
|
for (var i = 0, len = data_.length; i < len; i++) {
|
|
con += '<li>' + data_[i] + '</li>';
|
|
}
|
|
con += '</ul>';
|
|
};
|
|
if (data['new'].length > 0) {
|
|
con += '<h4 id="ls-ch-new">{% trans "New files" %}</h4>';
|
|
show(data['new']);
|
|
}
|
|
if (data['removed'].length > 0) {
|
|
con += '<h4 id="ls-ch-rm">{% trans "Deleted files" %}</h4>';
|
|
show(data['removed']);
|
|
}
|
|
if (data['renamed'].length > 0) {
|
|
con += '<h4 id="ls-ch-rn">{% trans "Renamed or Moved files" %}</h4>';
|
|
show(data['renamed']);
|
|
}
|
|
if (data['modified'].length > 0) {
|
|
con += '<h4 id="ls-ch-modi">{% trans "Modified files" %}</h4>';
|
|
show(data['modified']);
|
|
}
|
|
if (data['newdir'].length > 0) {
|
|
con += '<h4 id="ls-ch-newdir">{% trans "New directories" %}</h4>';
|
|
show(data['newdir']);
|
|
}
|
|
if (data['deldir'].length > 0) {
|
|
con += '<h4 id="ls-ch-deldir">{% trans "Deleted directories" %}</h4>';
|
|
show(data['deldir']);
|
|
}
|
|
if (!con) {
|
|
con = '<p>{% trans "No conflict in the merge." %}</p>';
|
|
}
|
|
callback(con);
|
|
}
|
|
});
|
|
}
|
|
|
|
function list_commit_change(obj) {
|
|
var url = obj.attr('href');
|
|
get_commit_diff(url, function(content) {
|
|
var time = '<p><span class="commit-time">' + obj.attr('data') + '</span></p>';
|
|
var title = '<h3>{% trans "Modification Details" %}</h3>' + time;
|
|
$('#ls-ch').html(title + content).modal({
|
|
appendTo:'#main',
|
|
maxHeight: window.innerHeight - 57,
|
|
autoResize:true
|
|
});
|
|
});
|
|
}
|
|
|
|
$('.lsch').click(function() {
|
|
list_commit_change($(this));
|
|
return false;
|
|
});
|