Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Google tracking id for Google analytics, bugfix for domains.

  • Loading branch information...
commit 12b9c3cf5bb3eef0380d4212568cfb93c0f58fc1 1 parent 17f6a01
@penso authored
View
4 app/controllers/application_controller.rb
@@ -16,10 +16,6 @@ def set_photographer
host_for_query_without_www = "#{request.server_name}"
host_for_query_without_www.gsub!(/^www\./, '')
- logger.info request.server_name
- logger.info host_for_query
- logger.info host_for_query_without_www
-
@current_photographer = @photographer = User.first(:conditions => ['specific_url = ? OR specific_url = ? OR internal_url = ? OR internal_url = ?',
host_for_query, host_for_query_without_www, host_for_query, host_for_query_without_www],
:include => [:stories])
View
14 app/views/accounts/website.html.erb
@@ -7,16 +7,22 @@
<%= f.inputs :name => "Your website" do %>
<%= f.input :specific_url, :label => "Your domain name",
:input_html => { :size => 40 } %>
- <span class="help-block">
- Want to use your own domain like www.<%= current_user.name.downcase.gsub(' ', '') %>.com?
+ <span class="help-block">
+ Want to use your own domain like www.<%= current_user.name.downcase.gsub(' ', '') %>.com?
<ul>
<li>point your DNS to 91.194.60.228</li>
<li>Fill it up here</li>
</ul>
+ </span>
+ <% end %>
- </span>
- <% end %>
+ <%= f.inputs :name => "Your Analytics" do %>
+ <%= f.input :google_tracking_id, :label => "Google Analytics" %>
+ <span class="help-block">
+ Example: UA-299804-4, you can get codes at <a href="https://www.google.com/analytics/">Google</a>.
+ </span>
+ <% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :button, :label => "Save",
View
3  db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130106202232) do
+ActiveRecord::Schema.define(:version => 20130112235607) do
create_table "emails", :force => true do |t|
t.integer "user_id"
@@ -118,6 +118,7 @@
t.string "twitter_url"
t.string "blog_url"
t.string "internal_url"
+ t.string "google_tracking_id"
end
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
View
4 lib/personalized_domain_constraint.rb
@@ -4,10 +4,10 @@ def initialize
end
def matches?(request)
- host_for_query = request.server_name
+ host_for_query = "#{request.server_name}"
host_for_query = "www.#{host_for_query}" if host_for_query !~ /^www\./
- host_for_query_without_www = request.server_name
+ host_for_query_without_www = "#{request.server_name}"
host_for_query_without_www.gsub!(/^www\./, '')
User.count(:conditions => ['specific_url = ? OR specific_url = ? OR internal_url = ? OR internal_url = ?',
Please sign in to comment.
Something went wrong with that request. Please try again.