Merge pull request #3767 from FinnStutzenstein/gdpr-login
make the privacy policy available for non logged in users (closes #3757)
This commit is contained in:
commit
56a7bd6840
3
.gitignore
vendored
3
.gitignore
vendored
@ -35,3 +35,6 @@ openslides_*
|
||||
|
||||
# Mypy cache for typechecking
|
||||
.mypy_cache
|
||||
|
||||
# Development of a new client. Easier to switch branches with this entry
|
||||
client/*
|
||||
|
@ -115,7 +115,13 @@ class CoreAppConfig(AppConfig):
|
||||
'name': 'OpenSlidesConfigVariables',
|
||||
'value': config_groups}
|
||||
|
||||
return [client_settings, config_variables]
|
||||
# Send the privacy policy to the client. A user should view them, even he is
|
||||
# not logged in (so does not have the config values yet).
|
||||
privacy_policy = {
|
||||
'name': 'PrivacyPolicy',
|
||||
'value': config['general_event_privacy_policy']}
|
||||
|
||||
return [client_settings, config_variables, privacy_policy]
|
||||
|
||||
|
||||
def call_save_default_values(**kwargs):
|
||||
|
@ -25,5 +25,6 @@
|
||||
</button>
|
||||
<template-hook hook-name="loginFormButtons"></template-hook>
|
||||
</div>
|
||||
<a href="" ng-click="openPrivacyPolicyDialog()" translate>Privacy policy</a>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -0,0 +1,9 @@
|
||||
<h1 translate>Privacy policy</h1>
|
||||
<div ng-if="privacyPolicy" ng-bind-html="privacyPolicy | translate"></div>
|
||||
<div ng-if="!privacyPolicy" translate>
|
||||
The event manager hasn't set up a privacy policy yet.
|
||||
</div>
|
||||
|
||||
<button ng-click="closeThisDialog()" class="btn btn-default spacer-top" translate>
|
||||
Close
|
||||
</button>
|
@ -1778,6 +1778,26 @@ angular.module('OpenSlidesApp.users.site', [
|
||||
$scope.closeThisDialog();
|
||||
$state.go('home');
|
||||
};
|
||||
// quick fix, that we cannot change the state to the main privacy
|
||||
// policy view. Display it in a dialog..
|
||||
$scope.openPrivacyPolicyDialog = function () {
|
||||
ngDialog.open({
|
||||
template: 'static/templates/privacypolicydialog.html',
|
||||
className: 'ngdialog-theme-default wide-form',
|
||||
controller: 'PrivacyPolicyDialogCtrl',
|
||||
showClose: true,
|
||||
closeByEscape: true,
|
||||
closeByDocument: true,
|
||||
});
|
||||
};
|
||||
}
|
||||
])
|
||||
|
||||
.controller('PrivacyPolicyDialogCtrl', [
|
||||
'$scope',
|
||||
'PrivacyPolicy',
|
||||
function ($scope, PrivacyPolicy) {
|
||||
$scope.privacyPolicy = PrivacyPolicy;
|
||||
}
|
||||
])
|
||||
|
||||
|
@ -173,6 +173,7 @@ class WebclientJavaScriptView(TestCase):
|
||||
@patch('openslides.core.config.config')
|
||||
@patch('django.contrib.auth.models.Permission.objects.all')
|
||||
def test_permissions_as_constant(self, mock_permissions_all, mock_config):
|
||||
mock_config.__getitem__.return_value = ''
|
||||
self.view_instance = views.WebclientJavaScriptView()
|
||||
self.view_instance.request = self.request
|
||||
response = self.view_instance.get(realm='site')
|
||||
|
Loading…
Reference in New Issue
Block a user