1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 10:58:33 +00:00

[sys-admin] license expiration: modification

This commit is contained in:
llj
2015-10-24 18:14:58 +08:00
parent 5d7761ee0f
commit 96cbd7debc
3 changed files with 14 additions and 13 deletions

View File

@@ -316,6 +316,12 @@ p { margin:0.5em 0; }
.alc { text-align: center;}
.cspt { cursor:pointer; }
.pos-rel { position:relative; }
.top-tip {
background:#fddaa4;
color:#1f0600;
text-align:center;
margin:0 0 15px;
}
/** for input, textarea in form **/ /* e.g repo-create */
.input, .textarea {
width:260px;

View File

@@ -81,7 +81,7 @@ $(function(){
if (data['need_update']) {
var tip = "{% trans "A new server version %(v)s is available." %}";
tip = tip.replace('%(v)s', data['new_version']);
$('#title-panel').html('<p class="alc" style="background:#fddaa4;color:#1f0600;padding:3px 0;margin:0 0 15px;"><span>' + tip + '</span></p>').removeClass('hide');
$('#title-panel').append('<p>' + tip + '</p>').addClass('top-tip').removeClass('hide');
}
}
});
@@ -93,22 +93,17 @@ $(function(){
dataType: 'json',
cache: false,
success: function(data) {
var tip, $title_panel = $('#title-panel');
var tip;
if (data['already_expired']) {
tip = "Your license is already expired in %(v)s.",
tip = tip.replace('%(v)s', data['expiration']);
tip = "Your license expired on %(date)s.";
} else if (data['to_be_expired']) {
tip = "Your license will be expired in %(v)s.",
tip = tip.replace('%(v)s', data['expiration']);
tip = "Your license will expire on %(date)s.";
}
if (typeof(tip) != 'undefined') {
if ($title_panel.find('p').length) {
$title_panel.find('p').append('<br /><span>' + tip + '</span>');
} else {
$title_panel.html('<p class="alc" style="background:#fddaa4;color:#1f0600;padding:3px 0;margin:0 0 15px;"><span>' + tip + '</span></p>').removeClass('hide');
}
if (data['already_expired'] || data['to_be_expired']) {
tip = tip.replace('%(date)s', data['expiration_date']);
$('#title-panel').append('<p>' + tip + '</p>').addClass('top-tip').removeClass('hide');
}
}
});

View File

@@ -2063,6 +2063,6 @@ def sys_check_license(request):
# will be expired in 30 days
result['to_be_expired'] = True
result['expiration'] = expiration
result['expiration_date'] = expiration
return HttpResponse(json.dumps(result), content_type=content_type)