1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

updated messages about prices

This commit is contained in:
Sylvain 2020-05-06 16:55:26 +02:00
parent 5f7287cec7
commit 0a336f14e4
4 changed files with 27 additions and 6 deletions

View File

@ -617,6 +617,22 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state',
});
}
/**
* Return the exemple price based on the configuration of the default slot duration.
* @param type {string} 'hourly_rate' | *
* @returns {number} price for Fablab.slotDuration minutes.
*/
$scope.examplePrice = function(type) {
const hourlyRate = 10;
if (type === 'hourly_rate') {
return $filter('currency')(hourlyRate);
}
const price = (hourlyRate / 60) * Fablab.slotDuration;
return $filter('currency')(price);
}
/**
* Setup the feature-tour for the admin/pricing page.
* This is intended as a contextual help (when pressing F1)

View File

@ -1,5 +1,7 @@
<div class="alert alert-warning m-t">
{{ 'app.admin.pricing.these_prices_match_machine_hours_rates_' | translate:{DURATION:slotDuration} }} <span class="font-bold" translate>{{ 'app.admin.pricing._without_subscriptions' }}</span>.
<p ng-bind-html="'app.admin.pricing.these_prices_match_machine_hours_rates_html' | translate"></p>
<p ng-bind-html="'app.admin.pricing.prices_calculated_on_hourly_rate_html' | translate:{ DURATION:slotDuration, RATE: examplePrice('hourly_rate'), PRICE: examplePrice('final_price') }"></p>
<p translate>{{ 'app.admin.pricing.you_can_override' }}</p>
</div>
<table class="table">
<thead>

View File

@ -1,5 +1,7 @@
<div class="alert alert-warning m-t">
{{ 'app.admin.pricing.these_prices_match_space_hours_rates_' | translate:{DURATION:slotDuration} }} <span class="font-bold" translate>{{ 'app.admin.pricing._without_subscriptions' }}</span>.
<p ng-bind-html="'app.admin.pricing.these_prices_match_space_hours_rates_html' | translate"></p>
<p ng-bind-html="'app.admin.pricing.prices_calculated_on_hourly_rate_html' | translate:{ DURATION:slotDuration, RATE: examplePrice('hourly_rate'), PRICE: examplePrice('final_price') }"></p>
<p translate>{{ 'app.admin.pricing.you_can_override' }}</p>
</div>
<table class="table">
<thead>

View File

@ -283,8 +283,9 @@ en:
prominence: "Prominence"
price: "Price"
machine_hours: "Machine slots"
these_prices_match_machine_hours_rates_: "These prices match one slot of machine usage (default {DURATION} minutes), "
_without_subscriptions: "without subscriptions"
these_prices_match_machine_hours_rates_html: "The prices below match one hour of machine usage, <strong>without subscription</strong>."
prices_calculated_on_hourly_rate_html: "All the prices will be automatically calculated based on the hourly rate defined here.<br/><em>For example</em>, if you define an hourly rate at {RATE}: a slot of {DURATION} minutes (default), will be charged <strong>{PRICE}</strong>."
you_can_override: "You can override this duration for each availability you create in the agenda. The price will then be adjusted accordingly."
machines: "Machines"
credits: "Credits"
subscription: "Subscription"
@ -337,7 +338,7 @@ en:
forever: "Each use"
valid_until: "Valid until (included)"
spaces: "Spaces"
these_prices_match_space_hours_rates_: "These prices match one slot of space usage (default {DURATION} minutes), "
these_prices_match_space_hours_rates_html: "The prices below match one hour of space usage, <strong>without subscription</strong>."
add_a_space_credit: "Add a Space credit"
space: "Space"
error_a_credit_linking_this_space_with_that_subscription_already_exists: "Error : a credit linking this space with that subscription already exists."
@ -366,7 +367,7 @@ en:
copy_prices_from: "Copy prices from"
machines: "Machines"
machine: "Machine"
hourly_rate: "Price by slot"
hourly_rate: "Hourly rate"
spaces: "Spaces"
space: "Space"
unable_to_save_subscription_changes_please_try_again: "Unable to save subscription changes. Please try again."