Updated : All re-create photo pages including mass, single and collection

This commit is contained in:
Fawaz 2012-07-19 18:04:15 +00:00
parent cf12482ffc
commit 796d4aa489
3 changed files with 109 additions and 207 deletions

View file

@ -139,6 +139,21 @@
$('.watermark-placement').on('click','.watermark-placement-holder',function(){
$(this).siblings('.checked').removeClass('checked').end().addClass('checked');
});
$('#select-all-thumbs').on('click',function(){
var total_thumbs = $('#collection-thumbs').find('input[type=checkbox]');
var checked_thumbs = $('#collection-thumbs').find('input:checked');
if ( checked_thumbs.length == total_thumbs.length ) {
// perforn uncheck
total_thumbs.prop('checked',false);
} else {
// perform check
total_thumbs.prop('checked',true);
}
})
})
</script>

View file

@ -1,142 +1,28 @@
{if $mode == 'single'}
<h2>Re-create Photos</h2>
<h2>Re-create Photo</h2>
<form action="recreate_thumbs.php?mode={$mode}&amp;photo={$data.photo_id}" method="post" enctype="multipart/form-data">
<a href="edit_photo.php?photo={$p.photo_id}">&laquo; Back to Edit Details</a>
<div style="height:5px;"></div>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<div style="height:5px; clear:both;"></div>
<a href="recreate_thumbs.php?mode={$mode}&amp;photo={$p.photo_id}&amp;recreate=true" style="margin-bottom:5px;" class="myAdminButton moveR">Re-create Photo</a>
<br/><br/>
<ul class="thumbnails">
{foreach from=$files item=file}
<li class="inlineblock " style="float: none; vertical-align: top">
<div class="thumbnail">
<img src="{$file}" style="max-width:260px;" />
<div class="caption">
<h5>Size : {$cbphoto->get_image_type( $file )}</h5>
</div>
</div>
</li>
{/foreach}
</ul>
<p><a href="edit_photo.php?photo={$p.photo_id}">&laquo; Back to Edit Details</a></p>
{include file="$style_dir/resizing_settings.html"}
<a href="recreate_thumbs.php?mode={$mode}&amp;photo={$p.photo_id}&amp;recreate=true" class="btn btn-large btn-primary moveR">Re-create Photo</a>
</form>
{/if}
{if $mode == 'mass' || $mode == ''}
<h2>Mass Re-creation of Photos</h2>
<div style="height:10px; clear:both;"></div>
<span class="AdminBoldText">This will re-create all the photos uploaded on your website, according to the settings shown below</span>
<div class="AdminBoldText" style="color:#ed0000; font:normal 10px Tahoma, Geneva, sans-serif; margin-top:5px;">Take caution while using Mass Recreation. Use MAX of 5 photos per GO.</div>
<div style="height:5px; clear:both;"></div>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
<h2>Mass Re-creation of Photos</h2>
<p>This will re-create all the photos uploaded on your website, according to the settings shown below</p>
<p class="alert-danger alert">Take caution while using Mass Recreation. Use MAX of 5 photos per GO.</p>
{include file="$style_dir/resizing_settings.html"}
<form name="mass_recreation" method="get" class="form-horizontal" action="">
<div class="control-group">
<label class="control-label">Loop Size</label>
<div class="controls">
<input type="text" name="loop_size" class="input-xlarge" value="{$loop_size}" id="the_loop_size" />
<p class="help-block">Number of photos to re-create in one go.</p>
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<div style="height:5px; clear:both;"></div>
<div class="moveL">
<span class="AdminBoldText">Loop Size</span> - <input type="text" name="textfield" style="width:60px; font:normal 11px Tahoma" value="{$loop_size}" id="the_loop_size" /><br/>
<div class="smallText" style="margin-top:2px">Number of photos to re-create in one go.</div>
</div>
<form name="mass_recreation" method="get" action="">
<input type="hidden" name="loop_size" value="" id="loop_start" />
<input type="submit" name="mass_recreation" id="mass_recreation" value="Start Recreation" class="myAdminButton moveR"
onclick="$('#loop_start').val($('#the_loop_size').val())"/>
</div>
<div class="form-actions">
<input type="submit" name="mass_recreation" id="mass_recreation" value="Start Recreation" class="btn btn-large btn-primary" />
</div>
</form>
{if $indexing}
@ -163,86 +49,30 @@
{if $mode == "collection"}
<h2>Recreate Photos</h2>
<div style="height:10px; clear:both;"></div>
{if $items}
{assign var=cid value=$items[0].collection_id}
{assign var=c_name value=$items[0].collection_id|get_collection_field}
<span style="font:bold 14px Arial; text-transform:uppercase;">{$c_name}</span>
<span style="font:bold 11px Tahoma;">
- <a href="{$cbcollection->collection_links($items[0].collection_id,'vc')}">View Collection</a> -
<a href="{$baseurl}/admin_area/edit_collection.php?collection={$cid}">Edit Collection</a> -
<a href="{$baseurl}/admin_area/manage_items.php?collection={$cid}&amp;type={$items[0].collection_id|get_collection_field:type}">Manage Items</a>
</span>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<form action="" method="post" name="collection_photos_recreate">
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Photos</legend>
<table border="0" cellspacing="0">
{section name=list loop=$items}
<td style="display:inline-block; padding:5px;">
<div style="position:relative">
<input type="checkbox" value="{$items[list].photo_id}" id="photo_{$items[list].photo_id}" style="position:absolute; top:1px; right:1px; " name="check_photo[]" />
<label for="photo_{$items[list].photo_id}">{get_photo output=html details=$items[list] style='padding:1px; border:1px solid #aaa'}</label>
</div>
</td>
{/section}
</table>
</fieldset>
<div class="AdminBoldText moveL" style="padding:10px 0 0;">Select photos you want to re-created | </div>
<label for="id_selectALL" class="myAdminButton clearfix moveL" type="button" name="checkall" onclick="checkUncheckAll(this);" style="margin:5px 0 0 5px">Select All</label><input type="checkbox" id="id_selectALL" style="visibility:hidden;" name="checkall" onclick="checkUncheckAll(this);"/>
<div style="margin-top:5px;" class="moveR"><input type="submit" name="recreating" value="Re-create Photos" class="myAdminButton"/></div>
<p><strong>{$c_name}</strong> - <a href="{$cbcollection->collection_links($items[0].collection_id,'vc')}">View Collection</a> - <a href="{$baseurl}/admin_area/edit_collection.php?collection={$cid}">Edit Collection</a> - <a href="{$baseurl}/admin_area/manage_items.php?collection={$cid}&amp;type={$items[0].collection_id|get_collection_field:type}">Manage Items</a></p>
{include file="$style_dir/resizing_settings.html"}
<h2 class="sub_heading">Collection Photos</h2>
<p>Select photos you want re-created or <a href="javascript:void(0);" class="btn btn-small" id='select-all-thumbs'>Click here to select all</a></p>
<div class="height20"></div>
<form action="" method="post" name="collection_photos_recreate">
<ul class="thumbnails" id="collection-thumbs">
{foreach from=$items item=photo}
<li class="inlineblock relative" style="float: none; vertical-align: top;">
<input type="checkbox" class="absolute" value="{$photo.photo_id}" id="re-photo_{$photo.photo_id}" style=" top:-6px; right:-4px; " name="check_photo[]" />
<label for="re-photo_{$photo.photo_id}" class="thumbnail">{get_photo output=html details=$photo }</label>
</li>
{/foreach}
</ul>
<div class="form-actions">
<input type="submit" name="recreating" value="Re-create Photos" class="btn btn-large btn-primary"/>
</div>
</form>
{else}
<div class="alert">{lang code='No photos found in collection'}</div>
{/if}
{/if}

