1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

setting: phone_required

This commit is contained in:
Sylvain 2020-05-12 15:04:06 +02:00
parent e6cab62c73
commit 654d4b1cb4
7 changed files with 55 additions and 10 deletions

View File

@ -134,6 +134,11 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
value: (settingsPromise.fab_analytics === 'true')
};
$scope.phoneRequired = {
name: 'phone_required',
value: (settingsPromise.phone_required === 'true')
};
// By default, we display the currently published privacy policy
$scope.privacyPolicy = {
version: null,

View File

@ -1,11 +1,11 @@
<div class="panel panel-default m-t-md">
<div class="panel-heading">
<span class="font-sbold" translate>{{ 'app.admin.settings.privacy.title' }}</span>
<span class="font-sbold" translate>{{ 'app.admin.settings.privacy.privacy_policy' }}</span>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4 col-md-offset-1">
<div class="col-md-6 col-md-offset-1">
<select class="form-control m-b history-select" ng-options="d.id as d.name for d in privacyDraftsHistory" ng-model="privacyPolicy.version" ng-change="handlePolicyRevisionChange()">
<option value="" translate>{{ 'app.admin.settings.privacy.current_policy' }}</option>
</select>
@ -17,7 +17,7 @@
<span class="help-block text-info text-xs"><i class="fa fa-lightbulb-o"></i> {{ 'app.admin.settings.drag_and_drop_to_insert_images' | translate }}</span>
<button name="button" class="btn btn-warning" ng-click="savePrivacyPolicy()" translate>{{ 'app.shared.buttons.save' }}</button>
</div>
<div class="col-md-4 col-md-offset-2">
<div class="col-md-3 col-md-offset-1">
<div ng-model="privacyDpoSetting.value" medium-editor options='{"placeholder": "{{ "app.admin.settings.privacy.input_the_dpo" | translate }}",
"buttons": ["bold", "italic", "anchor", "header1", "header2" ]
}'>
@ -38,10 +38,10 @@
<div class="panel-body">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<label for="is_recurrent" translate>{{ 'app.admin.settings.fab_analytics' }}</label>
<label for="fab_analytics" translate>{{ 'app.admin.settings.fab_analytics' }}</label>
<input bs-switch
ng-model="fabAnalytics.value"
id="is_recurrent"
id="fab_analytics"
type="checkbox"
class="form-control"
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
@ -57,3 +57,30 @@
</div>
</div>
<div class="panel panel-default m-t-md">
<div class="panel-heading">
<span class="font-sbold" translate>{{ 'app.admin.settings.privacy.various_settings' }}</span>
</div>
<div class="panel-body">
<p class="alert alert-warning m-t" translate>
{{ 'app.admin.settings.privacy.phone_required_info' }}
</p>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<label for="phone_required" translate>{{ 'app.admin.settings.privacy.phone_required' }}</label>
<input bs-switch
ng-model="phoneRequired.value"
id="phone_required"
type="checkbox"
class="form-control"
switch-on-text="{{ 'app.shared.buttons.yes' | translate }}"
switch-off-text="{{ 'app.shared.buttons.no' | translate }}"
switch-animate="true"/>
<button name="button" class="btn btn-warning m-l" ng-click="save(phoneRequired)" translate>{{ 'app.shared.buttons.save' }}</button>
</div>
</div>
</div>
</div>

View File

@ -75,7 +75,8 @@ class Setting < ApplicationRecord
home_content
home_css
origin
uuid] }
uuid
phone_required] }
def value
last_value = history_values.order(HistoryValue.arel_table['created_at'].desc).first
last_value&.value

View File

@ -1019,6 +1019,7 @@ en:
display_name_enable: "name display"
machines_sort_by: "machines display order"
fab_analytics: "Fab Analytics"
phone_required: "phone required"
elements_ordering: "Elements ordering"
machines_order: "Machines order"
display_machines_sorted_by: "Display machines sorted by"
@ -1032,7 +1033,8 @@ en:
created_at: "Creation date"
updated_at: "Last update date"
privacy:
title: "Privacy policy"
title: "Privacy"
privacy_policy: "Privacy policy"
input_the_dpo: "Input the contact of the Data Protection Officer"
current_policy: "Current policy"
draft_from_USER_DATE: "Draft, saved by {USER}, on {DATE}"
@ -1056,6 +1058,9 @@ en:
online_payment: "Is the online payment module active?"
invoices: "Is the invoicing module active?"
openlab: "Is the project sharing module (OpenLab) active?"
various_settings: "Various settings"
phone_required: "Phone required"
phone_required_info: "You can define if the phone number should be required to register a new user on Fab-manager."
open_api_clients:
add_new_client: "Create new API client"
api_documentation: "API documentation"

View File

@ -1032,7 +1032,8 @@ es:
created_at: "Fecha de creación"
updated_at: "Fecha de actualización"
privacy:
title: "Política de privacidad"
title: "Privacidad"
privacy_policy: "Política de privacidad"
input_the_dpo: "Input the contact of the Data Protection Officer"
current_policy: "Política de privacidad"
draft_from_USER_DATE: "Borrador, guardado por {USER}, el {DATE}"

View File

@ -1019,6 +1019,7 @@ fr:
display_name_enable: "l'affichage du nom"
machines_sort_by: "l'ordre d'affichage des machines"
fab_analytics: "Fab Analytics"
phone_required: "téléphone requis"
elements_ordering: "Ordre d'affichage des éléments"
machines_order: "Ordre des machines"
display_machines_sorted_by: "Afficher les machines triées par"
@ -1032,7 +1033,8 @@ fr:
created_at: "Date de création"
updated_at: "Date de mise à jour"
privacy:
title: "Politique de confidentialité"
title: "Confidentialité"
privacy_policy: "Politique de confidentialité"
input_the_dpo: "Saisir le contact du Délégué à la protection des données"
current_policy: "Politique courante"
draft_from_USER_DATE: "Brouillon, enregistré par {USER}, le {DATE}"
@ -1056,6 +1058,9 @@ fr:
online_payment: "Le module de paiement par carte bancaire est-il actif ?"
invoices: "Le module est facturation est-il actif ?"
openlab: "Le module de partage de projets (OpenLab) est-il actif ?"
various_settings: "Paramètres divers"
phone_required: "Téléphone requis"
phone_required_info: "Vous pouvez définir si le numéro de téléphone doit être requis, lors de l'enregistrement d'un nouvel utilisateur sur Fab-manager."
open_api_clients:
add_new_client: "Créer un compte client"
api_documentation: "Documentation de l'API"

View File

@ -1032,7 +1032,8 @@ pt:
created_at: "Data de criação"
updated_at: "Última Data de Atualização"
privacy:
title: "Política de privacidade"
title: "Privacidade"
privacy_policy: "Política de privacidade"
input_the_dpo: "Input the contact of the Data Protection Officer"
current_policy: "Current policy"
draft_from_USER_DATE: "Draft, saved by {USER}, on {DATE}"