mixpanel fixes
This commit is contained in:
@@ -84,18 +84,15 @@
|
||||
$(window).trigger("danbooru:error", msg);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
window.Danbooru.mixpanelInit(
|
||||
<%= CurrentUser.id || "null" %>,
|
||||
<%= raw session.id.to_json %>,
|
||||
<%= CurrentUser.opt_out_mixpanel? %>,
|
||||
<% if CurrentUser.is_anonymous? %>
|
||||
{}
|
||||
<% else %>
|
||||
<% unless CurrentUser.is_anonymous? %>
|
||||
<script>
|
||||
window.Danbooru.mixpanelInit(
|
||||
"<%= CurrentUser.id %>",
|
||||
<%= CurrentUser.opt_out_mixpanel? %>,
|
||||
<%= raw({"$created" =>CurrentUser.created_at.strftime('%F %T'), "$name" => CurrentUser.name, "level" => CurrentUser.level, "upload_count" => CurrentUser.post_upload_count, "post_update_count" => CurrentUser.post_update_count, "note_update_count" => CurrentUser.note_update_count, "favorite_count" => CurrentUser.favorite_count}.to_json) %>
|
||||
<% end %>
|
||||
);
|
||||
</script>
|
||||
);
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
</head>
|
||||
<%= tag.body **body_attributes(CurrentUser.user) do %>
|
||||
|
||||
@@ -20,3 +20,13 @@
|
||||
<% content_for(:page_title) do %>
|
||||
Feedback - <%= @user_feedback.user_name %> - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
|
||||
<% if flash[:alias_mixpanel] %>
|
||||
<% content_for(:html_header) do %>
|
||||
<script>
|
||||
$(function() {
|
||||
window.Danbooru.mixpanelAlias("<%= CurrentUser.id %>");
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user