# HG changeset patch # User Marcin Kuzminski # Date 2020-07-17 10:40:34 # Node ID a39b0f4b45366cc9d32d2e32ccdb60a9f3914441 # Parent 4106ec779281dafe57a867f56112691a1bb88e1b license: add helpers to allow users hide license warnings. diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -384,7 +384,8 @@ def attach_context_attributes(context, r session_attrs = { # defaults "clone_url_format": "http", - "diffmode": "sideside" + "diffmode": "sideside", + "license_fingerprint": request.session.get('license_fingerprint') } if not is_api: diff --git a/rhodecode/lib/rc_cache/__init__.py b/rhodecode/lib/rc_cache/__init__.py --- a/rhodecode/lib/rc_cache/__init__.py +++ b/rhodecode/lib/rc_cache/__init__.py @@ -48,6 +48,7 @@ from .utils import ( FILE_TREE_CACHE_VER = 'v4' +LICENSE_CACHE_VER = 'v2' def configure_dogpile_cache(settings): diff --git a/rhodecode/templates/base/base.mako b/rhodecode/templates/base/base.mako --- a/rhodecode/templates/base/base.mako +++ b/rhodecode/templates/base/base.mako @@ -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(); + } +