Skip to content

Commit

Permalink
Merge pull request #145 from mjtko/master-143
Browse files Browse the repository at this point in the history
Fix search facility (#143)
  • Loading branch information
gabceb committed Mar 1, 2013
2 parents 5ee7a46 + 9ea3256 commit 3b39026
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
11 changes: 11 additions & 0 deletions app/helpers/application_helper.rb
@@ -1,2 +1,13 @@
module ApplicationHelper
def current_user_data
current_user_data = {
:id => current_user.id,
:first_name => current_user.first_name,
:last_name => current_user.last_name,
:email => current_user.email,
:username => current_user.username,
:auth_token => current_user.authentication_token,
:gravatar_hash => current_user.gravatar_hash
}
end
end
12 changes: 1 addition & 11 deletions app/views/main/index.html.erb
Expand Up @@ -10,16 +10,6 @@
<%= javascript_tag do %>
<%- if user_signed_in? %>
<%- current_user_data = {
:id => current_user.id,
:first_name => current_user.first_name,
:last_name => current_user.last_name,
:email => current_user.email,
:username => current_user.username,
:auth_token => current_user.authentication_token,
:gravatar_hash => current_user.gravatar_hash
}
%>
$.data(document, "current-user", <%= current_user_data.to_json.html_safe %>);
<%- end %>
$(document).data("active-users", [])
Expand Down Expand Up @@ -63,4 +53,4 @@

window._cloudfuji_help = <%= cloudfuji_help_vars.to_json.html_safe %>;
<%- end %>
<%- end %>
<%- end %>
2 changes: 2 additions & 0 deletions app/views/main/search.html.erb
@@ -1,4 +1,6 @@
<%= javascript_tag do %>
$.data(document, "current-user", <%= current_user_data.to_json.html_safe %>);

$(document).ready(function(){
Kandan.Plugins.initAll()
activities = <%= @activities.to_json(:include => :user).html_safe %>;
Expand Down

0 comments on commit 3b39026

Please sign in to comment.