- <#if user?? || !config.variableSummaryRequiresAuthentication>
+ <#if showVariableSummary>
<@variableSummary variable=variable/>
- <#else>
+ #if>
+ <#if showSigninForVariableSummary>
<@message "sign-in-for-variable-statistics"/>
<@message "sign-in"/>
#if>
diff --git a/mica-webapp/src/main/resources/i18n/en.json b/mica-webapp/src/main/resources/i18n/en.json
index 52712c561..eaa54aa34 100644
--- a/mica-webapp/src/main/resources/i18n/en.json
+++ b/mica-webapp/src/main/resources/i18n/en.json
@@ -432,8 +432,14 @@
},
"openAccess": "Open access",
"openAccess-help": "Access to published documents is opened to everyone.",
- "variableSummaryRequiresAuthentication": "Restricted access to variable summary statistics",
- "variableSummaryRequiresAuthentication-help": "The user needs to be identified when accessing to the variable summary statistics (and related operations like contingency table).",
+ "variableSummaryRequiresAuthentication": "Access to variable summary statistics",
+ "variableSummaryRequiresAuthentication-help": "The user may need to be identified when accessing to the variable summary statistics (and related operations like contingency table).",
+ "summaryStatisticsAccessPolicy-label": {
+ "OPEN_ALL": "Open",
+ "OPEN_SUMMARY": "Open basic counts open and detailed statistics and restricted contingency table",
+ "OPEN_BASICS": "Open basic counts open, restricted detailed statistics and contingency table",
+ "RESTRICTED_ALL": "Restricted statistics and contingency table"
+ },
"sections": "Sections",
"repository-enabled": "Repository enabled",
"repository-enabled-help": "Show network, initiative, study, protocol, dataset, variable pages with the search interface.",
diff --git a/mica-webapp/src/main/resources/i18n/fr.json b/mica-webapp/src/main/resources/i18n/fr.json
index 646e46563..26587087b 100644
--- a/mica-webapp/src/main/resources/i18n/fr.json
+++ b/mica-webapp/src/main/resources/i18n/fr.json
@@ -432,8 +432,14 @@
},
"openAccess": "Accès libre",
"openAccess-help": "L'accès aux documents publiés est ouvert à tout le monde.",
- "variableSummaryRequiresAuthentication": "Accès restreint aux statistiques des variables",
- "variableSummaryRequiresAuthentication-help": "L'utilisateur doit être identifié afin d'avoir accès aux statistiques de variables (sommaire, table de contingence etc.).",
+ "variableSummaryRequiresAuthentication": "Accès aux statistiques des variables",
+ "variableSummaryRequiresAuthentication-help": "L'identification de l'utilisateur peut être requise afin d'avoir accès aux statistiques de variables (sommaire, table de contingence).",
+ "summaryStatisticsAccessPolicy-label": {
+ "OPEN_ALL": "Ouvert",
+ "OPEN_SUMMARY": "Ouvert: décomptes de base et statistiques détaillées, Restreint: table de contingence",
+ "OPEN_BASICS": "Ouvert: décomptes de base, Restreint: statistiques détaillées et table de contingence",
+ "RESTRICTED_ALL": "Restreint"
+ },
"sections": "Sections",
"repository-enabled": "Catalogue activé",
"repository-enabled-help": "Montrer les pages du catalogue de réseaux, initiatives, études etc. ainsi que la page de recherche.",
diff --git a/mica-webapp/src/main/webapp/app/config/config-controller.js b/mica-webapp/src/main/webapp/app/config/config-controller.js
index 044388cbe..a94eed87d 100644
--- a/mica-webapp/src/main/webapp/app/config/config-controller.js
+++ b/mica-webapp/src/main/webapp/app/config/config-controller.js
@@ -514,6 +514,13 @@ mica.config
'ENTITY_TYPE'
];
+ $scope.summaryStatisticsAccessPolicyOptions = [
+ 'OPEN_ALL',
+ 'OPEN_SUMMARY',
+ 'OPEN_BASICS',
+ 'RESTRICTED_ALL'
+ ];
+
$scope.projectEnabledChanged = function() {
if (!$scope.micaConfig.isProjectEnabled) {
$scope.micaConfig.isProjectsCountEnabled = false;
diff --git a/mica-webapp/src/main/webapp/app/config/views/config-form.html b/mica-webapp/src/main/webapp/app/config/views/config-form.html
index b3871fe73..0ac5d43cf 100644
--- a/mica-webapp/src/main/webapp/app/config/views/config-form.html
+++ b/mica-webapp/src/main/webapp/app/config/views/config-form.html
@@ -74,9 +74,16 @@
config.content-edition
config.content-access
-
-
+
config.content-access
config.variableSummaryRequiresAuthentication-help
-
-
+ {{'config.summaryStatisticsAccessPolicy-label.' + micaConfig.summaryStatisticsAccessPolicy}}
|
diff --git a/mica-webapp/src/main/webapp/assets/js/mica-variable.js b/mica-webapp/src/main/webapp/assets/js/mica-variable.js
index ac0ba4983..3dbfea642 100644
--- a/mica-webapp/src/main/webapp/assets/js/mica-variable.js
+++ b/mica-webapp/src/main/webapp/assets/js/mica-variable.js
@@ -1,5 +1,5 @@
-const makeSummary = function(showHarmonizedVariableSummarySelector) {
+const makeSummary = function(summaryStatisticsAccessPolicy, showHarmonizedVariableSummarySelector) {
const initStudySelector = function(data) {
let selectStudy = $('#select-study');
@@ -48,7 +48,7 @@ const makeSummary = function(showHarmonizedVariableSummarySelector) {
renderFrequencies(data);
renderStatistics(data);
- if (!data.frequencies && !data.statistics) {
+ if (data.total === 0) {
$('#noSummary').show();
}
};
@@ -163,7 +163,7 @@ const makeSummary = function(showHarmonizedVariableSummarySelector) {
$('#loadingSummary').hide();
- if (showHarmonizedVariableSummarySelector && (data.frequencies || data.statistics)) {
+ if (showHarmonizedVariableSummarySelector && data.total) {
// study tables selector
initStudySelector(data);
}