diff --git a/VAGRANT.md b/VAGRANT.md index cd231943..add9700e 100644 --- a/VAGRANT.md +++ b/VAGRANT.md @@ -37,3 +37,5 @@ From the fieldpapers checkout on your host machine *Celery logging* `vagrant ssh -c "screen -r celery"` +"mysql --user=fieldpapers --password=w4lks fieldpapers" + diff --git a/Vagrantfile b/Vagrantfile index a45291fe..ef554f0c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,6 +6,8 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.synced_folder "./", "/usr/local/fieldpapers/", id: "vagrant-root", owner: "vagrant", group: "www-data", @@ -14,6 +16,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider :virtualbox do |vb, override| vb.memory = 1024 vb.cpus = 1 + vb.name = "Field Papers Appliance" override.vm.box = "precise64" override.vm.box_url = "http://files.vagrantup.com/precise64.box" override.vm.network :private_network, ip: "192.168.33.10" diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index d886ae26..0be08a58 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -22,6 +22,7 @@ - apache2 - php5 - php5-mysql + - php5-sqlite - phpmyadmin - build-essential - libcairo2-dev @@ -52,8 +53,8 @@ - name: Move default Apache root action: command mv /var/www /var/www-old - - name: Symlink /var/www to /vagrant - action: command ln -s /vagrant /var/www + - name: Symlink /var/www to /usr/local/fieldpapers + action: command ln -s /usr/local/fieldpapers /var/www - name: Make fieldpapers site command: "{{ item }} chdir=/usr/local/fieldpapers/site" @@ -91,7 +92,7 @@ - name: "Install BlobDetector from a local package instead of pip for now" command: "python setup.py install" args: - chdir: "/vagrant/provisioning/BlobDetector-1.0.0/" + chdir: "/usr/local/fieldpapers/provisioning/BlobDetector-1.0.0/" - name: Install packages via pecl. command: "pecl install {{ item }}" diff --git a/site/lib/lib.compose.php b/site/lib/lib.compose.php index edbaa48b..b7fa6511 100644 --- a/site/lib/lib.compose.php +++ b/site/lib/lib.compose.php @@ -344,6 +344,7 @@ function compose_from_postvars(&$dbh, $post, $user_id) $orientation = isset($post['orientation']) ? $post['orientation'] : 'portrait'; $layout = isset($post['layout']) ? $post['layout'] : 'full-page'; $provider = $post['provider']; + $overlay = $post['overlay']; $title = $post['atlas_title']; $grid = filter_var($post['grid'], FILTER_VALIDATE_BOOLEAN) ? 1 : 0; $redcross = filter_var($post['redcross'], FILTER_VALIDATE_BOOLEAN) ? 1 : 0; @@ -455,6 +456,12 @@ function compose_from_postvars(&$dbh, $post, $user_id) if($redcross) $message['pages'][$i]['provider'] = "{$value['provider']},http://a.tiles.mapbox.com/v3/americanredcross.HAIYAN_Atlas_Bounds/{Z}/{X}/{Y}.png"; + + if($overlay) + $message['pages'][$i]['provider'] = "{$value['provider']},{$overlay}"; + + + } // Deal with WOEIDs diff --git a/site/templates/make-step2-geography.html.tpl b/site/templates/make-step2-geography.html.tpl index a5077efc..90a634ff 100644 --- a/site/templates/make-step2-geography.html.tpl +++ b/site/templates/make-step2-geography.html.tpl @@ -27,7 +27,10 @@ var mbtiles_data = {$mbtiles_data|@json_encode} || null, center = {$center|json_encode} || null, - zoom = {$zoom|json_encode} || null; + zoom = {$zoom|json_encode} || null, + zoom = {$zoom|json_encode} || null, + user_mbtiles = {$user_mbtiles|@json_encode} || null; +