mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
Merge branch 'dev' of git.sleede.com:projets/fab-manager into dev
This commit is contained in:
commit
36cc5b0b87
@ -1,29 +1,20 @@
|
||||
/* eslint-disable
|
||||
no-return-assign,
|
||||
no-undef,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
Application.Controllers.controller('AboutController', ['$scope', 'Setting', 'CustomAsset', function ($scope, Setting, CustomAsset) {
|
||||
/* PUBLIC SCOPE */
|
||||
|
||||
Setting.get({ name: 'about_title' }, data => $scope.aboutTitle = data.setting);
|
||||
Setting.get({ name: 'about_title' }, data => { $scope.aboutTitle = data.setting; });
|
||||
|
||||
Setting.get({ name: 'about_body' }, data => $scope.aboutBody = data.setting);
|
||||
Setting.get({ name: 'about_body' }, data => { $scope.aboutBody = data.setting; });
|
||||
|
||||
Setting.get({ name: 'about_contacts' }, data => $scope.aboutContacts = data.setting);
|
||||
Setting.get({ name: 'about_contacts' }, data => { $scope.aboutContacts = data.setting; });
|
||||
|
||||
Setting.get({ name: 'privacy_body' }, data => { $scope.privacyPolicy = data.setting; });
|
||||
|
||||
// retrieve the CGU
|
||||
CustomAsset.get({ name: 'cgu-file' }, cgu => $scope.cgu = cgu.custom_asset);
|
||||
CustomAsset.get({ name: 'cgu-file' }, cgu => { $scope.cgu = cgu.custom_asset; });
|
||||
|
||||
// retrieve the CGV
|
||||
return CustomAsset.get({ name: 'cgv-file' }, cgv => $scope.cgv = cgv.custom_asset);
|
||||
CustomAsset.get({ name: 'cgv-file' }, cgv => { $scope.cgv = cgv.custom_asset; });
|
||||
}
|
||||
]);
|
||||
|
@ -261,6 +261,10 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', '
|
||||
* Change the revision of the displayed privacy policy, from drafts history
|
||||
*/
|
||||
$scope.handlePolicyRevisionChange = function () {
|
||||
if ($scope.privacyPolicy.version === null) {
|
||||
$scope.privacyPolicy.bodyTemp = settingsPromise.privacy_body;
|
||||
return;
|
||||
}
|
||||
for (const draft of $scope.privacyDraftsHistory) {
|
||||
if (draft.id == $scope.privacyPolicy.version) {
|
||||
$scope.privacyPolicy.bodyTemp = draft.content;
|
||||
@ -308,7 +312,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', '
|
||||
}
|
||||
if (profileImageFile.custom_asset) {
|
||||
$scope.methods.profileImage = 'put';
|
||||
return $scope.actionUrl.profileImage += '/profile-image-file';
|
||||
$scope.actionUrl.profileImage += '/profile-image-file';
|
||||
}
|
||||
|
||||
privacyDraftsPromise.setting.history.forEach(function (draft) {
|
||||
@ -326,8 +330,8 @@ Application.Controllers.controller('SettingsController', ['$scope', '$filter', '
|
||||
/**
|
||||
* Controller used in the invoice refunding modal window
|
||||
*/
|
||||
Application.Controllers.controller('SavePolicyController', ['$scope', '$uibModalInstance', 'saveCb', 'privacyPolicy',
|
||||
function ($scope, $uibModalInstance, saveCb, privacyPolicy) {
|
||||
Application.Controllers.controller('SavePolicyController', ['$scope', '$uibModalInstance', '_t', 'growl', 'saveCb', 'privacyPolicy',
|
||||
function ($scope, $uibModalInstance, _t, growl, saveCb, privacyPolicy) {
|
||||
/* PUBLIC SCOPE */
|
||||
|
||||
/**
|
||||
@ -343,6 +347,7 @@ Application.Controllers.controller('SavePolicyController', ['$scope', '$uibModal
|
||||
*/
|
||||
$scope.publish = function () {
|
||||
saveCb({ name: 'privacy_body', value: privacyPolicy.bodyTemp });
|
||||
growl.info(_t('settings.privacy.users_notified'));
|
||||
$uibModalInstance.close('privacy_body');
|
||||
};
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@
|
||||
<p ng-show="cgv">
|
||||
<a href="{{cgv.custom_asset_file_attributes.attachment_url}}" target="_blank" translate>{{ 'about.read_the_fablab_s_general_terms_and_conditions' }}</a>
|
||||
</p>
|
||||
<p ng-show="cgv">
|
||||
<p ng-show="privacyPolicy.value">
|
||||
<a ui-sref="app.public.privacy" translate>{{ 'about.privacy_policy' }}</a>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<span ng-bind-html="privacyBody.value"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-offset-0 col-md-offset-0 col-lg-offset-1 col-sm-4 col-md-4">
|
||||
<div class="col-sm-offset-0 col-md-offset-0 col-lg-offset-1 col-sm-4 col-md-4" ng-show="privacyDpo.value">
|
||||
<h2 class="about-title-aside text-u-c" translate>{{ 'privacy.dpo' }}</h2>
|
||||
<span ng-bind-html="privacyDpo.value"></span>
|
||||
</div>
|
||||
|
@ -45,6 +45,7 @@ class NotificationType
|
||||
notify_admin_free_disk_space
|
||||
notify_admin_close_period_reminder
|
||||
notify_admin_archive_complete
|
||||
notify_privacy_policy_changed
|
||||
]
|
||||
# deprecated:
|
||||
# - notify_member_subscribed_plan_is_changed
|
||||
|
@ -42,12 +42,20 @@ class Setting < ActiveRecord::Base
|
||||
display_name_enable
|
||||
machines_sort_by] }
|
||||
|
||||
after_update :update_stylesheet if :value_changed?
|
||||
after_update :update_stylesheet, :notify_privacy_policy_changed if :value_changed?
|
||||
|
||||
def update_stylesheet
|
||||
Stylesheet.first&.rebuild! if %w[main_color secondary_color].include? name
|
||||
end
|
||||
|
||||
def notify_privacy_policy_changed
|
||||
return unless name == 'privacy_body'
|
||||
|
||||
NotificationCenter.call type: :notify_privacy_policy_changed,
|
||||
receiver: User.all,
|
||||
attached_object: self
|
||||
end
|
||||
|
||||
def value
|
||||
last_value = history_values.order(HistoryValue.arel_table['created_at'].desc).first
|
||||
last_value&.value
|
||||
|
@ -1,19 +1,20 @@
|
||||
module Reservations
|
||||
class Reserve
|
||||
attr_accessor :user_id, :operator_id
|
||||
# frozen_string_literal: true
|
||||
|
||||
def initialize(user_id, operator_id)
|
||||
@user_id = user_id
|
||||
@operator_id = operator_id
|
||||
end
|
||||
# Provides helper methods for Reservation actions
|
||||
class Reservations::Reserve
|
||||
attr_accessor :user_id, :operator_id
|
||||
|
||||
def pay_and_save(reservation, payment_method, coupon)
|
||||
reservation.user_id = user_id
|
||||
if payment_method == :local
|
||||
reservation.save_with_local_payment(operator_id, coupon)
|
||||
elsif payment_method == :stripe
|
||||
reservation.save_with_payment(operator_id, coupon)
|
||||
end
|
||||
def initialize(user_id, operator_id)
|
||||
@user_id = user_id
|
||||
@operator_id = operator_id
|
||||
end
|
||||
|
||||
def pay_and_save(reservation, payment_method, coupon)
|
||||
reservation.user_id = user_id
|
||||
if payment_method == :local
|
||||
reservation.save_with_local_payment(operator_id, coupon)
|
||||
elsif payment_method == :stripe
|
||||
reservation.save_with_payment(operator_id, coupon)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,34 +1,35 @@
|
||||
module Subscriptions
|
||||
class Subscribe
|
||||
attr_accessor :user_id, :operator_id
|
||||
# frozen_string_literal: true
|
||||
|
||||
def initialize(user_id, operator_id)
|
||||
@user_id = user_id
|
||||
@operator_id = operator_id
|
||||
end
|
||||
# Provides helper methods for Subscription actions
|
||||
class Subscriptions::Subscribe
|
||||
attr_accessor :user_id, :operator_id
|
||||
|
||||
def pay_and_save(subscription, payment_method, coupon, invoice)
|
||||
subscription.user_id = user_id
|
||||
if payment_method == :local
|
||||
subscription.save_with_local_payment(operator_id, invoice, coupon)
|
||||
elsif payment_method == :stripe
|
||||
subscription.save_with_payment(operator_id, invoice, coupon)
|
||||
end
|
||||
end
|
||||
def initialize(user_id, operator_id)
|
||||
@user_id = user_id
|
||||
@operator_id = operator_id
|
||||
end
|
||||
|
||||
def extend_subscription(subscription, new_expiration_date, free_days)
|
||||
return subscription.free_extend(new_expiration_date) if free_days
|
||||
|
||||
new_sub = Subscription.create(
|
||||
plan_id: subscription.plan_id,
|
||||
user_id: subscription.user_id,
|
||||
expiration_date: new_expiration_date
|
||||
)
|
||||
if new_sub.save
|
||||
new_sub.user.generate_subscription_invoice(operator_id)
|
||||
return new_sub
|
||||
end
|
||||
false
|
||||
def pay_and_save(subscription, payment_method, coupon, invoice)
|
||||
subscription.user_id = user_id
|
||||
if payment_method == :local
|
||||
subscription.save_with_local_payment(operator_id, invoice, coupon)
|
||||
elsif payment_method == :stripe
|
||||
subscription.save_with_payment(operator_id, invoice, coupon)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def extend_subscription(subscription, new_expiration_date, free_days)
|
||||
return subscription.free_extend(new_expiration_date) if free_days
|
||||
|
||||
new_sub = Subscription.create(
|
||||
plan_id: subscription.plan_id,
|
||||
user_id: subscription.user_id,
|
||||
expiration_date: new_expiration_date
|
||||
)
|
||||
if new_sub.save
|
||||
new_sub.user.generate_subscription_invoice(operator_id)
|
||||
return new_sub
|
||||
end
|
||||
false
|
||||
end
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
json.title notification.notification_type
|
||||
json.description t('.policy_updated') +
|
||||
"<a href='/#!/privacy-policy>#{t('.click_to_show')}</a>."
|
||||
json.url notification_url(notification, format: :json)
|
@ -0,0 +1,7 @@
|
||||
<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
|
||||
|
||||
<%= t('.body.content_html') %>
|
||||
|
||||
<p>
|
||||
<%=link_to( t('.body.link_to_policy'), "#{root_url}#!/privacy-policy", target: "_blank" )%>
|
||||
</p>
|
@ -724,6 +724,7 @@ en:
|
||||
save_or_publish_body: "Do you want to publish a new version of the privacy policy or save it as a draft?"
|
||||
publish_will_notify: "Publish a new version will send a notification to every users."
|
||||
publish: "Publish"
|
||||
users_notified: "Platform users will be notified of the update."
|
||||
|
||||
open_api_clients:
|
||||
add_new_client: "Create new API client"
|
||||
|
@ -724,6 +724,7 @@ es:
|
||||
save_or_publish_body: "Do you want to publish a new version of the privacy policy or save it as a draft?" # translation_missing
|
||||
publish_will_notify: "Publish a new version will send a notification to every users." # translation_missing
|
||||
publish: "Publish" # translation_missing
|
||||
users_notified: "Platform users will be notified of the update." # translation_missing
|
||||
|
||||
open_api_clients:
|
||||
add_new_client: "Crear un nuevo cliente de API"
|
||||
|
@ -724,6 +724,7 @@ fr:
|
||||
save_or_publish_body: "Voulez-vous publier une nouvelle version de la politique de confidentialité ou bien l'enregistrer comme brouillon ?"
|
||||
publish_will_notify: "Publier une nouvelle version enverra une notification à l'ensemble des utilisateurs."
|
||||
publish: "Publier"
|
||||
users_notified: "Les utilisateurs de la plateforme seront notifiés de la mise à jour."
|
||||
|
||||
open_api_clients:
|
||||
add_new_client: "Créer un compte client"
|
||||
|
@ -724,6 +724,7 @@ pt:
|
||||
save_or_publish_body: "Do you want to publish a new version of the privacy policy or save it as a draft?" # translation_missing
|
||||
publish_will_notify: "Publish a new version will send a notification to every users." # translation_missing
|
||||
publish: "Publish" # translation_missing
|
||||
users_notified: "Platform users will be notified of the update." # translation_missing
|
||||
|
||||
open_api_clients:
|
||||
add_new_client: "Criar novo cliente de API"
|
||||
|
@ -318,7 +318,9 @@ en:
|
||||
warning_no_closed_periods: "Please remind to periodically close your accounting periods. You have to close periods from %{FIRST_DATE}"
|
||||
notify_admin_archive_complete:
|
||||
archive_complete: "Data archiving from %{START} to %{END} is done. <a href='api/accounting_periods/%{ID}/archive' target='_blank'>click here to download</a>. Remember to save it on an external secured media."
|
||||
|
||||
notify_privacy_policy_changed:
|
||||
policy_updated: "Privacy policy updated."
|
||||
click_to_show: "Click here to consult"
|
||||
statistics:
|
||||
# statistics tools for admins
|
||||
subscriptions: "Subscriptions"
|
||||
|
@ -318,7 +318,9 @@ es:
|
||||
warning_no_closed_periods: "Please remind to periodically close your accounting periods. You have to close periods from %{FIRST_DATE}" # missing translation
|
||||
notify_admin_archive_complete: # missing translation
|
||||
archive_complete: "Data archiving from %{START} to %{END} is done. <a href='api/accounting_periods/%{ID}/archive' target='_blank'>click here to download</a>. Remember to save it on an external secured media." # missing translation
|
||||
|
||||
notify_privacy_policy_changed:
|
||||
policy_updated: "Privacy policy updated." # missing translation
|
||||
click_to_show: "Click here to consult" # missing translation
|
||||
statistics:
|
||||
# statistics tools for admins
|
||||
subscriptions: "Suscripciones"
|
||||
|
@ -318,6 +318,9 @@ fr:
|
||||
warning_no_closed_periods: "Pensez à clôturer régulièrement vos périodes comptables. Vous devez clôturer des périodes depuis le %{FIRST_DATE}"
|
||||
notify_admin_archive_complete:
|
||||
archive_complete: "L'archivage des données du %{START} au %{END} est terminé. <a href='api/accounting_periods/%{ID}/archive' target='_blank'>Cliquez ici pour la télécharger</a>. Pensez à l'enregistrer sur un support externe sécurisé."
|
||||
notify_privacy_policy_changed:
|
||||
policy_updated: "Nouvelle mise à jour de la Politique de confidentialité."
|
||||
click_to_show: "Cliquez ici pour la consulter"
|
||||
|
||||
statistics:
|
||||
# outil de statistiques pour les administrateurs
|
||||
|
@ -294,5 +294,11 @@ en:
|
||||
here: "here."
|
||||
save_on_secured: "Remember that you must save this archive on a secured external support, which may be requested by the tax authorities during a check."
|
||||
|
||||
notify_privacy_policy_changed:
|
||||
subject: "Privacy policy updated"
|
||||
body:
|
||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||
|
||||
shared:
|
||||
hello: "Hello %{user_name}"
|
||||
|
@ -293,5 +293,11 @@ es:
|
||||
here: "here."
|
||||
save_on_secured: "Remember that you must save this archive on a secured external support, which may be requested by the tax authorities during a check."
|
||||
|
||||
notify_privacy_policy_changed: #translation_missing
|
||||
subject: "Privacy policy updated"
|
||||
body:
|
||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||
|
||||
shared:
|
||||
hello: "¡Hola %{user_name}!"
|
||||
|
@ -294,5 +294,11 @@ fr:
|
||||
here: "ici."
|
||||
save_on_secured: "N'oubliez pas que vous devez obligatoirement enregistrer cette archive sur un support externe sécurisé, qui peut vous être demandé par l'administration fiscale lors d'un contrôle."
|
||||
|
||||
notify_privacy_policy_changed:
|
||||
subject: "Mise à jour de la Politique de confidentialité"
|
||||
body:
|
||||
content_html: "<p>Nous souhaitons vous signaler que nous venons de mettre à jour notre politique de confidentialité.</p><p>Nous pouvons apporter régulièrement des modifications à notre politique de confidentialité. Conformément à la réglementation, une notification vous sera envoyée à chaque mise à jour.</p><p>En accédant ou en utilisant nos services après la mise à jour de la Politique de confidentialité, nous considérerons que vous acceptez les termes de celle-ci, mises à jour comprises.</p>"
|
||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||
|
||||
shared:
|
||||
hello: "Bonjour %{user_name}"
|
||||
|
@ -294,5 +294,11 @@ pt:
|
||||
here: "here."
|
||||
save_on_secured: "Remember that you must save this archive on a secured external support, which may be requested by the tax authorities during a check."
|
||||
|
||||
notify_privacy_policy_changed: #translation_missing
|
||||
subject: "Privacy policy updated"
|
||||
body:
|
||||
content_html: "<p>We wish to inform you that we have just updated our privacy policy.</p><p>We may change our privacy policy regularly. In accordance with the regulations, you will receive a notification for each update.</p><p>By accessing or using our services after the privacy policy update, we will consider that you agree its terms, updates included.</p>"
|
||||
link_to_policy: "Cliquez ici pour consultez la politique de confidentialité."
|
||||
|
||||
shared:
|
||||
hello: "Olá %{user_name}"
|
||||
|
@ -318,7 +318,9 @@ pt:
|
||||
warning_no_closed_periods: "Please remind to periodically close your accounting periods. You have to close periods from %{FIRST_DATE}" # missing translation
|
||||
notify_admin_archive_complete: # missing translation
|
||||
archive_complete: "Data archiving from %{START} to %{END} is done. <a href='api/accounting_periods/%{ID}/archive' target='_blank'>click here to download</a>. Remember to save it on an external secured media." # missing translation
|
||||
|
||||
notify_privacy_policy_changed:
|
||||
policy_updated: "Privacy policy updated." # missing translation
|
||||
click_to_show: "Click here to consult" # missing translation
|
||||
statistics:
|
||||
# statistics tools for admins
|
||||
subscriptions: "Assinaturas"
|
||||
|
@ -1,8 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
|
||||
Spring.after_fork do
|
||||
if ENV['DEBUGGER_STORED_RUBYLIB']
|
||||
starter = ENV['BUNDLER_ORIG_RUBYOPT'][2..-1]
|
||||
load(starter + '.rb')
|
||||
ENV['DEBUGGER_STORED_RUBYLIB'].split(File::PATH_SEPARATOR).each do |path|
|
||||
next unless path =~ /ruby-debug-ide/
|
||||
load path + '/ruby-debug-ide/multiprocess/starter.rb'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user