Jelajahi Sumber

transition new api

itizawa 6 tahun lalu
induk
melakukan
7cbd8cf6c7

+ 6 - 0
src/server/service/config-loader.js

@@ -200,6 +200,12 @@ const ENV_VAR_NAME_TO_CONFIG_INFO = {
     type:    TYPES.STRING,
     type:    TYPES.STRING,
     default: null,
     default: null,
   },
   },
+  DELETE_COMPLETELY: {
+    ns:      'crowi',
+    key:     'security:isEnabledDeleteCompletely',
+    type:    TYPES.STRING,
+    default: false,
+  },
 };
 };
 
 
 class ConfigLoader {
 class ConfigLoader {

+ 0 - 5
src/server/util/swigFunctions.js

@@ -257,11 +257,6 @@ module.exports = function(crowi, app, req, locals) {
     return Config.isEnabledTimeline(config);
     return Config.isEnabledTimeline(config);
   };
   };
 
 
-  locals.isEnabledDeleteCompletely = function() {
-    const config = crowi.getConfig();
-    return Config.isEnabledDeleteCompletely(config);
-  };
-
   locals.isUploadable = function() {
   locals.isUploadable = function() {
     const config = crowi.getConfig();
     const config = crowi.getConfig();
     return Config.isUploadable(config);
     return Config.isUploadable(config);

+ 5 - 6
src/server/views/admin/security.html

@@ -139,16 +139,15 @@
           <!-- GC-1755 Change Sentence -->
           <!-- GC-1755 Change Sentence -->
           <div class="form-group">
           <div class="form-group">
             {% set configName = 'settingForm[security:isEnabledDeleteCompletely]' %}
             {% set configName = 'settingForm[security:isEnabledDeleteCompletely]' %}
-            {% set configValue = settingForm['security:isEnabledDeleteCompletely'] %}
-            {% set isEnabled = !configValue %}
+            {% set configValue = getConfig('crowi','security:isEnabledDeleteCompletely') %}
             <label for="{{configName}}" class="col-xs-3 control-label">ページを完全削除できるユーザーを制限する</label>
             <label for="{{configName}}" class="col-xs-3 control-label">ページを完全削除できるユーザーを制限する</label>
             <div class="col-xs-9">
             <div class="col-xs-9">
               <div class="btn-group btn-toggle" data-toggle="buttons">
               <div class="btn-group btn-toggle" data-toggle="buttons">
-                <label class="btn btn-default btn-rounded btn-outline {% if isEnabled %}active{% endif %}" data-active-class="primary">
-                  <input name="{{configName}}" value="false" type="radio" {% if isEnabled %}checked{% endif %}> ON
+                <label class="btn btn-default btn-rounded btn-outline {% if configValue %}active{% endif %}" data-active-class="primary">
+                  <input name="{{configName}}" value="true" type="radio" {% if configValue %}checked{% endif %}> ON
                 </label>
                 </label>
-                <label class="btn btn-default btn-rounded btn-outline {% if !isEnabled %}active{% endif %}" data-active-class="default">
-                  <input name="{{configName}}" value="true" type="radio" {% if !isEnabled %}checked{% endif %}> OFF
+                <label class="btn btn-default btn-rounded btn-outline {% if !configValue %}active{% endif %}" data-active-class="default">
+                  <input name="{{configName}}" value="false" type="radio" {% if !configValue %}checked{% endif %}> OFF
                 </label>
                 </label>
               </div>
               </div>