aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2013-12-11 12:05:36 +0100
committerMarc Florisson2013-12-11 12:05:36 +0100
commitb06dc9762a7fd3ddc35705bc100f8c0b1dcaf11d (patch)
tree0faa30c1058d1d902d883fb6442e137ba2902d1d
parent88184e093edfbd5a9ebbac421dbe5bd815a60bfb (diff)
downloadchouette-core-b06dc9762a7fd3ddc35705bc100f8c0b1dcaf11d.tar.bz2
add Google Analytics
-rw-r--r--Gemfile24
-rw-r--r--Gemfile.lock2
-rw-r--r--app/views/layouts/application.html.erb13
-rw-r--r--config/environments/production.rb17
4 files changed, 32 insertions, 24 deletions
diff --git a/Gemfile b/Gemfile
index a07288cf9..3d1cd7d81 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,22 +1,24 @@
source 'http://rubygems.org'
-gem 'rails', '3.2.6'
+gem 'rails', '3.2.6'
platforms :jruby do
gem 'activerecord-jdbcpostgresql-adapter', '1.2.9'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
gem "jruby-rack-worker"
- gem 'warbler'
- gem 'therubyrhino'
+ gem 'warbler'
+ gem 'therubyrhino'
end
platforms :ruby do
- gem 'therubyracer', '~> 0.10.2'
- gem 'pg', '~> 0.11.0'
+ gem 'therubyracer', '~> 0.10.2'
+ gem 'pg', '~> 0.11.0'
gem 'sqlite3'
end
+gem 'google-analytics-rails'
+
# Authentication
gem 'devise', '2.1.3'
gem 'devise_invitable'
@@ -72,20 +74,20 @@ group :assets do
gem 'uglifier', '>= 1.0.3'
end
-group :development do
+group :development do
gem 'capistrano'
- gem 'capistrano-ext'
+ gem 'capistrano-ext'
gem 'guard'
gem 'guard-rspec'
- gem 'rails-erd'
+ gem 'rails-erd'
end
group :test, :development do
gem "rspec-rails", "~> 2.0"
- gem "remarkable", "~> 4.0.0.alpha4"
- gem "remarkable_activerecord", "~> 4.0.0.alpha4"
+ gem "remarkable", "~> 4.0.0.alpha4"
+ gem "remarkable_activerecord", "~> 4.0.0.alpha4"
gem "shoulda-matchers"
- gem 'capybara'
+ gem 'capybara'
gem 'launchy'
gem 'factory_girl_rails', '1.7'
gem 'rb-inotify', :require => RUBY_PLATFORM.include?('linux') && 'rb-inotify'
diff --git a/Gemfile.lock b/Gemfile.lock
index 5de7519a5..89f97f69a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -131,6 +131,7 @@ GEM
geokit (1.6.5)
multi_json
georuby (1.9.8)
+ google-analytics-rails (0.0.4)
gravatar_image_tag (1.1.3)
guard (1.3.2)
listen (>= 0.4.2)
@@ -347,6 +348,7 @@ DEPENDENCIES
formtastic
geokit (= 1.6.5)
georuby-ext!
+ google-analytics-rails
gravatar_image_tag
guard
guard-rspec
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 32e74973f..81a87f5ae 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -2,29 +2,30 @@
<html lang="<%= I18n.locale %>">
<head>
<title>Chouette V2 - <%= title %></title>
- <%= stylesheet_link_tag :application %>
+ <%= stylesheet_link_tag :application %>
<%= javascript_include_tag :application %>
<% if defined?( @map) %>
- <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
+ <script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<script type="text/JavaScript">
OpenLayers.ImgPath = "<%= polymorphic_path_patch("/assets/openlayers/") %>";
</script>
<% end %>
+ <%= analytics_init if Rails.env.production? %>
<%= csrf_meta_tag %>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
</head>
<body>
<div id="header">
- <div class="infos">
- <div class="logo">
+ <div class="infos">
+ <div class="logo">
<%= link_to image_tag("logo_chouette.png"), referentials_path %>
</div>
<div class="version">
<%= APP_VERSION %>
</div>
- <div class="title">
+ <div class="title">
<% if selected_referential? %>
<h1><%= @referential.name %></h1>
<% elsif help_page? || test_sheet_page? %>
@@ -58,7 +59,7 @@
<li><%= tab_link_to Import, referential_imports_path(@referential) %></li>
<li><%= tab_link_to Export, referential_exports_path(@referential) %></li>
- <% end %>
+ <% end %>
</ul>
</div>
</div>
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 6462eb089..6c4a7b277 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,5 +1,8 @@
ChouetteIhm::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
+ #
+ # # replace this with your production tracker code
+ GA.tracker = "UA-xxxxxx-x"
# Code is not reloaded between requests
config.cache_classes = true
@@ -35,7 +38,7 @@ ChouetteIhm::Application.configure do
# Use a different logger for distributed setups
if ENV['OS'] == 'Windows_NT'
- # args = log_path,number of files,file sizes
+ # args = log_path,number of files,file sizes
config.logger = Logger.new("C:/chouette/logs/chouette2.log", 5, 10.megabytes)
else
require 'syslog_logger'
@@ -43,7 +46,7 @@ ChouetteIhm::Application.configure do
# logger.level = Logger::INFO
end
end
-
+
# Use a different cache store in production
# config.cache_store = :mem_cache_store
@@ -74,11 +77,11 @@ ChouetteIhm::Application.configure do
config.action_mailer.default_url_options = { :host => 'chouette.dryade.net/chouette2' }
- # mailer configuration :
+ # mailer configuration :
# by default : set to smtp on windows platforms and sendmail on unix one
# may be changed as convenience
if ENV['OS'] == 'Windows_NT'
- ## using SMTP (maybe useful for Windows or VM platforms):
+ ## using SMTP (maybe useful for Windows or VM platforms):
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.sample.com",
@@ -91,15 +94,15 @@ ChouetteIhm::Application.configure do
#openssl_verify_mode => # set one in 'none' 'peer' 'client_once' 'fail_if_no_peer_cert'
}
else
- ## using SENDMAIL (easy on Linux platforms) :
+ ## using SENDMAIL (easy on Linux platforms) :
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.smtp_settings = {
:address => "mail.dryade.priv",
:domain => "dryade.priv"
}
end
-
-
+
+
# paths for external resources
if ENV['OS'] == 'Windows_NT'
config.to_prepare do