aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-07-14 15:16:57 +0100
committerFrancis Irving <francis@mysociety.org>2010-07-14 15:16:57 +0100
commit9c3f48ac7fde4e8e41c443a0d0fe8c8da15459a2 (patch)
tree1a18cc2d5f1818c918a39581f8f25c8b14f01f43
parentac69b8f9f86b6703fc882119aa04b8707e062dab (diff)
Improve display of profile photo on user page
-rw-r--r--app/views/user/show.rhtml16
-rw-r--r--public/stylesheets/main.css7
2 files changed, 18 insertions, 5 deletions
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 667c89597..a7e19e138 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -39,7 +39,15 @@
<div class="single_user">
<p id="user_photo_on_profile">
- <img src="<%= get_profile_photo_url(:url_name => @display_user.url_name) %>">
+ <% if @display_user.profile_photo_id %>
+ <img src="<%= get_profile_photo_url(:url_name => @display_user.url_name) %>">
+ <% else %>
+ <% if @is_you %>
+ <span id="set_photo">
+ <%= link_to "Set your profile photo", set_profile_photo_url() %>
+ </span>
+ <% end %>
+ <% end %>
</p>
<h1><%=@title%></h1>
@@ -55,9 +63,9 @@
<%= 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", signchangepassword_url() %> |
- <%= link_to "Change your email", signchangeemail_url() %> |
- <%= link_to "Set profile photo", set_profile_photo_url() %>
+ <p id="user_change_password_email"><%= link_to "Change your password", signchangepassword_url() %> |
+ <%= link_to "Change your email", signchangeemail_url() %>
+ </p>
<% end %>
</p>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 6d57b39f0..aa9ce7c44 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -1114,14 +1114,19 @@ div.act_link img {
#user_photo_on_profile {
}
-#user_photo_on_profile img {
+#user_photo_on_profile img, #user_photo_on_profile #set_photo {
width: 96px;
height: 96px;
float: left;
vertical-align: middle;
+ text-align: center;
border: 1px solid #dddddd;
margin-right: 5px;
padding: 2px;
}
+#user_change_password_email {
+ clear: left;
+}
+