show.html.erb 2.19 KB
Newer Older
1
<div class="users-profile-view">
2
3
    <div class="profile-avatar-section">
        <div class="avatar-wrapper">
4
            <%= image_tag(@user.avatar.variant(resize_to_fill: [400,400]), class: "avatar") %>
5
6
7
8
9
10
        </div>
        <h1 class="profile-username">
            <%= @user.username %>
        </h1>
    </div>
    <section class="profile-edit-section">
simon's avatar
simon committed
11
        <div class="edit-wrapper">
simon's avatar
simon committed
12
13
14
15
16
            <% if own_profile?(@user) %>
                <%= link_to edit_registration_path(current_user), class: "tag" do %>
                    <%= image_tag("cog-solid.svg") %>
                    Edit Profile
                <% end %>
simon's avatar
simon committed
17
            <% end %>
18
            <% unless @user == current_user %>
simon's avatar
simon committed
19
            <%= link_to new_conversation_message_path(receiver_id: @user), class: "tag" do %>
20
                <%= image_tag("envelope-regular.svg") %>
simon's avatar
simon committed
21
22
                Send Message
            <% end %>
23
24
            <% end %>

simon's avatar
simon committed
25
26
27
28
        </div>
        <%= form_for(@user, url: user_path(@user), html: {class: "tags-wrapper "}) do |f| %>

            <div class="field">
29
                <%= f.label :user_tag_list, "Preferred Tags" %>
Felix Macho's avatar
Finish    
Felix Macho committed
30
                <%= f.text_field :user_tag_list, value: @user.user_tag_list.join(",") %> 
simon's avatar
simon committed
31
32
            </div>

simon's avatar
simon committed
33
            <% if own_profile?(@user) %>
simon's avatar
simon committed
34
            <div class="actions">
Felix Macho's avatar
Felix Macho committed
35
                <%= f.submit "Save preferred tags", class: "submit small", method: :patch %>
simon's avatar
simon committed
36
            </div>
simon's avatar
simon committed
37
            <% end %>
simon's avatar
simon committed
38
        <% end %>
39
40
41
42
    </section>
    <section class="profile-statistics-section">
        <div class="statistics-wrapper">
            <div class="statistics-item">
simon's avatar
Update    
simon committed
43
44
                <h3>Post Count</h3>
                <span><%= @post_count %></span>
45
46
            </div>
            <div class="statistics-item">
simon's avatar
Update    
simon committed
47
48
                <h3>Upvotes received</h3>
                <span><%= @received_upvotes %></span>
49
50
            </div>
            <div class="statistics-item">
simon's avatar
Update    
simon committed
51
52
                <h3>Upvotes given</h3>
                <span><%= @given_upvotes %></span>
53
54
            </div>
            <div class="statistics-item">
simon's avatar
Update    
simon committed
55
56
                <h3>Member since</h3>
                <span><%= @user.created_at.strftime("%Y %d %b.") %></span>
57
58
59
            </div>
        </div>
    </section>
60
</div>