aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/default.rhtml8
-rw-r--r--app/views/user/set_crop_profile_photo.rhtml16
2 files changed, 22 insertions, 2 deletions
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 0db75380f..9a9f2009e 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -1,9 +1,15 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-gb">
<head>
- <!-- <%= javascript_include_tag :defaults %> -->
<script type="text/javascript" src="/jslib/spell/spellChecker.js"></script>
+ <% if @profile_photo_javascript %>
+ <script type="text/javascript" src="/javascripts/jquery.js"></script>
+ <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script>
+ <script type="text/javascript" src="/javascripts/profile_photo.js"></script>
+ <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
+ <% end %>
+
<title>
<% if @title %>
<%=@title%> - WhatDoTheyKnow
diff --git a/app/views/user/set_crop_profile_photo.rhtml b/app/views/user/set_crop_profile_photo.rhtml
index d96b6812e..a616cec00 100644
--- a/app/views/user/set_crop_profile_photo.rhtml
+++ b/app/views/user/set_crop_profile_photo.rhtml
@@ -1,4 +1,5 @@
<% @title = "Change profile photo" %>
+<% @profile_photo_javascript = true %>
<% raise "internal error" if not @user %>
@@ -10,7 +11,20 @@
<% form_tag 'set_profile_photo', :id => 'set_crop_profile_photo_form', :multipart => true do %>
- <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>">
+ <table>
+ <tr>
+ <td>
+ <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>" id="profile_photo_cropbox">
+ </td>
+ <td>
+ <div style="width:96px;height:96px;overflow:hidden;">
+ <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>" id="profile_photo_preview" />
+ </div>
+
+ </td>
+ </tr>
+ </table>
+
<p><strong>Privacy note:</strong> Your photo will be shown in public on the Internet,
wherever you do something on WhatDoTheyKnow.