diff --git a/Gemfile.lock b/Gemfile.lock index bddb660..6dd32d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,7 +119,7 @@ GEM rdoc (4.1.1) json (~> 1.4) ref (1.0.5) - rmagick (2.13.3) + rmagick (2.13.4) rvm-capistrano (1.5.3) capistrano (~> 2.15.4) sass (3.2.19) diff --git a/app/controllers/admin/contacts_controller.rb b/app/controllers/admin/contacts_controller.rb index aca253a..6f72eaf 100644 --- a/app/controllers/admin/contacts_controller.rb +++ b/app/controllers/admin/contacts_controller.rb @@ -98,7 +98,11 @@ class Admin::ContactsController < ApplicationController } @contact = Contact.new(contact_api_params) - @contact.provenance_id = 2 + if params[:provenance_id] + @contact.provenance_id = 3 + else + @contact.provenance_id = 2 + end if @contact.save(:validate => false) render :inline => "ok" puts "OK" diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 6722195..89b5835 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -25,6 +25,18 @@ %body + + + + %a{:id => "top_anchor"} @@ -76,7 +88,7 @@ =#render(:partial => "public/shared/first_menu") - -if true + -if false .info %p Opportunité : Nous possédons des emplacements sur des parkings de supermarchés dans les villes suivantes : @@ -246,13 +258,5 @@ =link_to "Lux Laverie", "http://luxlaverie.com", :target => "_blank" - + \ No newline at end of file diff --git a/app/views/public/contacts/_thank.html.haml b/app/views/public/contacts/_thank.html.haml index fbdfe2a..5697937 100644 --- a/app/views/public/contacts/_thank.html.haml +++ b/app/views/public/contacts/_thank.html.haml @@ -1,2 +1,7 @@ %h3 Merci pour votre message -%p Nous vous remercions pour votre message et vous répondrons dans les meilleurs délais. \ No newline at end of file +%p Nous vous remercions pour votre message et vous répondrons dans les meilleurs délais. + + + \ No newline at end of file diff --git a/app/views/public/shared/_ga.html.erb b/app/views/public/shared/_ga.html.erb index f47f676..e69de29 100644 --- a/app/views/public/shared/_ga.html.erb +++ b/app/views/public/shared/_ga.html.erb @@ -1,13 +0,0 @@ - \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb index 98b33ac..2602eab 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,26 +1,26 @@ - - set :application, 'ual_app' - set :domain, '62.210.187.249' +set :domain, 'quartz-www02.sysnove.net' + + set :user, 'web' set :scm_user, "git" -set :scm_host, "git.nicolasbally.com" +set :scm_host, "quartz.snlab.fr" -set :rvm_ruby_string, 'ruby-2.1.2@ual' +set :rvm_ruby_string, 'ruby-2.1.2' set :rvm_autolibs_flag, "read-only" -#set :bundle_cmd, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}/bin/bundle" -#set :bundle_dir, "/home/#{user}/.rvm/gems/#{rvm_ruby_string}" +set :bundle_cmd, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}@global/bin/bundle" +set :bundle_dir, "/srv/www/#{user}/.rvm/gems/#{rvm_ruby_string}" set :use_sudo, false -set :deploy_to, "/home/#{user}/#{application}/" +set :deploy_to, "/srv/www/#{user}/#{application}/" set :deploy_via, :remote_cache set :normalize_asset_timestamps, false @@ -33,7 +33,7 @@ role :db, domain, :primary => true set :scm, :git -set :repository, "#{scm_user}@#{scm_host}:root/#{application}.git" +set :repository, "#{scm_user}@#{scm_host}:nicolas/#{application}.git" set :branch, "master" @@ -49,7 +49,7 @@ require 'bundler/capistrano' load 'deploy/assets' namespace :deploy do - + # namespace :assets do # task :precompile, :roles => :web, :except => { :no_release => true } do # from = source.next_revision(current_revision) @@ -60,42 +60,47 @@ namespace :deploy do # end # end # end - - - + + + desc "Symlink shared config files" task :symlink_config_files do - - + + run "ln -s #{deploy_to}shared/storage/private #{current_path}/private_medias" run "ln -s #{deploy_to}shared/storage/public #{current_path}/public/public_medias" + run "ln -s #{deploy_to}shared/production.sqlite3 #{current_path}/db/production.sqlite3" + + sudo "cp #{current_path}/config/env_init #{deploy_to}env_init" - sudo "cp #{current_path}/config/unicorn_init_d /etc/init.d/#{application}" + sudo "sudo systemctl enable quartz_app@#{application}" - sudo "chmod +x /etc/init.d/#{application}" - sudo "update-rc.d #{application} defaults " + + + end task :start do - sudo "service #{application} start" + sudo "systemctl start quartz_app@#{application}" end task :stop do - run "service #{application} stop" + sudo "systemctl stop quartz_app@#{application}" end task :restart do - sudo "service #{application} restart" + sudo "systemctl stop quartz_app@#{application}" + sudo "systemctl start quartz_app@#{application}" end task :reload_nginx do - + sudo "rm -rf /etc/nginx/sites-enabled/#{application}" sudo "ln -s #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application} " - + sudo "service nginx reload" end @@ -105,24 +110,25 @@ namespace :deploy do run "cd #{deploy_to}current && rake db:seed RAILS_ENV=#{rails_env}" end - + task :create_files_folders do - + run "mkdir #{deploy_to}shared/storage" run "mkdir #{deploy_to}shared/storage/private" run "mkdir #{deploy_to}shared/storage/public" + run "mkdir #{deploy_to}shared/tmp" end - + end #before 'deploy:setup', 'rvm:install_rvm' # install RVM #before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR: #before 'deploy:setup', 'rvm:create_gemset' # only create gemset - + after "deploy:setup", "deploy:create_files_folders" @@ -135,4 +141,7 @@ before "deploy:restart", "deploy:symlink_config_files" after "deploy", "deploy:cleanup" - \ No newline at end of file + + + + diff --git a/config/env_init b/config/env_init new file mode 100644 index 0000000..c1bd42a --- /dev/null +++ b/config/env_init @@ -0,0 +1,6 @@ +APP_RUBY=2.1.2 +ENV=production +APP_ROOT=/srv/www/web/ual_app/current/ +GEM_HOME=/srv/www/web/.rvm/gems/ruby-$APP_RUBY +UNICORN_OPTS="-D -E ${ENV} -c ${APP_ROOT}/config/unicorn.rb" + diff --git a/config/nginx.conf b/config/nginx.conf index b7db246..d6485a9 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -1,11 +1,11 @@ upstream ual_app_unicorn { - server unix:/home/web/ual_app/shared/unicorn.sock fail_timeout=0; + server unix:/srv/www/web/ual_app/shared/tmp/unicorn.sock fail_timeout=0; } server { - listen 80; + listen [::]:80; server_name une-autre-laverie.com; - root /home/web/ual_app/current/public; + root /srv/www/web/ual_app/current/public; try_files $uri/index.html $uri @unicorn; location @unicorn { @@ -22,7 +22,7 @@ server { server { - listen 80; + listen [::]:80; server_name www.une-autre-laverie.com www.une-autre-laverie.fr une-autre-laverie.fr www.uneautrelaverie.fr uneautrelaverie.fr www.uneautrelaverie.com uneautrelaverie.com; rewrite ^(.*) http://une-autre-laverie.com$1 permanent; } diff --git a/config/unicorn.rb b/config/unicorn.rb index b4a21a3..3d144e2 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,10 +1,10 @@ @rails_app = "ual_app" -working_directory "/home/web/#{@rails_app}/current" -pid "/home/web/#{@rails_app}/shared/unicorn.pid" -stderr_path "/home/web/#{@rails_app}/shared/unicorn.log" -stdout_path "/home/web/#{@rails_app}/shared/unicorn.log" +working_directory "/srv/www/web/#{@rails_app}/current" +pid "/srv/www/web/#{@rails_app}/shared/unicorn.pid" +stderr_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log" +stdout_path "/srv/www/web/#{@rails_app}/shared/log/unicorn.log" -listen "/home/web/#{@rails_app}/shared/unicorn.sock" +listen "/srv/www/web/#{@rails_app}/shared/tmp/unicorn.sock" worker_processes 2 -timeout 30 \ No newline at end of file +timeout 600 diff --git a/config/unicorn_init_d b/config/unicorn_init_d index f2a9975..1b9e7d6 100644 --- a/config/unicorn_init_d +++ b/config/unicorn_init_d @@ -7,11 +7,11 @@ set -e # Change these to match your app: APP_NAME=ecole_eft_app APP_RUBY=2.1.2@ual -APP_ROOT="/home/web/ual_app/current" -PID="/home/web/ual_app/shared/unicorn.pid" +APP_ROOT="/srv/www/web/ual_app/current" +PID="/srv/www/web/ual_app/shared/unicorn.pid" ENV=production -GEM_HOME="/home/web/ual_app/shared/bundle/ruby/2.1.0" +GEM_HOME="/srv/www/web/ual_app/shared/bundle/ruby/2.1.0" UNICORN_OPTS="-D -E $ENV -c $APP_ROOT/config/unicorn.rb" diff --git a/public/provenance/3.png b/public/provenance/3.png new file mode 100644 index 0000000..809492c Binary files /dev/null and b/public/provenance/3.png differ