pvincent
2 years ago
7 changed files with 146 additions and 93 deletions
-
90lang/master/tpl/design.mtt
-
52package.json
-
2src/App.hx
-
51src/form/ColorRadioGroup.hx
-
42src/sugoi/BaseView.hx
-
2src/sugoi/Config.hx
-
BINwww/img/bandeau_region.png
@ -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.11.9"} |
|
||||
|
{ |
||||
|
"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.11.9" |
||||
|
} |
@ -1,46 +1,39 @@ |
|||||
package form; |
package form; |
||||
|
|
||||
import sugoi.form.elements.RadioGroup; |
import sugoi.form.elements.RadioGroup; |
||||
import Common; |
import Common; |
||||
|
|
||||
class ColorRadioGroup extends RadioGroup |
|
||||
{ |
|
||||
|
|
||||
public function new(name:String, label:String,selected:String) |
|
||||
{ |
|
||||
|
class ColorRadioGroup extends RadioGroup { |
||||
|
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) |
|
||||
{ |
|
||||
for (row in data) |
|
||||
{ |
|
||||
|
|
||||
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>"; |
|
||||
|
|
||||
|
if (data != null) { |
||||
|
for (row in data) { |
||||
|
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++; |
||||
} |
|
||||
|
} |
||||
} |
} |
||||
|
|
||||
|
|
||||
return s; |
return s; |
||||
} |
} |
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
} |
After Width: 1081 | Height: 526 | Size: 153 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue