mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
configure the slots duration with an environment variable
This commit is contained in:
parent
12b9155b43
commit
cdc30e0da2
@ -30,7 +30,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state
|
||||
const BOOKING_SNAP = '00:30:00';
|
||||
|
||||
// We do not allow the creation of slots that are not a multiple of 60 minutes
|
||||
const SLOT_MULTIPLE = 60;
|
||||
const SLOT_MULTIPLE = Fablab.slotDuration;
|
||||
|
||||
/* PUBLIC SCOPE */
|
||||
|
||||
|
@ -7,7 +7,7 @@ module ApplicationHelper
|
||||
require 'message_format'
|
||||
|
||||
## machine/spaces availabilities are divided in multiple slots of 60 minutes
|
||||
SLOT_DURATION ||= 60
|
||||
SLOT_DURATION ||= Rails.application.secrets.slot_duration || 60
|
||||
|
||||
##
|
||||
# Verify if the provided attribute is in the provided attributes array, whatever it exists or not
|
||||
|
@ -20,6 +20,7 @@
|
||||
Fablab.withoutSpaces = ('<%= Rails.application.secrets.fablab_without_spaces %>' !== 'false');
|
||||
Fablab.withoutOnlinePayment = ('<%= Rails.application.secrets.fablab_without_online_payments %>' === 'true');
|
||||
Fablab.withoutInvoices = ('<%= Rails.application.secrets.fablab_without_invoices %>' === 'true');
|
||||
Fablab.slotDuration = parseInt("<%= ApplicationHelper::SLOT_DURATION %>", 10);
|
||||
Fablab.disqusShortname = "<%= Rails.application.secrets.disqus_shortname %>";
|
||||
Fablab.defaultHost = "<%= Rails.application.secrets.default_host %>";
|
||||
Fablab.gaId = "<%= Rails.application.secrets.google_analytics_id %>";
|
||||
|
@ -21,6 +21,8 @@ FABLAB_WITHOUT_SPACES: 'true'
|
||||
FABLAB_WITHOUT_ONLINE_PAYMENT: 'false'
|
||||
FABLAB_WITHOUT_INVOICES: 'false'
|
||||
|
||||
SLOT_DURATION: '60'
|
||||
|
||||
DEFAULT_MAIL_FROM: Fab Manager Demo <noreply@fab-manager.com>
|
||||
|
||||
# Configure carefully!
|
||||
|
@ -20,6 +20,7 @@ development:
|
||||
fablab_without_spaces: <%= ENV["FABLAB_WITHOUT_SPACES"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
slot_duration: <%= ENV["SLOT_DURATION"] %>
|
||||
default_host: <%= ENV["DEFAULT_HOST"] %>
|
||||
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
|
||||
time_zone: <%= ENV["TIME_ZONE"] %>
|
||||
@ -62,6 +63,7 @@ test:
|
||||
fablab_without_spaces: false
|
||||
fablab_without_online_payments: false
|
||||
fablab_without_invoices: false
|
||||
slot_duration: <%= ENV["SLOT_DURATION"] %>
|
||||
default_host: <%= ENV["DEFAULT_HOST"] %>
|
||||
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
|
||||
time_zone: Paris
|
||||
@ -104,6 +106,7 @@ staging:
|
||||
fablab_without_spaces: <%= ENV["FABLAB_WITHOUT_SPACES"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
slot_duration: <%= ENV["SLOT_DURATION"] %>
|
||||
default_host: <%= ENV["DEFAULT_HOST"] %>
|
||||
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
|
||||
delivery_method: <%= ENV['DELIVERY_METHOD'] %>
|
||||
@ -157,6 +160,7 @@ production:
|
||||
fablab_without_spaces: <%= ENV["FABLAB_WITHOUT_SPACES"] %>
|
||||
fablab_without_online_payments: <%= ENV["FABLAB_WITHOUT_ONLINE_PAYMENT"] %>
|
||||
fablab_without_invoices: <%= ENV["FABLAB_WITHOUT_INVOICES"] %>
|
||||
slot_duration: <%= ENV["SLOT_DURATION"] %>
|
||||
default_host: <%= ENV["DEFAULT_HOST"] %>
|
||||
default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %>
|
||||
delivery_method: <%= ENV['DELIVERY_METHOD'] %>
|
||||
|
@ -102,6 +102,12 @@ Valid stripe API keys are still required, even if you don't require online payme
|
||||
If set to 'true', the invoices will be disabled.
|
||||
This is useful if you have your own invoicing system and you want to prevent Fab-manager from generating and sending invoices to members.
|
||||
**Very important**: if you disable invoices, you still have to configure VAT in the interface to prevent errors in accounting and prices.
|
||||
<a name="SLOT_DURATION"></a>
|
||||
|
||||
SLOT_DURATION
|
||||
|
||||
Machine and space availabilities are divided in multiple slots of the duration set by this variable.
|
||||
Default value is 60 minutes (1 hour).
|
||||
<a name="DEFAULT_MAIL_FROM"></a>
|
||||
|
||||
DEFAULT_MAIL_FROM
|
||||
|
@ -14,6 +14,8 @@ FABLAB_WITHOUT_SPACES=true
|
||||
FABLAB_WITHOUT_ONLINE_PAYMENT=true
|
||||
FABLAB_WITHOUT_INVOICES=false
|
||||
|
||||
SLOT_DURATION=60
|
||||
|
||||
DEFAULT_MAIL_FROM=Fab Manager Demo <noreply@fab-manager.com>
|
||||
DEFAULT_HOST=demo.fab-manager.com
|
||||
DEFAULT_PROTOCOL=http
|
||||
|
Loading…
x
Reference in New Issue
Block a user