Browse Source

mentions légales

master
pvincent 2 years ago
parent
commit
5db8f5f1f3
  1. 3
      lang/master/tpl/footer.mtt
  2. 62
      lang/master/tpl/mentions_legales/default.mtt
  3. 52
      package.json
  4. 85
      src/controller/Main.hx
  5. 10
      src/controller/MentionsLegales.hx

3
lang/master/tpl/footer.mtt

@ -28,11 +28,12 @@
</div>
<div class="row" id="subfooter">
<p><a href="/mentions">MENTIONS LÉGALES</a></p>
<p>
version cagettepei-<a target="_blank" href="https://git.artcode.re/cagetters/cagettepei/src/tag/::VERSION::">::VERSION::</a>
</p>
::if BANDEAU_REGION::
<img src='/img/bandeau_region_france_relance.png' alt='bandeau Région Réunion' width='250'></img>
<img src='/img/bandeau_region_france_relance.png' alt='bandeau Région Réunion' width='640'></img>
::end::
</div>

62
lang/master/tpl/mentions_legales/default.mtt

@ -0,0 +1,62 @@
::use 'design.mtt'::
<div class="col-md-9">
<div class="article">
<h4>Mentions Légales</h4>
<table class="table table-bordered table-condensed">
<tbody><tr>
<th>Champ</th>
<th>Valeur</th>
</tr>
<tr>
<td>Adresse de courrier électronique</td>
<td>contact@mangue-et-solidaire.re</td>
</tr>
<tr>
<td>Numéro Siren</td>
<td>879178739</td>
</tr>
<tr>
<td>Numéro Siret</td>
<td>87917873900022</td>
</tr>
<tr>
<td>Code NAF / APE</td>
<td>4711B</td>
</tr>
<tr>
<td>Forme juridique et capital</td>
<td>Association Loi 1901</td>
</tr>
<tr>
<td>Responsable éditorial</td>
<td>Yann Jacob</td>
</tr>
<tr>
<td>Hébergeur</td>
<td><a href="www.artcode.re">Artcode</a></td>
</tr>
</tbody>
</table>
</div>
</div>
::end::

52
package.json

@ -1 +1,51 @@
{"name": "cagette-pei", "description": "le logiciel libre du circuit court", "license": "AGPL-3.0", "dependencies": {"bootstrap": "^3.3.4", "eonasdan-bootstrap-datetimepicker": "^4.7.14", "geolib": "^2.0.24", "haxe-modular": "^0.7.0", "jquery": "^2.2.4", "leaflet": "^1.3.1", "react": "^15.6.1", "react-bootstrap-typeahead": "1.4.2", "react-datetime": "^2.9.0", "react-dom": "^15.6.1", "react-leaflet": "^1.8.0", "react-places-autocomplete": "^6.0.2", "react-router": "^4.2.0", "react-router-dom": "^4.2.2"}, "devDependencies": {"babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babelify": "^7.3.0", "browserify": "^14.4.0", "cross-env": "^5.1.1", "node-sass": "^4.5.3", "npm-run-all": "^4.1.2", "uglify-js": "^3.1.9", "watchify": "^3.9.0"}, "scripts": {"build": "npm-run-all --parallel build:*", "build:js": "haxe cagetteJs.hxml", "build:sass": "node-sass www/css -o www/css", "watch:sass": "npm run build:sass -- --watch", "build2": "babel src -d lib", "libs:dev": "browserify js/libs/libs.js -o www/js/libs.js -d", "libs:prod": "cross-env NODE_ENV=production browserify js/libs/libs.js | uglifyjs -c -m > www/js/libs.js", "test": "haxe testsJS.hxml && node js/test/tests.js", "prepush": "npm test"}, "repository": {"type": "git", "url": "git+https://github.com/bablukid/cagette.git"}, "bugs": {"url": "https://github.com/bablukid/cagette/issues"}, "version": "1.14.1"}
{
"name": "cagette-pei",
"description": "le logiciel libre du circuit court",
"license": "AGPL-3.0",
"dependencies": {
"bootstrap": "^3.3.4",
"eonasdan-bootstrap-datetimepicker": "^4.7.14",
"geolib": "^2.0.24",
"haxe-modular": "^0.7.0",
"jquery": "^2.2.4",
"leaflet": "^1.3.1",
"react": "^15.6.1",
"react-bootstrap-typeahead": "1.4.2",
"react-datetime": "^2.9.0",
"react-dom": "^15.6.1",
"react-leaflet": "^1.8.0",
"react-places-autocomplete": "^6.0.2",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2"
},
"devDependencies": {
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babelify": "^7.3.0",
"browserify": "^14.4.0",
"cross-env": "^5.1.1",
"node-sass": "^4.5.3",
"npm-run-all": "^4.1.2",
"uglify-js": "^3.1.9",
"watchify": "^3.9.0"
},
"scripts": {
"build": "npm-run-all --parallel build:*",
"build:js": "haxe cagetteJs.hxml",
"build:sass": "node-sass www/css -o www/css",
"watch:sass": "npm run build:sass -- --watch",
"build2": "babel src -d lib",
"libs:dev": "browserify js/libs/libs.js -o www/js/libs.js -d",
"libs:prod": "cross-env NODE_ENV=production browserify js/libs/libs.js | uglifyjs -c -m > www/js/libs.js",
"test": "haxe testsJS.hxml && node js/test/tests.js",
"prepush": "npm test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bablukid/cagette.git"
},
"bugs": {
"url": "https://github.com/bablukid/cagette/issues"
},
"version": "1.14.1"
}

85
src/controller/Main.hx

@ -1,4 +1,5 @@
package controller;
import db.Distribution;
import db.UserContract;
import haxe.Json;
@ -9,12 +10,10 @@ import Common;
import tools.ArrayTool;
class Main extends Controller {
/**
* public pages
*/
function doGroup(d:haxe.web.Dispatch){
function doGroup(d:haxe.web.Dispatch) {
d.dispatch(new controller.Group());
}
@ -26,52 +25,52 @@ class Main extends Controller {
view.category = 'home';
var group = app.getCurrentGroup();
if ( app.user!=null && group == null) {
if (app.user != null && group == null) {
throw Redirect("/user/choose");
}else if (app.user == null && (group==null || group.regOption!=db.Amap.RegOption.Open) ) {
if (db.Amap.manager.get(1, false) != null) throw Redirect("/group/1");
else throw Redirect("/user/login");
} else if (app.user == null && (group == null || group.regOption != db.Amap.RegOption.Open)) {
if (db.Amap.manager.get(1, false) != null)
throw Redirect("/group/1");
else
throw Redirect("/user/login");
}
view.amap = group;
//contract with open orders
// contract with open orders
var openContracts = Lambda.filter(group.getActiveContracts(), function(c) return c.isUserOrderAvailable());
view.openContracts = openContracts;
//register to become "distributor"
view.contractsWithDistributors = app.user==null ? [] : Lambda.filter(app.user.amap.getActiveContracts(), function(c) return c.distributorNum > 0);
// register to become "distributor"
view.contractsWithDistributors = app.user == null ? [] : Lambda.filter(app.user.amap.getActiveContracts(), function(c) return c.distributorNum > 0);
//freshly created group
// freshly created group
view.newGroup = app.session.data.newGroup == true;
var n = Date.now();
var now = new Date(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0);
var in3Month = DateTools.delta(now, 1000.0 * 60 * 60 * 24 * 30 * 3);
var distribs = MultiDistrib.getFromTimeRange(group,now,in3Month);
var distribs = MultiDistrib.getFromTimeRange(group, now, in3Month);
view.distribs = distribs;
//view functions
// view functions
view.getWhosTurn = function(orderId:Int, distrib:Distribution) {
return db.UserContract.manager.get(orderId, false).getWhosTurn(distrib);
}
//event for additionnal blocks on home page
// event for additionnal blocks on home page
var e = Blocks([], "home");
app.event(e);
view.blocks = e.getParameters()[0];
//message if phone is required
if(app.user!=null && app.user.amap.flags.has(db.Amap.AmapFlags.PhoneRequired) && app.user.phone==null){
app.session.addMessage(t._("Members of this group should provide a phone number. <a href='/account/edit'>Please click here to update your account</a>."),true);
// message if phone is required
if (app.user != null && app.user.amap.flags.has(db.Amap.AmapFlags.PhoneRequired) && app.user.phone == null) {
app.session.addMessage(t._("Members of this group should provide a phone number. <a href='/account/edit'>Please click here to update your account</a>."),
true);
}
}
//login and stuff
// login and stuff
function doUser(d:Dispatch) {
d.dispatch(new controller.User());
}
@ -84,26 +83,19 @@ class Main extends Controller {
* JSON REST API Entry point
*/
function doApi(d:Dispatch) {
try {
d.dispatch(new controller.Api());
}catch (e:tink.core.Error){
//manage tink Errors (service errors)
} catch (e:tink.core.Error) {
// manage tink Errors (service errors)
sugoi.Web.setReturnCode(e.code);
Sys.print(Json.stringify( {error:{code:e.code,message:e.message,stack:e.exceptionStack}} ));
}catch (e:Dynamic){
//manage other errors
Sys.print(Json.stringify({error: {code: e.code, message: e.message, stack: e.exceptionStack}}));
} catch (e:Dynamic) {
// manage other errors
sugoi.Web.setReturnCode(500);
var stack = if ( App.config.DEBUG ) haxe.CallStack.toString(haxe.CallStack.exceptionStack()) else "";
var stack = if (App.config.DEBUG) haxe.CallStack.toString(haxe.CallStack.exceptionStack()) else "";
App.current.logError(e, stack);
Sys.print(Json.stringify( {error:{code:500,message : Std.string(e), stack:stack }} ));
Sys.print(Json.stringify({error: {code: 500, message: Std.string(e), stack: stack}}));
}
}
@tpl("cssDemo.mtt")
@ -116,15 +108,13 @@ class Main extends Controller {
d.dispatch(new controller.Install());
}
function doP(d:Dispatch) {
/*
* Invalid array access
Stack (ADMIN|DEBUG)
Stack (ADMIN|DEBUG)
Called from C:\HaxeToolkit\haxe\std/haxe/web/Dispatch.hx line 463
Called from controller/Main.hx line 117
Called from C:\HaxeToolkit\haxe\std/haxe/web/Dispatch.hx line 463
Called from controller/Main.hx line 117
*
var plugin = d.parts.shift();
for ( p in App.plugins) {
@ -142,7 +132,6 @@ Called from controller/Main.hx line 117
d.dispatch(new controller.Plugin());
}
@logged
function doMember(d:Dispatch) {
view.category = 'members';
@ -151,10 +140,17 @@ Called from controller/Main.hx line 117
@logged
function doStats(d:Dispatch) {
App.log('doStats called');
view.category = 'stats';
d.dispatch(new Stats());
}
function doMentions(d:Dispatch) {
App.log('do Mentions called');
view.category = 'mentions';
d.dispatch(new MentionsLegales());
}
@logged
function doAccount(d:Dispatch) {
view.category = 'account';
@ -240,8 +236,7 @@ Called from controller/Main.hx line 117
}
@logged
function doValidate(date:Date, place:db.Place, user:db.User, d:haxe.web.Dispatch){
function doValidate(date:Date, place:db.Place, user:db.User, d:haxe.web.Dispatch) {
var v = new controller.Validate();
v.date = date;
v.place = place;
@ -256,9 +251,7 @@ Called from controller/Main.hx line 117
@admin
function doDb(d:Dispatch) {
d.parts = []; //disable haxe.web.Dispatch
d.parts = []; // disable haxe.web.Dispatch
sys.db.Admin.handler();
}
}

10
src/controller/MentionsLegales.hx

@ -0,0 +1,10 @@
package controller;
class MentionsLegales extends Controller {
public function new() {
super();
}
@tpl("mentions_legales/default.mtt")
function doDefault() {}
}
Loading…
Cancel
Save