2010-06-30 13:44:33 +00:00
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Crop the replacement main image for an Individual, to produce a thumbnail. -->
2010-06-30 20:30:06 +00:00
${scripts.add("/js/jquery.js")}
${scripts.add("/js/jquery_plugins/jcrop/jquery.Jcrop.js")}
${scripts.add("/js/imageUpload/cropImage.js")}
2010-06-30 13:44:33 +00:00
2010-07-06 17:53:01 +00:00
2010-10-01 14:55:03 +00:00
${stylesheets.addFromTheme("/css/uploadImages.css")}
2010-07-08 19:14:19 +00:00
${stylesheets.add("/js/jquery_plugins/jcrop/jquery.Jcrop.css")}
2010-06-30 13:44:33 +00:00
2010-07-01 18:48:35 +00:00
<#--Reduce original image to fit in the page layout
If the width of the image is bigger or equal to 500 pixels,
the script below will reduce the width to 500 pixels and
the height will be in proportion to the new height-->
2010-07-22 18:47:44 +00:00
<#--<#macro newImageSize>
2010-07-01 18:48:35 +00:00
<#if (imageWidth >= 500)>
width="500" height="${(500*imageHeight)/imageWidth}"
</#if>
2010-07-22 18:47:44 +00:00
</#macro>-->
2010-10-01 14:55:03 +00:00
2010-07-01 18:48:35 +00:00
2010-06-30 13:44:33 +00:00
<div id="photoCroppingContainer">
2010-10-01 14:55:03 +00:00
<h2>Photo Upload</h2>
<!-- This is the image we're attaching Jcrop to -->
<div id="photoCroppingPreview">
<h6>Current Photo </h6>
<p class="photoCroppingTitleBody">Your profile photo will look like the image below. </p>
<div style="width:115px;height:115px;overflow:hidden;border:1px solid green;">
<img src="${imageUrl}" id="preview" />
</div>
<div id="photoCroppingHowTo">
<p class="photoCroppingNote">To make adjustments, you can drag around and resize the photo to the right. When you are happy with your photo click the "Save Photo" button. </p>
<form id="cropImage" action="${formAction}" method="post">
2010-06-30 13:44:33 +00:00
2010-10-01 14:55:03 +00:00
<!-- Javascript will populate these values -->
<input type="hidden" name="x" value="" />
<input type="hidden" name="y" value="" />
<input type="hidden" name="w" value="" />
<input type="hidden" name="h" value="" />
2010-07-01 14:35:53 +00:00
2010-10-01 14:55:03 +00:00
<input type="submit" value="Save photo">
or <a class="cancelUpload" href="${cancelUrl}">Cancel</a>
</form>
2010-06-30 13:44:33 +00:00
</div>
2010-10-01 14:55:03 +00:00
</div>
<div id="photoCropping">
<img style="border:1px solid green;" src="${imageUrl}" <#--<@newImageSize/>--> id="cropbox" />
</div>
2010-06-30 13:44:33 +00:00
</div>
2010-07-08 01:45:35 +00:00
<div class="clear"></div>