OSM = {
-<% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) %>
- PIWIK_LOCATION: <%= PIWIK_LOCATION.to_json %>,
- PIWIK_SITE: <%= PIWIK_SITE.to_json %>,
+<% if defined?(PIWIK) %>
+ PIWIK: <%= PIWIK.to_json %>,
<% end %>
MAX_REQUEST_AREA: <%= MAX_REQUEST_AREA.to_json %>,
-if (OSM.PIWIK_LOCATION && OSM.PIWIK_SITE) {
+if (OSM.PIWIK) {
$(document).ready(function () {
- var base = document.location.protocol + "//" + OSM.PIWIK_LOCATION + "/";
+ var base = document.location.protocol + "//" + OSM.PIWIK.location + "/";
$.ajax({
url: base + "piwik.js",
dataType: "script",
cache: true,
success: function () {
- var piwikTracker = Piwik.getTracker(base + "piwik.php", OSM.PIWIK_SITE);
+ var piwikTracker = Piwik.getTracker(base + "piwik.php", OSM.PIWIK.site);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
@user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
if @user.save
- flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL)
+ flash[:piwik_goal] = PIWIK["goals"]["signup"] if defined?(PIWIK)
referer = welcome_path
<%= yield %>
</div>
</div>
- <% if defined?(PIWIK_LOCATION) and defined?(PIWIK_SITE) -%>
- <noscript><p><img src="<%= request.protocol %><%= PIWIK_LOCATION %>/piwik.php?idsite=<%= PIWIK_SITE %>" style="border:0" alt="" /></p></noscript>
+ <% if defined?(PIWIK) -%>
+ <noscript><p><img src="<%= request.protocol %><%= PIWIK['location'] %>/piwik.php?idsite=<%= PIWIK['site'] %>" style="border:0" alt="" /></p></noscript>
<% end -%>
</body>
</html>
require_terms_seen: false
# Whether to require users to agree to the CTs before editing
require_terms_agreed: false
- # Piwik details
- #piwik_location: "piwik.openstreetmap.org"
- #piwik_site: 1
- #piwik_signup_goal: 1
development:
<<: *defaults
--- /dev/null
+require "yaml"
+
+if File.exists?(piwik_file = File.expand_path("../../piwik.yml", __FILE__))
+ PIWIK = YAML.load_file(piwik_file)
+end