Commit b7feabc4 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Update fixture and installation instructions

parent 136588dc
......@@ -11,9 +11,11 @@ parameters:
secret: ThisTokenIsNotSoSecretChangeIt
csrf_protection: true
oauth_communs_id: localhost-marc
oauth_communs_secret: 521099d1-2d75-45b2-8955-6add560f70c1
oauth_google_id: localhost-marc
oauth_google_secret: 521099d1-2d75-45b2-8955-6add560f70c1
oauth_facebook_id: localhost-marc
oauth_facebook_secret: 521099d1-2d75-45b2-8955-6add560f70c1
oauth_communs_id: communsIds
oauth_communs_secret: communsSecret
oauth_google_id: googleId
oauth_google_secret: googleSecret
oauth_facebook_id: facebookId
oauth_facebook_secret: facebookSecret
router.request_context.host: localhost/GoGoCarto/app_dev.php
#alias ssh_colibris="ssh -p 22102 -o useroaming=no -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 admin@carto-dev.colibris-outilslibres.org"
#!/bin/bash
WEB_DIR=/var/www/html
WEB_USR=www-data
......@@ -63,7 +61,7 @@ else
echo "extension=mongo.so" >> /etc/php5/fpm/php.ini
fi
# NODEJS
# NODEJSsudo apt-get install -y make php5-dev php-pear
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -L https://npmjs.org/install.sh | sudo s
......
......@@ -3,7 +3,7 @@ Installation and Production Instructions
Feel free to add some more informations if you solve installation issues !
*There is a script for debian installation called install_debian.sh in this docs directory !*
*There is a script for debian installation called install_debian.sh in this docs directory ! * The script is more appropriate for production server installation, but having a look to the script can probably help you for some steps.
Requirements
------------
......@@ -15,14 +15,20 @@ Requirements
5. Web Server (Apache, Ngninx, [Wamp server](http://www.wampserver.com/) ...)
6. MongoDB (http://php.net/manual/fr/mongodb.installation.php)
the project is using php5. If you want to use php7, you will need to install the [MongoPhpAdapter](https://github.com/alcaeus/mongo-php-adapter)
To do so, please run :
```
composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter
```
Installation
------------
### Cloning repo (clone dev branch)
```
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
git clone -b dev https://github.com/Biopen/CartoV3.git
cd CartoV3/
git clone https://github.com/pixelhumain/GoGoCarto
cd GoGoCarto/
```
### Installing dependencies
......@@ -60,7 +66,8 @@ gulp watch
Generate Database
-----------------
Go to symfony console : http://localhost/PagesVertes/web/app_dev.php/_console
Go to symfony console : http://localhost/GoGoCarto/web/app_dev.php/_console
Run the followings command
```
doctrine:mongodb:schema:create
doctrine:mongodb:generate:hydrators
......@@ -68,16 +75,13 @@ doctrine:mongodb:generate:proxies
doctrine:mongodb:fixtures:load
```
Load defaul admin user "admin/admin"
```
doctrine:fixtures:load
```
The last command will generate a basic configuration, and two default users : "admin/admin" and "user/user"
Then generate if necessary random point on the map :
app:elements:generate 200
Everthing is ready, enjoy :
http://localhost/PagesVertes/web/app_dev.php
http://localhost/GoGoCarto/web/app_dev.php
Production
----------
......
......@@ -18,6 +18,10 @@ class LoadConfiguration implements FixtureInterface
{
$configuration = new Configuration();
$configuration->setAppName("GoGoCarto");
$configuration->setAppSlug("gogocarto");
$configuration->setAppBaseline("Créez des cartes à GoGo");
// FEATURES
$configuration->setFavoriteFeature( new FeatureConfiguration(true, false, true, true, true));
$configuration->setShareFeature( new FeatureConfiguration(true, true, true, true, true));
......@@ -25,9 +29,12 @@ class LoadConfiguration implements FixtureInterface
$configuration->setDirectionsFeature(new FeatureConfiguration(true, true, true, true, true));
$configuration->setReportFeature( new FeatureConfiguration(true, false, true, true, false));
$configuration->setPendingFeature( new FeatureConfiguration(true, false, true, true, true));
$configuration->setSendMailFeature( new InteractionConfiguration(true, false, true, true, true, true));
$configuration->setCustomPopupFeature( new FeatureConfiguration());
$configuration->setStampFeature( new FeatureConfiguration());
$configuration->setAddFeature( new InteractionConfiguration(true, true, false, false, true, true));
$configuration->setEditFeature( new InteractionConfiguration(true, true, false, false, true, true));
$configuration->setAddFeature( new InteractionConfiguration(true, true, false, true, true, true));
$configuration->setEditFeature( new InteractionConfiguration(true, true, false, true, true, true));
$configuration->setDeleteFeature( new InteractionConfiguration(true, false, false, false, false, true));
$configuration->setCollaborativeModerationFeature( new InteractionConfiguration(true, false, false, false, true, true));
$configuration->setDirectModerationFeature( new InteractionConfiguration(true, false, false, false, true, true));
......@@ -62,15 +69,19 @@ class LoadConfiguration implements FixtureInterface
$secondary = $pink ;
$background = $greyLight ;
$textColor = $neutralDark ;
$textColor = $softDarkblue ;
$disableColor = $blueLight ;
$listTitle = $neutralDark ;
$listTitleBackBtn = $neutralDark;
$listTitleBackground = $background ;
$mainFont = 'Roboto' ;
$titleFont = 'Lobster' ;
$taxonomyMainTitleFont = $titleFont ;
$titleFont = 'Roboto' ;
$taxonomyMainTitleFont = $titleFont ;
// IMPORT
$configuration->setFontImport('<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">');
$configuration->setIconImport('<script src="https://use.fontawesome.com/3b93bc3463.js"></script>');
// STYLE
$configuration->setMainFont($mainFont);
......
......@@ -13,36 +13,26 @@ class LoadPartner implements FixtureInterface
public function load(ObjectManager $manager)
{
$lipsum = new LoremIpsum();
// $names = array('colibris','Le marché citoyen','supaéro','Alternatiba');
// foreach ($names as $key => $name)
// {
// $new_partner = new Partner();
// $new_partner->setName($name);
// $new_partner->setContent($lipsum->words(rand(30,100)));
// $new_partner->setLogoUrl("http://lorempixel.com/300/300/abstract/" . $key);
// $new_partner->setWebsiteUrl("www.partenaire.com");
// $manager->persist($new_partner);
// }
$new_partner = new Partner();
$new_partner->setName("Colibris");
$new_partner->setContent("Créé en 2007 sous l’impulsion de Pierre Rabhi, Colibris se mobilise pour la construction d’une société écologique et humaine. Colibris a pour mission d’inspirer, relier et soutenir les citoyen.ne.s engagé.e.s dans une démarche de transition écologique et solidaire.
L’association cartographie depuis sa création en 2007, en partenariat avec Le Marché Citoyen, les acteurs de la transition.");
$new_partner->setLogoUrl("colibris.png");
$new_partner->setWebsiteUrl("colibris-lemouvement.org");
$manager->persist($new_partner);
$lipsum = new LoremIpsum();
$new_partner = new Partner();
$new_partner->setName("Le Marché Citoyen");
$new_partner->setContent("Référencant depuis plus de 10 ans des commerces engagés vers la transition écologique et sociale, \"Le Marché Citoyen\" fusionne avec la carte \"PrèsDeChezNous\" pour mettre sa base de données en commun!");
$new_partner->setLogoUrl("marchecitoyen.png");
$new_partner->setWebsiteUrl("www.lemarchecitoyen.net");
$manager->persist($new_partner);
$new_partner->setName("Explications");
$new_partner->setContent("Cette page permet de lister des informations comme la description du projet, des partenaires etc.. Vous pouvez modifier le contenu depuis l'interface admin dans \"Contenu\" puis \"Qui sommes nous\"");
$new_partner->setWebsiteUrl("https://github.com/pixelhumain/GoGoCarto");
$manager->persist($new_partner);
$names = array('Texte numéro un','Texte numéro deux');
foreach ($names as $key => $name)
{
$new_partner = new Partner();
$new_partner->setName($name);
$new_partner->setContent($lipsum->words(rand(30,100)));
$new_partner->setLogoUrl("http://lorempixel.com/300/300/abstract/" . $key);
$new_partner->setWebsiteUrl("www.partenaire.com");
$manager->persist($new_partner);
}
// we trigger saving of all partners
$manager->flush();
......
......@@ -11,8 +11,6 @@ function loadTileLayers(ObjectManager $manager)
array('cartodb', 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png'),
array('hydda', 'https://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png'), // pas mal ! 20ko
array('wikimedia', 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'), // sympa mais version démo je crois
array('mapbox', 'https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic2ViYWxsb3QiLCJhIjoiY2l4MGtneGVjMDF0aDJ6cWNtdWFvc2Y3YSJ9.nIZr6G2t08etMzft_BHHUQ'),
array('mapboxlight', 'https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic2ViYWxsb3QiLCJhIjoiY2l4MGtneGVjMDF0aDJ6cWNtdWFvc2Y3YSJ9.nIZr6G2t08etMzft_BHHUQ'),
array('lyrk' , 'https://tiles.lyrk.org/ls/{z}/{x}/{y}?apikey =982c82cc765f42cf950a57de0d891076'), // pas mal; mais zomm max 16. 20ko
array('osmfr', 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png'),
array('stamenWaterColor', 'https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'),
......
......@@ -14,24 +14,17 @@ class LoadWrapper implements FixtureInterface
public function load(ObjectManager $manager)
{
$new_wrapper = new Wrapper();
$new_wrapper->setTitle('Du bio, du local, du solidaire !');
$new_wrapper->setContent("Produits bio, équitables et locaux, amap, éco-artisans, mode éthique, écoles alternatives… Découvrez nos 12 000 bons plans !");
$new_wrapper->setTitle('Bienvenue sur GoGoCarto !');
$new_wrapper->setContent("Ces bandeaux sont éditables depuis l'interface admin, dans le menu \"Contenu\" puis \"Bandeaux de la page d'accueil. Vous poubez insérer des balises html si vous le souhaitez, par example pour créer un <a href=\"https://github.com/pixelhumain/GoGoCarto\" style=\"font-weight:bold;color: #bdc900;\" target=\"_blank\">lien vers le dépo Github du projet</a>");
$new_wrapper->setBackgroundColor('ffffff');
$new_wrapper->setTextColor("inherit");
$manager->persist($new_wrapper);
$new_wrapper = new Wrapper();
$new_wrapper->setTitle("Ici, c'est open bar !");
$new_wrapper->setRawContent("<span style=\"text-transform: uppercase;font-weight: bold;padding-right: 5px;color: #bd2d86;\">Près de chez nous</span> est un site gratuit et libre de droits. Ça veut dire que le code source est en accès libre sur <a href=\"https://github.com/Biopen/GoGoCarto\" style=\"font-weight:bold;color: #bdc900;\" target=\"_blank\">Github</a>, à condition que vous le partagiez à votre tour :-)");
$new_wrapper->setBackgroundColor('ffffff');
$new_wrapper->setTextColor("inherit");
$manager->persist($new_wrapper);
$new_wrapper = new Wrapper();
$new_wrapper->setTitle('Projet collaboratif');
$new_wrapper->setContent("Nous comptons sur la force du collectif pour mener à bien ce projet de référencement. Ainsi chaque citoyen est libre de contirbuer à cette carte, nous sommes également ouverts à des partenariats pour mettre en communs nos bases de données !");
$new_wrapper->setBackgroundColor('ffffff');
$new_wrapper->setTextColor("inherit");
$new_wrapper->setTitle("Un autre bandeau!");
$new_wrapper->setRawContent("La couleur de fond et de texte sont également paramétrables");
$new_wrapper->setBackgroundColor('6b7e9b');
$new_wrapper->setTextColor("ffffff");
$manager->persist($new_wrapper);
......
......@@ -20,7 +20,7 @@
box-sizing: inherit;
}
body, html { background-color: {{ config.backgroundColor }}; color: {{ config.neutralDarkColor }}; font-family: {{ config.mainFont }}; }
body, html { background-color: {{ config.backgroundColor }}; color: {{ config.textColor }}; font-family: {{ config.mainFont }}; }
.gogo-load-css h1, .gogo-load-css h2 { font-family: {{ config.titleFont }}; }
......
<?php
/**
* This file is part of the GoGoCarto project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) 2016 Sebastian Castro - 90scastro@gmail.com
* @license MIT License
* @Last Modified time: 2018-01-19 13:05:00
*/
namespace Biopen\GeoDirectoryBundle\DataFixtures\MongoDB;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Biopen\GeoDirectoryBundle\Document\Category;
use Biopen\GeoDirectoryBundle\Document\Option;
function loadAgriculture($mainOption, $c, $s)
{
// AGRICULTURE
$typeCategory = new Category();
$typeCategory->setName('Type');
$typeCategory->setPickingOptionText('Une sous catégorie');
$typeCategory->setIndex(0);
$typeCategory->setSingleOption(false);
$typeCategory->setEnableDescription(false);
$typeCategory->setDisplayCategoryName(true);
$typeCategory->setDepth(1);
$typeCategory->setUnexpandable(true);
$typeCategory->setIsFixture(true);
// Liste des noms de catégorie à ajouter
$types = array(
array('Marché' , 'icon-marche' , 'blue','' , true),
array('Epicerie & Supérette' ,'icon-epicerie' , 'brown','' , true),
array('Restauration' , 'icon-restaurant' , 'lightblue','' , true),
array('Ruche qui dit oui' , 'icon-ruche' , 'yellow','' , true),
array('Circuit courts' , '' , '' , 'producteur, artisan, paniers' , false)
);
foreach ($types as $key => $type)
{
$new_type = new Option();
$new_type->setName($type[0]);
$new_type->setIcon($type[1]);
$new_type->setColor($c[$type[2]]);
$new_type->setSoftColor($s[$type[2]]);
$new_type->setTextHelper($type[3]);
$new_type->setNameShort($type[0]);
$new_type->setUseIconForMarker($type[4]);
$new_type->setUseColorForMarker($type[4]);
$new_type->setIsFixture(true);
$new_type->setIndex($key);
if ($key == 4)
{
$new_type->setShowExpanded(true);
$new_type->setDisplayOption(false);
}
$typeCategory->addOption($new_type);
}
// CIRCUIT court détail
$circuitCategory = new Category();
$circuitCategory->setName('type');
$circuitCategory->setPickingOptionText('Un type de circuit court');
$circuitCategory->setIndex(1);
$circuitCategory->setSingleOption(false);
$circuitCategory->setEnableDescription(false);
$circuitCategory->setDisplayCategoryName(false);
$circuitCategory->setDepth(1);
$circuitCategory->setIsFixture(true);
// Liste des names de catégorie à ajouter
$circuitCourtType = array(
array('Producteur/Artisan' , '' , 'pink', '' , ''),
array('AMAP/Paniers' , '' , 'purple','' , '')
);
foreach ($circuitCourtType as $key => $circuit)
{
$new_circuit = new Option();
$new_circuit->setName($circuit[0]);
$new_circuit->setIcon($circuit[1]);
$new_circuit->setColor($c[$circuit[2]]);
$new_circuit->setSoftColor($s[$circuit[2]]);
if ($circuit[3] == '') $new_circuit->setNameShort($circuit[0]);
else $new_circuit->setNameShort($circuit[3]);
$new_circuit->setTextHelper($circuit[4]);
$new_circuit->setUseIconForMarker(false);
$new_circuit->setUseColorForMarker(true);
$new_circuit->setIsFixture(true);
$new_circuit->setIndex($key);
$circuitCategory->addOption($new_circuit);
}
// PRODUITS
$productCategory = new Category();
$productCategory->setName('Produits');
$productCategory->setPickingOptionText('Un produit');
$productCategory->setIndex(2);
$productCategory->setSingleOption(false);
$productCategory->setEnableDescription(true);
$productCategory->setDisplayCategoryName(true);
$productCategory->setShowExpanded(false);
$productCategory->setDepth(1);
$productCategory->setIsFixture(true);
// Liste des names de catégorie à ajouter
$products = array(
array('Légumes' , 'icon-legumes' , '', '' , ''),
array('Fruits' , 'icon-fruits' , '','' , ''),
array('Produits laitiers' , 'icon-laitier' , '','Laitiers', 'Fromage, Lait, Yahourt...'),
array('Viande' , 'icon-viande' , '','' , ''),
array('Miel' , 'icon-miel' , '','' , ''),
array('Oeufs' , 'icon-oeufs' , '','' , ''),
array('Poisson' , 'icon-poisson' , '','' , ''),
array('Légumineuses' , 'icon-legumineuses', '','' , 'Lentilles, Pois chiches...'),
array('Produits transformés', 'icon-transformes' , '','Transformés', 'Confitures, pestos...'),
array('Pain, farine' , 'icon-pain' , '','Pain/Farine' , ''),
array('Huiles' , 'icon-huile' , '','' , 'Huile de colza, de tournesol...'),
array('Boissons' , 'icon-boissons' , '','' , ''),
array('Plantes' , 'icon-plantes' , '','' , ''),
array('Autre' , 'icon-autre' , '','' , ''),
);
// $subproducts = array(
//
// );
$subproducts = array(
array('Agneau' , 'icon-angle-right' , '' , ''),
array('Boeuf' , 'icon-angle-right' , '' , ''),
array('Volaille' , 'icon-angle-right' , '' ,'' )
);
foreach ($products as $key => $product)
{
$new_product = new Option();
$new_product->setName($product[0]);
$new_product->setIcon($product[1]);
$new_product->setColor($product[2]);
if ($product[3] == '') $new_product->setNameShort($product[0]);
else $new_product->setNameShort($product[3]);
$new_product->setTextHelper($product[4]);
$new_product->setUseIconForMarker(true);
$new_product->setUseColorForMarker(false);
$new_product->setIsFixture(true);
$new_product->setIndex($key);
if ($key == 3)
{
// SOUS PRODUITS
$subproductCategory = new Category();
$subproductCategory->setName('Sous Produits');
$subproductCategory->setPickingOptionText('le type de viande');
$subproductCategory->setIndex(2);
$subproductCategory->setSingleOption(false);
$subproductCategory->setEnableDescription(true);
$subproductCategory->setDisplayCategoryName(false);
$subproductCategory->setDepth(2);
$subproductCategory->setIsFixture(true);
foreach ($subproducts as $key => $subproduct)
{
$new_subproduct = new Option();
$new_subproduct->setName($subproduct[0]);
$new_subproduct->setIcon($subproduct[1]);
$new_subproduct->setColor($subproduct[2]);
$new_subproduct->setSoftColor($subproduct[2]);
if ($subproduct[3] == '') $new_subproduct->setNameShort($subproduct[0]);
else $new_subproduct->setNameShort($subproduct[3]);
$new_subproduct->setTextHelper('');
$new_subproduct->setUseIconForMarker(false);
$new_subproduct->setUseColorForMarker(false);
$new_subproduct->setIsFixture(true);
$new_subproduct->setIndex($key);
$subproductCategory->addOption($new_subproduct);
}
$new_product->addSubcategory($subproductCategory);
}
$productCategory->addOption($new_product);
}
// COMPILE
$typeCategory->getOptions()[4]->addSubcategory($circuitCategory);
$typeCategory->getOptions()[4]->addSubcategory($productCategory);
$mainOption->addSubcategory($typeCategory);
}
\ No newline at end of file
<?php
/**
* This file is part of the GoGoCarto project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) 2016 Sebastian Castro - 90scastro@gmail.com
* @license MIT License
* @Last Modified time: 2018-01-19 13:05:00
*/
namespace Biopen\GeoDirectoryBundle\DataFixtures\MongoDB;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Biopen\GeoDirectoryBundle\Document\Category;
use Biopen\GeoDirectoryBundle\Document\Option;
function loadEconomie($mainOption, $c, $s)
{
// AGRICULTURE
$typeCategory = new Category();
$typeCategory->setName('Catégories');
$typeCategory->setPickingOptionText('Une sous-catégorie');
$typeCategory->setIndex(0);
$typeCategory->setSingleOption(false);
$typeCategory->setEnableDescription(false);
$typeCategory->setDisplayCategoryName(true);
$typeCategory->setDepth(1);
$typeCategory->setUnexpandable(true);
$typeCategory->setIsFixture(true);
// Liste des noms de catégorie à ajouter
$types = array(
array('Banque Ethique' , 'icon-euro' , 'brown','' , true),
array('Assurance' ,'icon-euro' , 'green','' , true),
);
foreach ($types as $key => $type)
{
$new_type = new Option();
$new_type->setName($type[0]);
$new_type->setIcon($type[1]);
$new_type->setColor($c[$type[2]]);
$new_type->setSoftColor($s[$type[2]]);
$new_type->setTextHelper($type[3]);
$new_type->setNameShort($type[0]);
$new_type->setUseIconForMarker(true);
$new_type->setUseColorForMarker(true);
$new_type->setIndex($key);
$new_type->setIsFixture(true);
$typeCategory->addOption($new_type);
}
$mainOption->addSubcategory($typeCategory);
}
\ No newline at end of file
<?php
/**
* This file is part of the GoGoCarto project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) 2016 Sebastian Castro - 90scastro@gmail.com
* @license MIT License
* @Last Modified time: 2018-01-19 13:05:00
*/
namespace Biopen\GeoDirectoryBundle\DataFixtures\MongoDB;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Biopen\GeoDirectoryBundle\Document\Category;
use Biopen\GeoDirectoryBundle\Document\Option;
function loadEducation($mainOption, $c, $s)
{
// AGRICULTURE
$typeCategory = new Category();
$typeCategory->setName('Structures');
$typeCategory->setPickingOptionText('Un type de structure');
$typeCategory->setIndex(0);
$typeCategory->setSingleOption(false);
$typeCategory->setEnableDescription(false);
$typeCategory->setDisplayCategoryName(true);
$typeCategory->setDepth(1);
$typeCategory->setUnexpandable(true);
$typeCategory->setIsFixture(true);
// Liste des noms de catégorie à ajouter
$types = array(
array('Ecole' , 'icon-school' , 'yellow','' , true),
array('Association' ,'' , 'brown','' , false)
);
foreach ($types as $key => $type)
{
$new_type = new Option();
$new_type->setName($type[0]);
$new_type->setIcon($type[1]);
$new_type->setColor($c[$type[2]]);
$new_type->setSoftColor($s[$type[2]]);
$new_type->setTextHelper($type[3]);
$new_type->setNameShort($type[0]);
$new_type->setUseIconForMarker($type[4]);
$new_type->setUseColorForMarker(true);
$new_type->setIsFixture(true);