aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/user/show.rhtml
blob: 367bf88d4e9fb14080d37ded2464dd9e0e289c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<% @title = h(@display_user.name) + (@is_you ? " (you)" : "") %>

<% if (@same_name_users.size >= 1) %>
    <p>This is <strong>one person</strong> who uses this site and has this name, you may
    mean a different one:
    <% for @same_name_user in @same_name_users %>
        <%= user_link(@same_name_user) %>
    <% end %> 
<% end%>

<div class="single_user" id="user-<%=@display_user.id.to_s%>">
    <h1><%=@title%></h1>
    <p class="subtitle">Joined WhatDoTheyKnow on <%= simple_date(@display_user.created_at) %></p>

    <p>
        <%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
        <% if @is_you %>
            (just to see how it works)
            <br><%= link_to "Change your password", signchange_url() %>
        <% else %>
        <% end %>
    </p>

    <% if @display_user.info_requests.empty? %>
        <h2>Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %></h2>
        <p><%= @is_you ? 'You have' : 'This person has' %>
        made no Freedom of Information requests using this site.</p>

    <% else %>
        <h2>
        <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %>
        made by <%= @is_you ? 'you' : 'this person' %>
        </h2>

        <%= render :partial => 'request/request_listing', :locals => { :info_requests => @display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %>
    <% end %>
</div>