Skip to content

Commit

Permalink
Add information of user
Browse files Browse the repository at this point in the history
  • Loading branch information
CleverFool77 committed Jul 25, 2019
1 parent 45f24c6 commit 7753482
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions app/views/users/profile.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<h3 class="mt-3"><%= @profile_user.name %> <%= @profile_user.new_contributor %>
<small>
<a href="/p/<%= @profile_user.username %>"><i class="fa fa-link"></i></a>
<%= @profile_user.note_count %><a href='/notes/author/<%= @profile_user.name %>'> research notes</a> and <%= @profile_user.revisions.count %> wiki edits
<% if logged_in_as(['admin']) %> | <%= @profile_user.email %><% end %>
<span style = "font-size:24px;"><small> | <%= 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' })) %></small></span>
<% if @profile_user.role == "moderator" %> | <i class="fa fa-certificate"></i> <%= t('users.profile.moderator') %><% end %>
Expand All @@ -21,11 +20,6 @@

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

<hr />
<div class="row" id="highlight" style=" text-align: center;">
<h3 class="col-12 col-sm-12 col-md-4"><a href = "/tag/question:*/author/<%= params[:id] %>"><%= Node.questions.where(status: 1, uid: @profile_user.id).length %> questions asked </a><br><br> <%= Comment.where(uid: @profile_user.id).count %> comments posted</h3>
<h3 class="col-12 col-sm-12 col-md-4"><a href = "/tag/activity:*/author/<%= params[:id] %>"><%= @count_activities_posted %> activities posted </a><br><br> <a href = "/tag/replication:*/author/<%= params[:id] %>"><%= @count_activities_attempted %> activities attempted</a></h3>
</div>
<hr />

<br />
Expand All @@ -45,13 +39,26 @@

<div class="col-lg-4">
<div class="text-center">
<img class="d-none d-lg-inline rounded-circle" id="profile-photo" style="width:100%;margin-bottom:10px;" src="<%= @profile_user.profile_image %>" />
<img class="d-none d-lg-inline rounded-circle" id="profile-photo" style="width:50%;margin-bottom:10px;" src="<%= @profile_user.profile_image %>" />
</div>
<div style="text-align:center;" class="d-lg-none">
<img class="rounded-circle" id="profile-photo" style="width:50%;margin-bottom:20px;" src="<%= @profile_user.photo_path %>" />
</div>

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

<div class="info float:left">
<ul>
<li class="mt-3"><h5>@<%= @profile_user.name %> <%= @profile_user.new_contributor %> asked</h5></li>
<li><h5><%= @profile_user.note_count %><a href='/notes/author/<%= @profile_user.name %>'> research notes</a></h5></li>
<li><h5><%= @profile_user.revisions.count %> wiki edits</h5></li>
<li><h5><a href = "/tag/question:*/author/<%= params[:id] %>"><%= Node.questions.where(status: 1, uid: @profile_user.id).length %> questions </a></h5></li>
<li><h5><%= Comment.where(uid: @profile_user.id).count %> comments</h5></li>
<li><h5><a href = "/tag/activity:*/author/<%= params[:id] %>"><%= @count_activities_posted %> activities posted </a></h5></kli>
<li><h5><a href = "/tag/replication:*/author/<%= params[:id] %>"><%= @count_activities_attempted %> activities attempted</a> </h5></li>
</ul>
</div>

<div class="profile_icons" style="text-align: center;">
<% if @twitter.nil? == false %>
<a href="<%= @twitter %>" >
Expand Down Expand Up @@ -288,6 +295,19 @@
transform: scale(1.2);
}

.info h5{
color: grey;
}
.info ul{
padding-inline-start: 0px;
}

.info a { color: inherit; }

li {
list-style-type: none;
}

.token{
font-weight: bold;
}
Expand Down

0 comments on commit 7753482

Please sign in to comment.