config of logged routes

This commit is contained in:
tykayn 2019-07-04 14:07:49 +02:00
parent 8e3ba4ed5f
commit 97717179cf
6 changed files with 391 additions and 391 deletions

0
LICENSE Normal file → Executable file
View File

View File

@ -1,4 +1,3 @@
fos_user_profile: fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml" resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile prefix: /profile
@ -39,19 +38,19 @@ app_sell_record:
type: annotation type: annotation
# async calls
get_my_products: get_my_products:
path: /get-my-products path: /logged/get-my-products
defaults: { _controller: AppBundle:Default:getMyProducts } defaults: { _controller: AppBundle:Default:getMyProducts }
get_my_expenses: get_my_expenses:
path: /get-my-expenses path: /logged/get-my-expenses
defaults: { _controller: AppBundle:Default:getMyExpenses } defaults: { _controller: AppBundle:Default:getMyExpenses }
save_my_expenses: save_my_expenses:
path: /save-my-expenses path: /logged/save-my-expenses
defaults: { _controller: AppBundle:Default:saveMyExpenses } defaults: { _controller: AppBundle:Default:saveMyExpenses }
add_selling: add_selling:
path: /add-selling path: /logged/add-selling
defaults: { _controller: AppBundle:Default:addSelling } defaults: { _controller: AppBundle:Default:addSelling }
fos_user: fos_user:

View File

@ -34,6 +34,7 @@ security:
access_control: access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/dashboard$, role: IS_AUTHENTICATED_REMEMBERED } - { path: ^/dashboard$, role: IS_AUTHENTICATED_REMEMBERED }
- { path: ^/logged$, role: IS_AUTHENTICATED_REMEMBERED }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN } - { path: ^/admin/, role: ROLE_ADMIN }

View File

@ -30,17 +30,17 @@ angular
$scope.pausedSelling = []; $scope.pausedSelling = [];
$scope.show_config = { $scope.show_config = {
stock_count: false, stock_count: false,
sold: true, sold : true,
}; };
$scope.activeItemsSold = []; // list of products ID to sell $scope.activeItemsSold = []; // list of products ID to sell
$scope.activeSelling = []; // list of products to sell $scope.activeSelling = []; // list of products to sell
$scope.activeFestival = { // an event where selling take place $scope.activeFestival = { // an event where selling take place
id: null, id : null,
name: "le festival", name : "le festival",
dateCreation: new Date(), dateCreation : new Date(),
chiffreAffaire: 0, chiffreAffaire: 0,
clientsCount: 0, clientsCount : 0,
commentaire: "" commentaire : ""
}; };
/** /**
* get the sum of products prices * get the sum of products prices
@ -119,7 +119,7 @@ angular
// http related calls // http related calls
$scope.fetchProductsFromDB = function () { $scope.fetchProductsFromDB = function () {
console.log('fetch products...'); console.log('fetch products...');
$http.get('get-my-products').then((rep) => { $http.get('logged/get-my-products').then((rep) => {
console.log('ok', rep); console.log('ok', rep);
customCategories = []; customCategories = [];
@ -166,28 +166,28 @@ angular
$scope.sendForm = function () { $scope.sendForm = function () {
console.log('$scope.sellingComment', this.sellingComment); console.log('$scope.sellingComment', this.sellingComment);
let lesParams = { let lesParams = {
paidByClient: this.paidAmount, paidByClient : this.paidAmount,
sellingComment: this.sellingComment, sellingComment: this.sellingComment,
activeSelling: this.activeSelling, activeSelling : this.activeSelling,
activeFestival: this.activeFestival activeFestival: this.activeFestival
}; };
$scope.recentSellings.push({ $scope.recentSellings.push({
id: this.recentId++, id : this.recentId++,
amount: this.CurrentSellingTotal(), amount : this.CurrentSellingTotal(),
paidAmount: this.paidAmount, paidAmount: this.paidAmount,
products: products :
angular angular
.copy(this.activeSelling) .copy(this.activeSelling)
}); });
console.log('$scope.recentSellings', this.recentSellings); console.log('$scope.recentSellings', this.recentSellings);
$scope.lesParams = lesParams; $scope.lesParams = lesParams;
$http({ $http({
method: 'POST', method : 'POST',
url: 'add-selling', url : 'add-selling',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
data: lesParams // pass in data as strings data : lesParams // pass in data as strings
}).then(function (rep) { }).then(function (rep) {
$scope.clearCurrentSelling(); $scope.clearCurrentSelling();
// if successful, bind success message to message // if successful, bind success message to message
@ -226,19 +226,19 @@ angular
.controller('previsionnelCtrl', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) { .controller('previsionnelCtrl', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) {
$scope.config = { $scope.config = {
initialLoadingDone: false, initialLoadingDone : false,
loading: false, loading : false,
lines: 24, lines : 24,
debounceTime: 300, // miliseconds to wait before updating model and saving changes debounceTime : 300, // miliseconds to wait before updating model and saving changes
/** /**
* expenses kind of the user * expenses kind of the user
*/ */
disponibility: 5000, disponibility : 5000,
averageMonthlyEarnings: 600, averageMonthlyEarnings: 600,
warningThershold: 2000, warningThershold : 2000,
showDelays: false, showDelays : false,
showRepeats: false, showRepeats : false,
monthsBeforeNoMoney: null, monthsBeforeNoMoney : null,
}; };
let exampleExpenses = [ let exampleExpenses = [
@ -278,7 +278,7 @@ angular
// TODO take in account delays in expenses // TODO take in account delays in expenses
available = available - monthly + $scope.config.averageMonthlyEarnings; available = available - monthly + $scope.config.averageMonthlyEarnings;
let newLine = { let newLine = {
expense: monthly, expense : monthly,
available: available, available: available,
}; };
@ -299,8 +299,8 @@ angular
for (let i = 0; i < previsionTable.length; i++) { for (let i = 0; i < previsionTable.length; i++) {
$scope.graphPointsPrevision.push({ $scope.graphPointsPrevision.push({
label: previsionTable[i].available + " euros restants dans " + i + " mois", label: previsionTable[i].available + " euros restants dans " + i + " mois",
y: previsionTable[i].available, y : previsionTable[i].available,
x: i, x : i,
}) })
} }
@ -345,7 +345,7 @@ angular
$scope.config.loading = true; $scope.config.loading = true;
$http.post('save-my-expenses', { $http.post('save-my-expenses', {
expenses: $scope.expenses, expenses: $scope.expenses,
config: $scope.config config : $scope.config
}) })
.then((rep) => { .then((rep) => {
console.log('save-my-expenses', rep); console.log('save-my-expenses', rep);
@ -355,9 +355,9 @@ angular
}; };
$scope.addExpense = () => { $scope.addExpense = () => {
$scope.expenses.push({ $scope.expenses.push({
name: "", name : "",
repeat: 0, repeat: 0,
delay: 0, delay : 0,
amount: 0, amount: 0,
}) })
}; };
@ -376,10 +376,10 @@ angular
text: "Euros disponibles dans le temps" text: "Euros disponibles dans le temps"
}, },
// animationEnabled: true, // animationEnabled: true,
data: [ data : [
{ {
// Change type to "doughnut", "line", "splineArea", etc. // Change type to "doughnut", "line", "splineArea", etc.
type: "splineArea", type : "splineArea",
dataPoints: dataPoints dataPoints: dataPoints
} }
] ]

0
web/config.php Normal file → Executable file
View File