fix: dismiss license warnings should be also possible in non base.mako pages
This commit is contained in:
parent
552b0cfeb1
commit
c2914495c0
2 changed files with 32 additions and 33 deletions
|
|
@ -104,6 +104,38 @@ c.template_context['attachment_store'] = {
|
|||
rhodecode_edition: '${c.rhodecode_edition}'
|
||||
}
|
||||
};
|
||||
var dismissNotice = function(noticeId) {
|
||||
|
||||
var url = pyroutes.url('user_notice_dismiss',
|
||||
{"user_id": templateContext.rhodecode_user.user_id});
|
||||
|
||||
var postData = {
|
||||
'csrf_token': CSRF_TOKEN,
|
||||
'notice_id': noticeId,
|
||||
};
|
||||
|
||||
var success = function(response) {
|
||||
$('#notice-message-' + noticeId).remove();
|
||||
return false;
|
||||
};
|
||||
var failure = function(data, textStatus, xhr) {
|
||||
alert("error processing request: " + textStatus);
|
||||
return false;
|
||||
};
|
||||
ajaxPOST(url, postData, success, failure);
|
||||
}
|
||||
|
||||
var hideLicenseWarning = function () {
|
||||
var fingerprint = templateContext.session_attrs.license_fingerprint;
|
||||
storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint);
|
||||
$('#notifications').hide();
|
||||
}
|
||||
|
||||
var hideLicenseError = function () {
|
||||
var fingerprint = templateContext.session_attrs.license_fingerprint;
|
||||
storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint);
|
||||
$('#notifications').hide();
|
||||
}
|
||||
|
||||
</script>
|
||||
<%include file="/base/plugins_base.mako"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue