Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a6f479d5c | ||
|
|
36d5e27bfb |
@@ -28,8 +28,6 @@ www/lang/*.mo
|
|||||||
www/js/app.js
|
www/js/app.js
|
||||||
www/js/libs.js
|
www/js/libs.js
|
||||||
|
|
||||||
www/file/*
|
|
||||||
|
|
||||||
www/css/.sass-cache
|
www/css/.sass-cache
|
||||||
www/css/*.css
|
www/css/*.css
|
||||||
!www/css/bootstrap.min.css
|
!www/css/bootstrap.min.css
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1.14.2
|
1.13.0
|
||||||
|
|||||||
@@ -123,8 +123,54 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
|
|
||||||
::use 'footer.mtt'::
|
<div class="row" id="footer">
|
||||||
::end::
|
|
||||||
|
|
||||||
|
<div class="col-md-2" >
|
||||||
|
<img width="120" style="border: white 5px solid;" src="/img/logo-mini.jpg" alt="::_("Cagette.net")::" title="Logo ::_("Cagette.net")::"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-7" style="padding-top:1em">
|
||||||
|
Cagette Péi est un logiciel libre qui favorise les circuits courts.<br/>
|
||||||
|
Il a été adapté pour les besoins des AMAPs sur le marché réunionnais.<br/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3" >
|
||||||
|
::_("HELP")::
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="http://www.cagette.net/wiki" target="_blank">::_("Documentation")::</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Proposer une amélioration</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Soumettre une anomalie</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" id="subfooter">
|
||||||
|
<span>version cagettepei-<a target="_blank" href="https://git.artcode.re/cagetters/cagettepei/src/tag/::VERSION::">::VERSION::</a></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<!-- SQL LOG -->
|
||||||
|
<table class="sqlLog table table-bordered" ::cond sqlLog::>
|
||||||
|
::foreach r sqlLog::
|
||||||
|
<tr ::attr class if(r.bad) 'badSql'::>
|
||||||
|
<td>::r.t::ms</td>
|
||||||
|
<td>::r.length::</td>
|
||||||
|
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
|
||||||
|
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
|
||||||
|
<td>::r.sql::</td>
|
||||||
|
</tr>
|
||||||
|
::end::
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
::end::
|
::end::
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
<div class="row" id="footer">
|
|
||||||
|
|
||||||
<div class="col-md-2" >
|
|
||||||
<img width="120" style="border: white 5px solid;" src="/img/logo-mini.jpg" alt="::_("Cagette.net")::" title="Logo ::_("Cagette.net")::"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-7" style="padding-top:1em">
|
|
||||||
Cagette Péi est un logiciel libre qui favorise les circuits courts.<br/>
|
|
||||||
Il a été adapté pour les besoins des AMAPs sur le marché réunionnais.<br/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-3" >
|
|
||||||
::_("HELP")::
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<a href="https://wiki.cagette.net/doku.php" target="_blank">::_("Documentation")::</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Proposer une amélioration</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Soumettre une anomalie</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</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='640'></img>
|
|
||||||
::end::
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<!-- SQL LOG -->
|
|
||||||
<table class="sqlLog table table-bordered" ::cond sqlLog::>
|
|
||||||
::foreach r sqlLog::
|
|
||||||
<tr ::attr class if(r.bad) 'badSql'::>
|
|
||||||
<td>::r.t::ms</td>
|
|
||||||
<td>::r.length::</td>
|
|
||||||
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
|
|
||||||
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
|
|
||||||
<td>::r.sql::</td>
|
|
||||||
</tr>
|
|
||||||
::end::
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
::use 'base.mtt'::
|
::use 'base.mtt'::
|
||||||
|
|
||||||
<div class="row header" style="margin-top:10px;">
|
|
||||||
<div class="col-md-8 col-md-offset-2" style="margin-top:12px;">
|
<div class="col-md-8 col-md-offset-2" style="margin-top:12px;">
|
||||||
|
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
@@ -185,8 +185,11 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="col-md-12">
|
||||||
::use 'footer.mtt'::
|
<div id="footer">
|
||||||
::end::
|
<a href="::_("http://www.cagette.net")::">::_("Cagette.net, the free software of food direct-selling")::</a>.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
::end::
|
::end::
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
::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::
|
|
||||||
+1
-1
@@ -1 +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.2"}
|
{"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.13.0"}
|
||||||
|
|||||||
+57
-52
@@ -1,5 +1,4 @@
|
|||||||
package controller;
|
package controller;
|
||||||
|
|
||||||
import db.Distribution;
|
import db.Distribution;
|
||||||
import db.UserContract;
|
import db.UserContract;
|
||||||
import haxe.Json;
|
import haxe.Json;
|
||||||
@@ -10,67 +9,67 @@ import Common;
|
|||||||
import tools.ArrayTool;
|
import tools.ArrayTool;
|
||||||
|
|
||||||
class Main extends Controller {
|
class Main extends Controller {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* public pages
|
* public pages
|
||||||
*/
|
*/
|
||||||
function doGroup(d:haxe.web.Dispatch) {
|
function doGroup(d:haxe.web.Dispatch){
|
||||||
d.dispatch(new controller.Group());
|
d.dispatch(new controller.Group());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Group homepage
|
Group homepage
|
||||||
**/
|
**/
|
||||||
@tpl("home.mtt")
|
@tpl("home.mtt")
|
||||||
function doDefault() {
|
function doDefault() {
|
||||||
view.category = 'home';
|
view.category = 'home';
|
||||||
|
|
||||||
var group = app.getCurrentGroup();
|
var group = app.getCurrentGroup();
|
||||||
if (app.user != null && group == null) {
|
if ( app.user!=null && group == null) {
|
||||||
throw Redirect("/user/choose");
|
throw Redirect("/user/choose");
|
||||||
} else if (app.user == null && (group == null || group.regOption != db.Amap.RegOption.Open)) {
|
}else if (app.user == null && (group==null || group.regOption!=db.Amap.RegOption.Open) ) {
|
||||||
if (db.Amap.manager.get(1, false) != null)
|
//throw Redirect("/user/login");
|
||||||
throw Redirect("/group/1");
|
throw Redirect("/group/1");
|
||||||
else
|
|
||||||
throw Redirect("/user/login");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
view.amap = group;
|
view.amap = group;
|
||||||
|
|
||||||
// contract with open orders
|
//contract with open orders
|
||||||
var openContracts = Lambda.filter(group.getActiveContracts(), function(c) return c.isUserOrderAvailable());
|
var openContracts = Lambda.filter(group.getActiveContracts(), function(c) return c.isUserOrderAvailable());
|
||||||
view.openContracts = openContracts;
|
view.openContracts = openContracts;
|
||||||
|
|
||||||
// register to become "distributor"
|
//register to become "distributor"
|
||||||
view.contractsWithDistributors = app.user == null ? [] : Lambda.filter(app.user.amap.getActiveContracts(), function(c) return c.distributorNum > 0);
|
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;
|
view.newGroup = app.session.data.newGroup == true;
|
||||||
|
|
||||||
var n = Date.now();
|
var n = Date.now();
|
||||||
var now = new Date(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0);
|
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 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.distribs = distribs;
|
||||||
|
|
||||||
// view functions
|
//view functions
|
||||||
view.getWhosTurn = function(orderId:Int, distrib:Distribution) {
|
view.getWhosTurn = function(orderId:Int, distrib:Distribution) {
|
||||||
return db.UserContract.manager.get(orderId, false).getWhosTurn(distrib);
|
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");
|
var e = Blocks([], "home");
|
||||||
app.event(e);
|
app.event(e);
|
||||||
view.blocks = e.getParameters()[0];
|
view.blocks = e.getParameters()[0];
|
||||||
|
|
||||||
// message if phone is required
|
//message if phone is required
|
||||||
if (app.user != null && app.user.amap.flags.has(db.Amap.AmapFlags.PhoneRequired) && app.user.phone == null) {
|
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>."),
|
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);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// login and stuff
|
//login and stuff
|
||||||
function doUser(d:Dispatch) {
|
function doUser(d:Dispatch) {
|
||||||
d.dispatch(new controller.User());
|
d.dispatch(new controller.User());
|
||||||
}
|
}
|
||||||
@@ -83,19 +82,26 @@ class Main extends Controller {
|
|||||||
* JSON REST API Entry point
|
* JSON REST API Entry point
|
||||||
*/
|
*/
|
||||||
function doApi(d:Dispatch) {
|
function doApi(d:Dispatch) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
d.dispatch(new controller.Api());
|
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);
|
sugoi.Web.setReturnCode(e.code);
|
||||||
Sys.print(Json.stringify({error: {code: e.code, message: e.message, stack: e.exceptionStack}}));
|
Sys.print(Json.stringify( {error:{code:e.code,message:e.message,stack:e.exceptionStack}} ));
|
||||||
} catch (e:Dynamic) {
|
|
||||||
// manage other errors
|
}catch (e:Dynamic){
|
||||||
|
|
||||||
|
//manage other errors
|
||||||
sugoi.Web.setReturnCode(500);
|
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);
|
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")
|
@tpl("cssDemo.mtt")
|
||||||
@@ -108,30 +114,33 @@ class Main extends Controller {
|
|||||||
d.dispatch(new controller.Install());
|
d.dispatch(new controller.Install());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function doP(d:Dispatch) {
|
function doP(d:Dispatch) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Invalid array access
|
* Invalid array access
|
||||||
Stack (ADMIN|DEBUG)
|
Stack (ADMIN|DEBUG)
|
||||||
|
|
||||||
Called from C:\HaxeToolkit\haxe\std/haxe/web/Dispatch.hx line 463
|
Called from C:\HaxeToolkit\haxe\std/haxe/web/Dispatch.hx line 463
|
||||||
Called from controller/Main.hx line 117
|
Called from controller/Main.hx line 117
|
||||||
*
|
*
|
||||||
var plugin = d.parts.shift();
|
var plugin = d.parts.shift();
|
||||||
for ( p in App.plugins) {
|
for ( p in App.plugins) {
|
||||||
var n = Type.getClassName(Type.getClass(p)).toLowerCase();
|
var n = Type.getClassName(Type.getClass(p)).toLowerCase();
|
||||||
n = n.split(".").pop();
|
n = n.split(".").pop();
|
||||||
if (plugin == n) {
|
if (plugin == n) {
|
||||||
d.dispatch( p.getController() );
|
d.dispatch( p.getController() );
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
throw Error("/","Plugin '"+plugin+"' introuvable.");
|
throw Error("/","Plugin '"+plugin+"' introuvable.");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
d.dispatch(new controller.Plugin());
|
d.dispatch(new controller.Plugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@logged
|
@logged
|
||||||
function doMember(d:Dispatch) {
|
function doMember(d:Dispatch) {
|
||||||
view.category = 'members';
|
view.category = 'members';
|
||||||
@@ -140,17 +149,10 @@ class Main extends Controller {
|
|||||||
|
|
||||||
@logged
|
@logged
|
||||||
function doStats(d:Dispatch) {
|
function doStats(d:Dispatch) {
|
||||||
App.log('doStats called');
|
|
||||||
view.category = 'stats';
|
view.category = 'stats';
|
||||||
d.dispatch(new Stats());
|
d.dispatch(new Stats());
|
||||||
}
|
}
|
||||||
|
|
||||||
function doMentions(d:Dispatch) {
|
|
||||||
App.log('do Mentions called');
|
|
||||||
view.category = 'mentions';
|
|
||||||
d.dispatch(new MentionsLegales());
|
|
||||||
}
|
|
||||||
|
|
||||||
@logged
|
@logged
|
||||||
function doAccount(d:Dispatch) {
|
function doAccount(d:Dispatch) {
|
||||||
view.category = 'account';
|
view.category = 'account';
|
||||||
@@ -236,7 +238,8 @@ class Main extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@logged
|
@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();
|
var v = new controller.Validate();
|
||||||
v.date = date;
|
v.date = date;
|
||||||
v.place = place;
|
v.place = place;
|
||||||
@@ -251,7 +254,9 @@ class Main extends Controller {
|
|||||||
|
|
||||||
@admin
|
@admin
|
||||||
function doDb(d:Dispatch) {
|
function doDb(d:Dispatch) {
|
||||||
d.parts = []; // disable haxe.web.Dispatch
|
d.parts = []; //disable haxe.web.Dispatch
|
||||||
sys.db.Admin.handler();
|
sys.db.Admin.handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package controller;
|
|
||||||
|
|
||||||
class MentionsLegales extends Controller {
|
|
||||||
public function new() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
@tpl("mentions_legales/default.mtt")
|
|
||||||
function doDefault() {}
|
|
||||||
}
|
|
||||||
+21
-14
@@ -1,34 +1,38 @@
|
|||||||
package form;
|
package form;
|
||||||
|
|
||||||
import sugoi.form.elements.RadioGroup;
|
import sugoi.form.elements.RadioGroup;
|
||||||
import Common;
|
import Common;
|
||||||
|
|
||||||
class ColorRadioGroup extends RadioGroup {
|
class ColorRadioGroup extends RadioGroup
|
||||||
public function new(name:String, label:String, selected:String) {
|
{
|
||||||
|
|
||||||
|
public function new(name:String, label:String,selected:String)
|
||||||
|
{
|
||||||
var data = [];
|
var data = [];
|
||||||
var i = 0;
|
var i = 0;
|
||||||
for (c in db.CategoryGroup.COLORS) {
|
for (c in db.CategoryGroup.COLORS) {
|
||||||
data.push({value: Std.string(c), label: Std.string(i)});
|
data.push( { value:Std.string(c), label:Std.string(i) } );
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
super(name, label, data, selected, "1", false, true);
|
super(name, label, data, selected, "1", false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function render():String {
|
override public function render():String
|
||||||
|
{
|
||||||
var s = "";
|
var s = "";
|
||||||
var n = parentForm.name + "_" + name;
|
var n = parentForm.name + "_" +name;
|
||||||
|
|
||||||
var c = 0;
|
var c = 0;
|
||||||
if (data != null) {
|
if (data != null)
|
||||||
for (row in data) {
|
{
|
||||||
var radio = "<input type=\"radio\" name=\"" + n + "\" id=\"" + n + c + "\" value=\"" + row.label + "\" "
|
for (row in data)
|
||||||
+ (row.label == Std.string(value) ? "checked" : "") + " />\n";
|
{
|
||||||
var img = "<div style='margin-right:16px;width:32px;height:32px;background:"
|
|
||||||
+ App.current.view.intToHex(Std.parseInt(row.value))
|
|
||||||
+ ";'></div>";
|
|
||||||
|
|
||||||
s += "<label for=\"" + n + c + "\" class='checkbox' style='display: inline-block;'>" + radio + " " + img + " </label>";
|
var radio = "<input type=\"radio\" name=\""+n+"\" id=\""+n+c+"\" value=\"" + row.label + "\" " + (row.label == Std.string(value) ? "checked":"") +" />\n";
|
||||||
|
|
||||||
|
var img = "<div style='margin-right:16px;width:32px;height:32px;background:"+App.current.view.intToHex(Std.parseInt(row.value))+";'></div>";
|
||||||
|
|
||||||
|
s += "<label for=\"" + n+c + "\" class='checkbox' style='display: inline-block;'>"+radio + " "+img+" </label>";
|
||||||
|
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
@@ -36,4 +40,7 @@ class ColorRadioGroup extends RadioGroup {
|
|||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -20,14 +20,12 @@ class BaseView implements Dynamic {
|
|||||||
this.HOST = App.config.HOST;
|
this.HOST = App.config.HOST;
|
||||||
this.DATA_HOST = App.config.DATA_HOST;
|
this.DATA_HOST = App.config.DATA_HOST;
|
||||||
this.DEBUG = App.config.DEBUG;
|
this.DEBUG = App.config.DEBUG;
|
||||||
this.BANDEAU_REGION = App.config.BANDEAU_REGION;
|
|
||||||
this.NAME = App.config.NAME;
|
this.NAME = App.config.NAME;
|
||||||
this.isAdmin = app.user != null && app.user.isAdmin();
|
this.isAdmin = app.user != null && app.user.isAdmin();
|
||||||
|
|
||||||
//Access basic functions in views
|
//Access basic functions in views
|
||||||
this.Std = Std;
|
this.Std = Std;
|
||||||
this.Math = Math;
|
this.Math = Math;
|
||||||
this.Config = App.config;
|
|
||||||
|
|
||||||
|
|
||||||
if ( App.config.SQL_LOG ) {
|
if ( App.config.SQL_LOG ) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class Config {
|
|||||||
public var TPL:String;
|
public var TPL:String;
|
||||||
public var TPL_TMP:String;
|
public var TPL_TMP:String;
|
||||||
public var DEBUG:Bool;
|
public var DEBUG:Bool;
|
||||||
public var BANDEAU_REGION:Bool;
|
|
||||||
public var HOST:String;
|
public var HOST:String;
|
||||||
public var NAME:String;
|
public var NAME:String;
|
||||||
public var KEY:String;
|
public var KEY:String;
|
||||||
@@ -29,7 +28,6 @@ class Config {
|
|||||||
TPL = PATH + "lang/" + LANG + "/tpl/";
|
TPL = PATH + "lang/" + LANG + "/tpl/";
|
||||||
TPL_TMP = PATH + "lang/" + LANG + "/tmp/";
|
TPL_TMP = PATH + "lang/" + LANG + "/tmp/";
|
||||||
DEBUG = get("debug", "0") == "1";
|
DEBUG = get("debug", "0") == "1";
|
||||||
BANDEAU_REGION = get("bandeau_region", "0") == "1";
|
|
||||||
HOST = get("host");
|
HOST = get("host");
|
||||||
KEY = get("key");
|
KEY = get("key");
|
||||||
DATA_HOST = get("dataHost", "data." + HOST);
|
DATA_HOST = get("dataHost", "data." + HOST);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 153 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 212 KiB |
Reference in New Issue
Block a user