license: add helpers to allow users hide license warnings.
This commit is contained in:
parent
4d5ea5c67f
commit
1e85bc2f83
3 changed files with 16 additions and 1 deletions
|
|
@ -384,7 +384,8 @@ def attach_context_attributes(context, request, user_id=None, is_api=None):
|
|||
session_attrs = {
|
||||
# defaults
|
||||
"clone_url_format": "http",
|
||||
"diffmode": "sideside"
|
||||
"diffmode": "sideside",
|
||||
"license_fingerprint": request.session.get('license_fingerprint')
|
||||
}
|
||||
|
||||
if not is_api:
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ from .utils import (
|
|||
|
||||
|
||||
FILE_TREE_CACHE_VER = 'v4'
|
||||
LICENSE_CACHE_VER = 'v2'
|
||||
|
||||
|
||||
def configure_dogpile_cache(settings):
|
||||
|
|
|
|||
|
|
@ -1130,6 +1130,19 @@
|
|||
};
|
||||
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>
|
||||
<script src="${h.asset('js/rhodecode/base/keyboard-bindings.js', ver=c.rhodecode_version_hash)}"></script>
|
||||
</%def>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue