Commit f0fd02aa authored by GROSS-AMBLARD David's avatar GROSS-AMBLARD David
Browse files

Testing select/option in task forms

parent e35cea1b
......@@ -1382,3 +1382,7 @@ CREATE OR REPLACE VIEW matrixSkyline AS SELECT task.id as idtask,duration,reward
CREATE OR REPLACE VIEW preferences AS select iduser,skill from skillTree JOIN skills ON id=idskill ORDER BY level DESC
CREATE OR REPLACE TABLE spipoll(id int,file varchar(100));
INSERT INTO `spipoll` (`id`, `file`) VALUES
(1, 'http://indicia.mnhn.fr/indicia/upload/1528364634244.jpg'),
(2, 'http://indicia.mnhn.fr/indicia/upload/1528362153105.jpg');
......@@ -6,10 +6,10 @@
"delete from profile",
"delete from task",
"insert into task(id,title,description,body,checker,checkermsg) values (1000,'Sandra Bullock Fan Project','Help us complete her profile','How many films star <b>Sandra Bullock<\/b>? <img width=\"30%\" src=\"files\/bullock.jpg\">','REGEXP \"^-?[0-9]+$\"','please, enter an integer'),(1002,'My Garden and me','Trivia about your garden','Which is the best month to plant roses ?',null,'free input')",
"insert into task(id,title,description,body,checker,checkermsg) select 3000+id,'Spipoll/HW',concat('Annotate difficult photo ',id,' from the <a href=\"http://www.spipoll.org\">Spipoll</a> project'),concat('Please propose a taxon for picture ',id,'<br/><img src=\"files\/spipoll\/',file,'\">'),null,'free input' from spipoll",
"insert into task(id,title,description,body,checker,checkermsg) select 3000+id,'Spipoll/HW',concat('Annotate difficult photo from the <a href=\"http://www.spipoll.org\">Spipoll</a> project'),concat('Please propose a taxon for picture ',id,'<br/><center><img width=\"200px\" src=\"',file,'\"></center><select><option>Le Ptinomorphe impérial</option><option>L Acméodère de la Piloselle</option></select>'),null,'free input' from spipoll",
"insert into task(id,title,description,body) values (1012,'University Mapper','Locate a nice campus','Please locate a nice campus on this map :<br/><iframe width=\"400\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://cartosm.eu/map?lon=-1.637529515986&lat=48.115186332395&zoom=16&width=400&height=350&mark=true&nav=true&pan=true&zb=bar&style=default&icon=down\"></iframe><br /><div id=\"cartosmlink\"><a href=\"http://www.openstreetmap.org/?mlat=48.115186332395&mlon=-1.637529515986&zoom=16&layers=M\" style=\"text-align:left;\">Voir sur une carte plus grande</a></div>')",
"insert into task(id, title,description,body) values (1013,'AI for local administration','Extract towns from administrative PDF files','<head><meta charset=\"UTF-8\"><meta name=\"description\" content=\"Crowd''n''Deep\"><meta name=\"author\" content=\"M2 MIAGE\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"></head><html><table><tr><td>Please identify the local area concerned by this file, along with the administrative decision</td></tr><tr><td><iframe src=\"http://localhost:8888/headwork/files/iat/arrete.pdf\" width=\"600\" height=\"500\" align=\"middle\"></iframe></td><td><iframe src=\"http://localhost:8888/headwork/files/iat/cerfa.pdf\" width=\"600\" height=\"500\" align=\"middle\"></iframe></td></tr></table><p><b>Informations</b></p><form><table><tr><td>Commune:</td><td><input name=\"commune\" id=\"commune\"></td></tr><tr><td>Decision:</td><td><select name=\"avis\" id=\"avis\"><option value=\"true\">Demande d''étude d''impact environnemental</option><option value=\"false\">Pas d''étude d''impact environnemental nécessaire</option><option value=\"null\">Pas de décision ou décision illisible</option></select></td></tr></table><br><button id=\"gen_JSON\">Envoyer</button><script>document.querySelector(\"#gen_JSON\").addEventListener(\"click\",function(){var e=document.querySelector(\"#commune\"),r=document.querySelector(\"#avis\");if(commune&&commune.value){var t={properties:{commune:e.value}};\"true\"==r.value?t.properties.etude_impact=!1:\"false\"==r.value&&(t.properties.etude_impact=!0),alert(\"JSON généré:\".concat(JSON.stringify(t)))}else alert(\"Veuillez remplir le champ Commune et vérifier le champ Décision avant de valider\")})</script></form></html>')",
"insert into profile values (1000,1001),(1000,1),(1002,1001),(1012,1),(1013,1)",
"insert into profile values (1000,1001),(1000,1),(1002,1001),(1012,1),(1013,1),(3001,1),(3002,1)",
"#insert into profile select id,'any' from task"
]
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment