diff --git a/app/views/map/_userLeaflet.html.erb b/app/views/map/_userLeaflet.html.erb index 22e4203c33..f3129f5980 100644 --- a/app/views/map/_userLeaflet.html.erb +++ b/app/views/map/_userLeaflet.html.erb @@ -4,7 +4,7 @@ <% if haslocation == true %>
<% else %> -
- +
+

Learn about privacy

diff --git a/app/views/tag/_profileCard.html.erb b/app/views/tag/_profileCard.html.erb new file mode 100644 index 0000000000..9edab12979 --- /dev/null +++ b/app/views/tag/_profileCard.html.erb @@ -0,0 +1,42 @@ + +
+<% @profile_user.tags.each do |tag| %> +
+
+

<%= tag.name %>

+

<%= Tag.follower_count(tag.name) %> people discussing

+
+
+
+ <% Tag.find_nodes_by_type(tag.name, type = 'note', limit = 3).each do |node| %> +
+ <% if node.author.name == @profile_user.name %> + <% if node.main_image %> + + <% elsif node.scraped_image %> + + <% end %> +

target="_blank"<% end %> href="<%= node.path %>"><%= (node.type == 'note') ? node.title : node.latest.title %>

+

by target="_blank"<% end %> href="/profile/<%= node.author.name %>">@<%= node.author.name %>

+ <% end %> +
+ <% end %> +
+
+ +
+<% end %> +
diff --git a/app/views/users/profile.html.erb b/app/views/users/profile.html.erb index 73bb00dcc8..4928a0ce87 100644 --- a/app/views/users/profile.html.erb +++ b/app/views/users/profile.html.erb @@ -1,11 +1,15 @@ -
-
+
-

<%= @profile_user.name %> <%= @profile_user.new_contributor %> + <% if !@map_lat.nil? && !@map_lon.nil? %> + <%= render :partial => "map/userLeaflet" , locals: { haslocation: true, user: @profile_user } %> + <% elsif !current_user.nil? && current_user.id == @profile_user.id %> + <%= render :partial => "map/userLeaflet" , locals: { haslocation: false, user: @profile_user } %> + <% end %> + +

<%= @profile_user.name %> <%= @profile_user.new_contributor %> - <%= @profile_user.note_count %> research notes and <%= @profile_user.revisions.count %> wiki edits <% if logged_in_as(['admin']) %> | <%= @profile_user.email %><% end %> | <%= raw t('users.profile.joined_time_ago', :time_ago => distance_of_time_in_words(@profile_user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' })) %> <% if @profile_user.role == "moderator" %> | <%= t('users.profile.moderator') %><% end %> @@ -17,120 +21,44 @@

<%= raw auto_link(RDiscount.new(@profile_user.bio || '').to_html, :sanitize => false) %>


-
-

<%= Node.questions.where(status: 1, uid: @profile_user.id).length %> questions asked

<%= Comment.where(uid: @profile_user.id).count %> comments posted

-

<%= @count_activities_posted %> activities posted

<%= @count_activities_attempted %> activities attempted

- <% if !@map_lat.nil? && !@map_lon.nil? %> - <%= render :partial => "map/userLeaflet" , locals: { haslocation: true, user: @profile_user } %> - <% elsif !current_user.nil? && current_user.id == @profile_user.id %> - <%= render :partial => "map/userLeaflet" , locals: { haslocation: false, user: @profile_user } %> - <% end %> -
-
- -
- -
-
- -
-
- -
- -
- -
-
- <%= render :partial => "notes/notes" %> -
- -
- <%= render :partial => "notes/coauthored_notes" %> -
- - <% if current_user && current_user.uid == @profile_user.uid %> -
- <%= render :partial => "notes/draft_notes" %> -
- <% end %> -
-
- -
- - -
-
- <%= render :partial => "questions/questions" %> -
- -
- <%= render :partial => "users/answered" %> -
-
-
+ <%= render :partial => "tag/profileCard" %> -
-

<%= raw t('users.profile.view_these_maps', :url1 => "//mapknitter.org/profile/"+@profile_user.name) %>

- - - - - - -
<%= t('users.profile.title') %><%= t('users.profile.creation_date') %><%= t('users.profile.image') %>
-
+
<%= will_paginate @tags, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer if @paginated %>
-
- <%= render partial: 'comments/comments', locals: { comments: current_user &.can_moderate? ? @all_comments : @normal_comments } %> -
-
- <%= render :partial => "users/likes" %> -
+
-
- <% @profile_user.barnstars.each do |tag| %> -

<%= raw t('users.profile.barnstar_awarded_to_by', :url1 => "/profile/"+tag.node.author.name, :author => tag.node.author.name, :url2 => "/wiki/barnstars#"+tag.name.split(':').last.split('-').each{|w| w.capitalize!}.join('+'), :barnstar => tag.name.split(':').last.split('-').each{|w| w.capitalize!}.join(' '), :url3 => "/profile/"+tag.author.username, :awarder => tag.author.username, :url4 => tag.node.path, :work => tag.node.title) %>

-
- <% end %> -
-
-
+

+
-
+
- +
+ <%= render :partial => "tag/tagging", locals: { url: "/profile/tags/create/#{ @profile_user.id }", parent: :profile, user: @profile_user } %> +
+ +
+