View file

@ -0,0 +1,57 @@
<h2 class="sub_heading">Settings on which photos will be re-created</h2>
<div class="height10"></div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
</thead>
<tr>
<td>Photo Ratio</td>
<td>{$Cbucket->configs.photo_ratio}</td>
</tr>
<tr>
<td>Thumb Dimensions</td>
<td>{$Cbucket->configs.photo_thumb_width} x {$Cbucket->configs.photo_thumb_height}</td>
</tr>
<tr>
<td>Medium Thumb Dimensions</td>
<td>{$Cbucket->configs.photo_med_width} x {$Cbucket->configs.photo_med_height}</td>
</tr>
<tr>
<td>Large Photo Size</td>
<td>{$Cbucket->configs.photo_lar_width}</td>
</tr>
<tr>
<td>Cropping</td>
{assign var=cropping value=$Cbucket->configs.photo_crop}
<td>
{if $cropping == 1}
Enabled
{else}
Disabled
{/if}
</td>
</tr>
<tr>
<td>Watermarking</td>
{assign var=watermark value=$Cbucket->configs.watermark_photo}
<td>
{if $watermark == 1}
Enabled
{else}
Disabled
{/if}
</td>
</tr>
{if $watermark == 1}
<tr>
<td>Watermark Placement</td>
<td>
{$Cbucket->configs.watermark_placement}
</td>
</tr>
{/if}
</table>
<div class="height20"></div>