Commit 00987caf authored by thomas craipeau's avatar thomas craipeau
Browse files

Merge branch 'form'

parents ba2b7ba1 cdaacd06
......@@ -29,4 +29,5 @@ npm-debug.log
package-lock.json
/google-services.json
/GoogleService-Info.plist
/.deploy/
\ No newline at end of file
/.deploy/
/.deploy-node14/
\ No newline at end of file
......@@ -60,3 +60,6 @@ import '../imports/ui/notifications/notifications.js';
import '../imports/ui/projects/milestones/milestones.js';
import '../imports/ui/search/search.js';
import '../imports/ui/forms/answers/answers.js';
import '../imports/ui/forms/answers/comments/comments.js';
......@@ -68,6 +68,19 @@
@include align-self(center);
}
.row-alternate:nth-of-type(odd) {
background: #e0e0e0;
}
.row-alternate:nth-of-type(odd) {
@include item-style($item-stable-bg, $item-stable-border, $item-stable-text);
}
.row-alternate-positive:nth-of-type(odd) {
@include item-style($item-positive-bg, $item-positive-border, $item-positive-text);
}
/* Column Offsets */
.col-offset-10 {
margin-left: 10%;
......
......@@ -7,6 +7,7 @@
"Choice of pole": "Choice of pole",
"Choice_of_pole_description": "On this page you will have to choose among the different poles of your organization in order to see the events and the actions which are part of it. If you want to see the events by date, please go to \"agenda\"",
"search_action_placeholder": "Search for an action by name, #tag, :project...",
"search_answer_placeholder": "Search for a proposal by name, #tag, !status...",
"Choice of projects": "Les actions de l'organisation",
"Choice_of_projects_description": "Toutes les actions de votre organisation, des projets ou des évènements",
"Member": "Member",
......@@ -86,8 +87,105 @@
"No longer participate": "No longer participate",
"Action Finished": "Action Finished",
"In progress": "In progress",
"progress": "In progress",
"vote": "Under evaluation",
"finance": "Current financing ",
"call": "Call for participation",
"newaction": "New proposition",
"projectstate": "Project",
"suspend": "Suspended",
"Historical": "Historical",
"Filter answers": "Filter the proposals",
"Filter by status": "Filter by status",
"Sort answers by": "Sort proposals by",
"Answers": "Proposals",
"By": "By",
"On_date": "On",
"by status": "by status",
"Forms": "Call for proposals",
"creating a new answer": "create a new proposal",
"Add credit line": "Add credit line",
"answers": {
"Funding": "Funding",
"Project manager": "Project manager",
"funded": "funded",
"spent": "spent",
"totalAmount_funded_totalAmountPayement_spent": "__totalAmount__€ funded) ( __totalAmountPayement__€ spent)",
"Funded": "Funded",
"Payment": "Payment",
"Not funded": "Not funded",
"day": "day",
"day_plural": "days",
"Payment and follow-up": "Payment and follow-up",
"Estimates": "Estimates",
"TOTAL TO BE FINANCED": "TOTAL TO BE FINANCED",
"TOTAL FUNDED": "TOTAL FUNDED",
"TOTAL PAID": "TOTAL PAID",
"edit a answer": "edit a proposal",
"Expenses": "Expenses",
"add an expense line": "add an expense line",
"modify the expense line": "modify the expense line",
"add my estimate": "add my estimate",
"modify my estimate": "modify my estimate",
"Financing": "Financing",
"added a funder": "added a funder",
"modified the funder": "modified the funder",
"Need_funding_totalAmount_on_price": "Need funding : __totalAmount__€/__price__€",
"The financing was full before your modification, you can reduce it but you cannot increase it": "The financing was full before your modification, you can reduce it but you cannot increase it",
"You_can_put_a_maximum_amount_totalRemaining": "You can put a maximum amount <span class=\"positive\">__totalRemaining__€</span>",
"add the project manager": "add the project manager",
"modified the project manager": "modified the project manager",
"No member organization of this organization has the role of project manager": "No member organization of this organization has the role of project manager",
"Payement": "Payment",
"added a payement": "added a payment",
"Full payment already made for this funder": "Full payment already made for this funder",
"The_payment_of_totalPayement_has_already_been_made": "The payment of <span class=\"positive\">__totalPayement__€</span> has already been made",
"Payment_already_made_totalPayement_on_totalFinancer_remainder_to_pay_totalRest": "Payment already made __totalPayement__ €, on __totalFinancer__ €, remainder to pay __totalReste__ €",
"Delete this answer ?": "Delete this proposal ?",
"Answer actions": "Proposal actions",
"Add an expense line": "Add an expense line",
"Spent actions": "Spent actions",
"Delete this spent ?": "remove this expense ?",
"Add estimate": "Add estimate",
"Add a funder": "Add a funder",
"Add project manager": "Add project manager",
"Add payment": "Add payment",
"Delete project manager": "Delete project manager",
"Delete the project manager ?": "Delete the project manager ?",
"Estimate actions": "Estimate actions",
"Delete this estimate ?": "Delete this estimate ?",
"choose estimate": "choose estimate",
"estimate": "estimate",
"choose estimate ?": "choose estimate ?",
"Funding actions": "Funding actions",
"Delete this funding ?": "Delete this funding ?",
"Payment actions": "Payment actions",
"Delete this payment ?": "Delete this payment ?",
"answer_added": "proposal added",
"answer_updated": "proposal updated",
"answer_depense_added": "expense added",
"answer_depense_updated": "expense updated",
"answer_depense_estimate_added": "estimate added",
"answer_depense_estimate_updated": "estimate updated",
"answer_depense_finance_added": "finance added",
"answer_depense_finance_updated": "finance updated",
"answer_depense_worker_added": "worker added",
"answer_depense_worker_updated": "worker updated",
"answer_payement_added": "payment added",
"Generate project": "Generate project",
"generate project": "generate project",
"Generate a project ?": "Generate a project ?",
"The price is already reached with the current tasks": "The price is already reached with the current tasks",
"The spending limit has already been reached totalCreditTask": "The spending limit has already been reached <span class =\"positive\"> __totalCreditTask__ € </span>",
"The total of the tasks to finance on this line of expenditure totalCreditTask on totalFinancer remains to be paid totalReste": "The total of the tasks to be financed on this expenditure line are __totalCreditTask__ € out of __totalFinancer__ €, remains to be spent __totalReste__ €",
"Add task": "Add task",
"added a task": "added task",
"Tasks": "Tasks",
"modified the task": "modified the task",
"Delete this task ?": "Delete this task ?",
"Add answer": "Add proposal",
"creating a new answer": "create a new proposal"
},
"Tibillet card transfer": "Tibillet card transfer",
"Transfer your credits": "Transfer your credits",
"Transfer your credits to a card": "Transfer your credits to a card",
......@@ -134,7 +232,10 @@
"Personal Actions": "Personal Actions",
"Notifications": "Notifications",
"Sub-organizations": "Sub-organizations",
"Milestones": "Milestones"
"Milestones": "Milestones",
"DetailForm": "Details of the call for proposals",
"Answers": "List of proposals",
"Forms": "Call for proposals"
},
"contributor to validate": "__count__ contributor to validate",
"contributor to validate_plural": "__count__ contributors to validate",
......@@ -250,6 +351,7 @@
"Actions still to be done and without a contributor that have more than": "Actions still to be done and without a contributor that have more than",
"number_month": "__count__ month",
"number_month_plural": "__count__ months",
"No member organization of this organization has the role of project manager": "<i class=\"icon fa fa-warning\"></i> No member organization of this organization has the role of project manager",
"Image Library": "Image Library",
"Take photo": "Take photo",
"Retake": "Retake",
......@@ -272,7 +374,8 @@
"home": "Home",
"events": "Events",
"event": "Event",
"projects": "Project",
"project": "Projet",
"project_plural": "Projets",
"poi": "Poi",
"classified": "Classified",
"point of interest": "point of interest",
......@@ -1246,6 +1349,75 @@
}
}
},
"answersdepenserest": {
"group": {
"label": "group"
},
"nature": {
"label": "nature of the action"
},
"poste": {
"label": "Expense item",
"placeholder": "Expense item"
},
"price": {
"label": "Amount",
"placeholder": "Amount"
},
"days": {
"label": "Days",
"placeholder": "Days"
},
"amount": {
"label": "Amount Financed",
"placeholder": "Amount Financed"
},
"line": {
"label": "Fund, envelope or budget mobilized",
"placeholder": "Fund, envelope or budget mobilized"
},
"name": {
"label": "Name",
"placeholder": "Name"
},
"task": {
"label": "Task",
"placeholder": "Task"
},
"email": {
"label": "Email",
"placeholder": "EMail"
},
"communaute": {
"label": "From the community ?",
"placeholder": "From the community ?"
},
"financeurId": {
"label": "Financing",
"placeholder": "Choose One...",
"options": {
"select": "Choose One..."
}
},
"workType": {
"label": "Type of work performed",
"placeholder": "Type of work performed"
},
"workerId": {
"label": "Project manager",
"placeholder": "Choose One...",
"options": {
"select": "Choose One..."
}
},
"beneficiaryId": {
"label": "Beneficiary",
"placeholder": "Choose One...",
"options": {
"select": "Choose One..."
}
}
},
"organizationsocecorest": {
"oceco": {
"pole": {
......@@ -1293,6 +1465,12 @@
"milestonesProject": {
"label": "milestones project display"
},
"organizationForms": {
"label": "Activate organization calls for proposals"
},
"projectForms": {
"label": "Activate project calls for proposals"
},
"notificationChat": {
"label": "notification chat"
},
......@@ -1660,6 +1838,10 @@
}
},
"global": {
"urgent": {
"label": "urgent",
"placeholder": "urgent"
},
"name": {
"label": "name",
"placeholder": "name"
......
......@@ -7,6 +7,7 @@
"Choice of pole": "Choix du pôle",
"Choice_of_pole_description": "Sur cette page vous devrez choisir parmis les differents poles de votre organisation afin de voir les évenements et les actions qui en font partie. Si vous voulez voir les évenement par date merci de vous rendre dans \"agenda\"",
"search_action_placeholder": "Chercher une action par nom, #tag, :projet...",
"search_answer_placeholder": "Chercher une proposition par nom, #tag, !statut...",
"Choice of projects": "The actions of the organization",
"Choice_of_projects_description": "All the actions of your organization, projects or events",
"Member": "Membre",
......@@ -86,8 +87,105 @@
"No longer participate": "Ne plus participer",
"Action Finished": "Action Fini",
"In progress": "En cours",
"progress": "En cours",
"vote": "En évaluation",
"finance": "En financement",
"call": "Appel à participation",
"newaction": "Nouvelle proposition",
"projectstate": "En projet",
"suspend": "Suspendu",
"Historical": "Historiques",
"Filter answers": "Filtrer les propositions",
"Filter by status": "Filtrer par statut",
"Sort answers by": "Trier les propositions par",
"Answers": "Proposition",
"By": "Par",
"On_date": "Le",
"by status": "par statut",
"Forms": "Appel à propositions",
"creating a new answer": "créer une nouvelle proposition",
"Add credit line": "Ajout ligne crédit",
"answers": {
"Funding": "Financement",
"Project manager": "Maitre d'oeuvre",
"funded": "financé",
"spent": "dépensé",
"totalAmount_funded_totalAmountPayement_spent": "__totalAmount__€ financé ( __totalAmountPayement__€ dépensé)",
"Funded": "Financé",
"Payment": "Paiement",
"Not funded": "Non financé",
"day": "jour",
"day_plural": "jours",
"Payment and follow-up": "Paiement et suivi",
"Estimates": "Estimations",
"TOTAL TO BE FINANCED": "TOTAL A FINANCER",
"TOTAL FUNDED": "TOTAL FINANCÉ",
"TOTAL PAID": "TOTAL PAYÉ",
"edit a answer": "modifier une proposition",
"Expenses": "Dépenses",
"add an expense line": "ajouter une ligne de dépense",
"modify the expense line": "modifier la ligne de dépense",
"add my estimate": "ajouter mon estimation",
"modify my estimate": "modifier mon estimation",
"Financing": "Financement",
"added a funder": "ajouté un financeur",
"modified the funder": "modifier un financeur",
"Need_funding_totalAmount_on_price": "Besoin de financement : __totalAmount__€/__price__€",
"The financing was full before your modification, you can reduce it but you cannot increase it": "Le financement été complet avant votre modification, vous pouvez le reduire mais vous ne pouvez pas l'augmenter",
"You_can_put_a_maximum_amount_totalRemaining": "Vous pouvez mettre un montant maximum de <span class=\"positive\">__totalRemaining__€</span>",
"add the project manager": "ajouter le maitre d'oeuvre",
"modified the project manager": "modifier le maitre d'oeuvre",
"No member organization of this organization has the role of project manager": "Aucune organisation membre de cette organisation n'a le rôle de maitre d'oeuvre",
"Payement": "Paiement",
"added a payement": "ajouté un paiement",
"Full payment already made for this funder": "Paiement intégral déjà effectué pour ce financeur",
"The_payment_of_totalPayement_has_already_been_made": "Le paiment de <span class=\"positive\">__totalPayement__€</span> à déja été effectué",
"Payment_already_made_totalPayement_on_totalFinancer_remainder_to_pay_totalRest": "Paiement déja effecuté <span class=\"positive\">__totalPayement__€</span>, sur <span class=\"positive\">__totalFinancer__€</span>, reste à payer <span class=\"positive\">__totalReste__€</span>",
"Delete this answer ?": "Supprimer cette proposition ?",
"Answer actions": "actions proposition",
"Add an expense line": "Ajouter une ligne de dépense",
"Spent actions": "actions dépense",
"Delete this spent ?": "Supprimer cette dépense ?",
"Add estimate": "Ajouter une estimation",
"Add a funder": "Ajouter un financeur",
"Add project manager": "Ajouter un maitre d'oeuvre",
"Add payment": "Ajouter un paiement",
"Delete project manager": "Supprimer le maitre d'oeuvre",
"Delete the project manager ?": "Supprimer le maitre d'oeuvre ?",
"Estimate actions": "actions estimation",
"Delete this estimate ?": "Supprimer cette estimation ?",
"choose estimate": "choisir cette estimation",
"estimate": "estimation",
"choose estimate ?": "choisir cette estimation ?",
"Funding actions": "actions financeur",
"Delete this funding ?": "Supprimer ce financeur ?",
"Payment actions": "actions paiement",
"Delete this payment ?": "Supprimer ce paiement ?",
"answer_added": "proposition ajoutée",
"answer_updated": "proposition mise à jour",
"answer_depense_added": "dépenses ajoutées",
"answer_depense_updated": "dépense mise à jour",
"answer_depense_estimate_added": "estimation ajoutée",
"answer_depense_estimate_updated": "estimation mise à jour",
"answer_depense_finance_added": "financeur ajouté",
"answer_depense_finance_updated": "financeur mise à jour",
"answer_depense_worker_added": "maitre d'oeuvre ajouté",
"answer_depense_worker_updated": "maitre d'oeuvre mise à jour",
"answer_payement_added": "paiement ajouté",
"Generate project": "Générer un projet",
"generate project": "générer un projet",
"Generate a project ?": "Générer un projet ?",
"The price is already reached with the current tasks": "Le prix est déjà atteint avec les tâches en cours",
"The spending limit has already been reached totalCreditTask": "The spending limit has already been reached <span class =\"positive\"> __totalCreditTask__ € </span>",
"The total of the tasks to finance on this line of expenditure totalCreditTask on totalFinancer remains to be paid totalReste": "Le total des tâches à financer sur cette ligne de dépenses sont de __totalCreditTask__ € sur __totalFinancer__ €, reste à dépenser __totalReste__ €",
"Add task": "Ajouter une tâche",
"added a task": "Ajouter une tâche",
"Tasks": "Tâches",
"modified the task": "modifier la tâche",
"Delete this task ?": "Supprimer cette tâche ?",
"Add answer": "Ajouter proposition",
"creating a new answer": "ajouter une nouvelle proposition"
},
"Tibillet card transfer": "Transfert carte tibillet",
"Transfer your credits": "Transférer vos crédits",
"Transfer your credits to a card": "Transférer vos crédits sur une carte",
......@@ -134,7 +232,10 @@
"Personal Actions": "Actions Perso",
"Notifications": "Notifications",
"Sub-organizations": "Sous-organisations",
"Milestones": "Jalons"
"Milestones": "Jalons",
"DetailForm": "Détails de l'appel à propositions",
"Answers": "Liste des propositions",
"Forms": "Appel à propositions"
},
"contributor to validate": "__count__ contributeur à valider",
"contributor to validate_plural": "__count__ contributeurs à valider",
......@@ -251,6 +352,7 @@
"Actions still to be done and without a contributor that have more than": "Actions <strong>toujours à faire</strong> et <strong>sans contributeur</strong> qui ont plus de",
"number_month": "__count__ mois",
"number_month_plural": "__count__ mois",
"No member organization of this organization has the role of project manager": "<i class=\"icon fa fa-warning\"></i> Aucune organisation membre de cette organisation n'a le role de maitre d'oeuvre",
"Take photo": "Prendre une photo",
"Image Library": "Bibliothèque d'images",
"Retake": "Reprendre",
......@@ -273,7 +375,8 @@
"home": "Accueil",
"events": "Evénements",
"event": "Evénement",
"projects": "Projets",
"project": "Projet",
"project_plural": "Projets",
"poi": "Point d'intérêt",
"classified": "Annonces",
"point of interest": "Point d'intérêt",
......@@ -1294,6 +1397,12 @@
"milestonesProject": {
"label": "Activer les jalons (milestones) sur les projets"
},
"organizationForms": {
"label": "Activer les appels à propositions sur l'organisation"
},
"projectForms": {
"label": "Activer les appels à propositions sur les projets"
},
"notificationChat": {
"label": "Notification chat"
},
......@@ -1426,6 +1535,75 @@
}
}
},
"answersdepenserest": {
"group": {
"label": "Groupe"
},
"nature": {
"label": "Nature de l'action"
},
"poste": {
"label": "Poste de dépense",
"placeholder": "Poste de dépense"
},
"price": {
"label": "Montant",
"placeholder": "Montant"
},
"days": {
"label": "Nombre de jours",
"placeholder": "Nombre de jours"
},
"amount": {
"label": "Montant Financé",
"placeholder": "Montant Financé"
},
"line": {
"label": "Fonds, enveloppe ou budget mobilisé",
"placeholder": "Fonds, enveloppe ou budget mobilisé"
},
"name": {
"label": "Nom",
"placeholder": "Nom"
},
"task": {
"label": "Task",
"placeholder": "Task"
},
"email": {
"label": "Email",
"placeholder": "EMail"
},
"communaute": {
"label": "De la communauté ?",
"placeholder": "De la communauté ?"
},
"financeurId": {
"label": "Financeur",
"placeholder": "Sélectionnez un...",
"options": {
"select": "Sélectionnez un..."
}
},
"workType": {
"label": "Type de travail effectué",
"placeholder": "Type de travail effectué"
},
"workerId": {
"label": "Maître d'oeuvre",
"placeholder": "Sélectionnez un...",
"options": {
"select": "Sélectionnez un..."
}
},
"beneficiaryId": {
"label": "Bénéficiaire",
"placeholder": "Sélectionnez un...",
"options": {
"select": "Sélectionnez un..."
}
}
},
"projectsrest": {
"name": {
"label": "Nom"
......@@ -1661,6 +1839,10 @@
}
},
"global": {
"urgent": {
"label": "Urgent",
"placeholder": "Urgent"
},
"name": {
"label": "Nom",
"placeholder": "nom"
......
import { Mongo } from 'meteor/mongo';
// eslint-disable-next-line import/prefer-default-export
export const Answers = new Mongo.Collection('answers', { idGeneration: 'MONGO' });
import { Mongo } from 'meteor/mongo';
// eslint-disable-next-line import/prefer-default-export
export const Forms = new Mongo.Collection('forms', { idGeneration: 'MONGO' });
/* eslint-disable meteor/no-session */
/* global */
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { moment } from 'meteor/momentjs:moment';
// schemas
import { Answers } from '../collection/answers.js';
import { Citoyens } from '../collection/citoyens.js';
import { Projects } from '../collection/projects.js';
import { Comments } from '../collection/comments.js';
import { Forms } from '../collection/forms.js';
import { Actions } from '../collection/actions.js';
if (Meteor.isClient) {
import { Chronos } from '../client/chronos.js';
Answers.helpers({
isStartDate() {
if (this.startDate) {
// todo date pas correct en base
const start = moment(this.startDate, 'DD/MM/YYYY').toDate();
return Chronos.moment(start).isBefore(); // True
}
return false;
},
isNotStartDate() {
if (this.startDate) {
const start = moment(this.startDate, 'DD/MM/YYYY').toDate();
return Chronos.moment().isBefore(start); // True
}
return false;
},
isEndDate() {
if (this.endDate) {
const end = moment(this.endDate, 'DD/MM/YYYY').toDate();
return Chronos.moment(end).isBefore(); // True
}
return false;
},
isNotEndDate() {
if (this.endDate) {
const end = moment(this.endDate, 'DD/MM/YYYY').toDate();
return Chronos.moment().isBefore(end); // True
}
return false;
},
});
} else {
Answers.helpers({
isEndDate() {
if (this.endDate) {
const end = moment(this.endDate, 'DD/MM/YYYY').toDate();
return moment(end).isBefore(); // True
}
return false;
},
isNotEndDate() {
if (this.endDate) {
const end = moment(this.endDate, 'DD/MM/YYYY').toDate();
return moment().isBefore(end); // True
}
return false;
},
});
}
Answers.helpers({
isCreator() {
return this.user === Meteor.userId();
},
creatorProfile() {
return Citoyens.findOne({ _id: new Mongo.ObjectID(this.user) });
},
scopeVar() {