<% var no_back_logo = "undefined" == typeof(back_logo) || _.isEmpty(back_logo); if(is_admin && tpl != 'te' && gradient_objects.length > 0) { var orientation = 'square'; var print_w = parseInt(print_w); var print_h = parseInt(print_h); var ratio = (print_w > 0 && print_h > 0) ? (print_w/print_h) : (web_w/web_h); if(ratio > 1) { orientation = 'horizontal'; } else if(ratio < 1) { orientation = 'vertical'; } var extra_class = side != 'front' ? ' ABOVE_PHOTO' : ''; _.each(gradient_objects, function(data, key){ data = data.toJSON(); %> <% })}; %> <% if("undefined" != typeof(barcode_overlays_path) && !_.isEmpty(barcode_overlays_path)){ %> <% }%> <% if("undefined" != typeof(grid_path) && !_.isEmpty(grid_path) && (_.isUndefined(is_gift_tag) || !is_gift_tag)){ %> <% } %> <% if( baseView.checkFeature('shape') ) { %> <% } %> <% if(!_.isEmpty(template_img) && $.inArray(caption.toLowerCase(), ucd_config.sides_has_template) != -1){ template_img += '?v=' + publish_version; %> /> <% } if(side == 'back') { var back_logo_src = typeof(back_logo) != 'undefined' && back_logo ? UCD_S3_BUCKET+'/back_logo/'+back_logo+'?v=3' : ''; var back_logo_style = typeof(back_logo) != 'undefined' && back_logo ? 'position: absolute;' : 'position: absolute;display:none;'; %> <% } if("undefined" != typeof(foil_path) && !_.isEmpty(foil_path) && side == 'front'){ %> <% } if(typeof die_cut != 'undefined' && !_.isEmpty(die_cut) && 0 != die_cut){ die_cut = addUrlRandom(die_cut); if(is_admin) die_cut = 'admin/'+die_cut; %> <% } else if("undefined" != typeof(photo_easel_file_name) && !_.isEmpty(photo_easel_file_name)){ %> <% } var photo_num = photo_objects.length; _.each(photo_objects, function(data, key){ data = data.toJSON(); var resize_x = parseFloat(data.x); var resize_y = parseFloat(data.y); var resize_w = parseFloat(data.w); var resize_h = parseFloat(data.h); if(resize_x <= edge_mask_width){ resize_w -= edge_mask_width - resize_x; resize_x = edge_mask_width; } if(resize_y <= edge_mask_width){ resize_h -= edge_mask_width - resize_y; resize_y = edge_mask_width; } if(resize_x + resize_w > web_w - edge_mask_width*2){ resize_w = web_w - resize_x - edge_mask_width; } if(resize_y + resize_h > web_h - edge_mask_width*2){ resize_h = web_h - resize_y - edge_mask_width; } var is_full = photo_num==1 && (data.w>=web_w || data.h>=web_h) ? 1 : 0; var valid_photo = !_.isEmpty(data.file) && !/^[\d]+\.jpg$/i.test(data.file) ? 1 : 0; var slot_size = ''; if (resize_w<70 || resize_h<70) { slot_size = 'SMALL4'; } else if (resize_w<100 || resize_h<80) { slot_size = 'SMALL3'; } else if (resize_w<=120 || resize_h<100) { slot_size = 'SMALL2'; } else if (resize_w<=135 || resize_h<120) { slot_size = 'SMALL1'; } %>
<% if( ! baseView.checkFeature('drag_drop_upload') ) { %>

DRAG PHOTO
FROM LEFT TRAY
TO INSERT

<% } %>
<% if ( baseView.checkFeature('drag_drop_upload') ) { %>
<% } %>
<% });%> <% if(raster_objects.length > 0) { _.each(raster_objects, function(data, key){ data = data.toJSON(); if( raster_objects.length > 1 && parseInt(data.is_default) == 0 || data.disabled) { return; } %>
<% }); } %> <% _.each(text_objects, function(data, key){ data = data.toJSON(); if( data.is_multiple == 1 && (data.disabled || ((default_editable_greeting && data.is_default != 1) || (!default_editable_greeting && data.id != editable_greetings[0].get('id')))) ) { return; } %>
Insert Text Here
<% });%> <% if(typeof asset_objects != 'undefined'){ _.each(asset_objects, function(data, key){ data = data.toJSON(); var zoom = parseFloat(data.zoom); var asset_w = parseFloat(data.w); var asset_h = parseFloat(data.h); var is_back_logo = _.isUndefined(data.is_back_logo) ? 0 : parseInt(data.is_back_logo); var zoom_asset_w = asset_w * zoom; var zoom_asset_h = asset_h * zoom; if (zoom_asset_w<1) zoom_asset_w = 1; if (zoom_asset_h<1) zoom_asset_h = 1; if (is_back_logo && !_.isEmpty(data.file) && site_id != 2) data.file = data.file.replace('web', 'print'); if( _.isUndefined(data.is_logo) || data.is_logo == 1 ) { %> <% } else if(is_back_logo != 1 || is_back_logo==1 && 1!=hide_back_logo && no_back_logo) { %>
<% } %> <% }); }%>
<% if(typeof knock_out != 'undefined' && !_.isEmpty(knock_out)) { var knockout_width = overlay_w; var knockout_height = Math.round(overlay_h); var knockout_marginleft = overlay_offset_x; var knockout_margintop = overlay_offset_y; if( baseView.isResponsive() ) { knockout_width += 2; knockout_height += 2; knockout_marginleft -= 1; knockout_margintop -= 1; } %> <% } %> <% if ((typeof die_cut != 'undefined' && !_.isEmpty(die_cut) && 0 != die_cut) || (!_.isUndefined(photo_easel_file_name) && !_.isEmpty(photo_easel_file_name)) || (!_.isUndefined(is_magnet) && is_magnet == 1) || (!_.isUndefined(is_gift_tag) && is_gift_tag)) { edge_border = 'EDGE_BORDER_NONE'; } else { edge_border = ''; } if (_.isUndefined(is_gift_tag) || !is_gift_tag) { %>
<% } %>
<% var missed_photos = []; var missed_photo_ids = []; _.each(photo_objects, function(data, key){ data = data.toJSON(); var resize_x = parseFloat(data.x); var resize_y = parseFloat(data.y); var resize_w = parseFloat(data.w); var resize_h = parseFloat(data.h); if(resize_x <= edge_mask_width){ resize_w -= edge_mask_width - resize_x; resize_x = edge_mask_width; } if(resize_y <= edge_mask_width){ resize_h -= edge_mask_width - resize_y; resize_y = edge_mask_width; } if(resize_x + resize_w > web_w - edge_mask_width*2){ resize_w = web_w - resize_x - edge_mask_width; } if(resize_y + resize_h > web_h - edge_mask_width*2){ resize_h = web_h - resize_y - edge_mask_width; } var slot_size = ''; if (resize_w<80 || resize_h<80) { slot_size = 'SMALL2'; } else if (resize_w<100||resize_h<100) { slot_size = 'SMALL'; } var diff_x = resize_x - parseFloat(data.x); var diff_y = resize_y - parseFloat(data.y); var valid_photo = !_.isEmpty(data.file) && !/^[\d]+\.jpg$/i.test(data.file) ? true : false; var style = ''; if(valid_photo){ var image_data = $("#UCD_PHOTO_TRAY A[ref='" + data.file.split('.').shift() + "'] IMG").attr('data'); try{ if(typeof image_data != 'undefined' && image_data != ''){ image_data = JSON.parse(decodeURIComponent(image_data)); var zoomedW = data.zoom * data.w * print_w/web_w * min_dpi_of_photo/300; var zoomedH = zoomedW * image_data.orig_h / image_data.orig_w; if(zoomedW > image_data.orig_w || zoomedH > image_data.orig_h) { style = 'style="display: block;"'; } }else{ if($.inArray(data.file, missed_photos) == -1){ missed_photo_ids.push(data.id); missed_photos.push(data.file); } } }catch(e){} } %>

>Warning, click here
<% if( baseView.checkFeature('drag_drop_upload') ) { %>
<% } %>
<% }); %> <% if(raster_objects.length > 0) { _.each(raster_objects, function(elementModel, key){ data = elementModel.toJSON(); if( (raster_objects.length > 1 && parseInt(data.is_default) == 0) || data.disabled ) { return; } %>
Click to Change Message
<% if( site_id != 202 ) { %>
<% } %> <% if( is_admin ) { %>
Zoom
<% } %>
<% }); } %> <% _.each(text_objects, function(textModel, key){ var data = textModel.toJSON(); if( data.is_multiple == 1 && (data.disabled || ((default_editable_greeting && data.is_default != 1) || (!default_editable_greeting && data.id != editable_greetings[0].get('id')))) ) { return; } var suitablePosition = textModel.getSuitablePositionOfTextDragger( baseView._model ); var text_dragger_x = suitablePosition.x; var text_dragger_y = suitablePosition.y; var text_width = suitablePosition.w; var text_height = suitablePosition.h; %>
<% if( !baseView.checkIfSupportTextWrap() ) { %>
Click to Edit
<% } %>
Warning, click here
<% });%> <% _.each(asset_objects, function(data, key){ data = data.toJSON(); var resize_x = parseFloat(data.x); var resize_y = parseFloat(data.y); var resize_w = parseFloat(data.w); var resize_h = parseFloat(data.h); if(resize_x <= 0){ resize_x = edge_mask_width; resize_w -= resize_x; } if(resize_y <= 0){ resize_y = edge_mask_width; resize_h -= resize_y; } if(resize_x + resize_w > web_w - edge_mask_width*2){ resize_w = web_w - resize_x - edge_mask_width; } if(resize_y + resize_h > web_h - edge_mask_width*2){ resize_h = web_h - resize_y - edge_mask_width; } if (resize_w<1) resize_w = 1; if (resize_h<1) resize_h = 1; var diff_x = resize_x - parseFloat(data.x); var diff_y = resize_y - parseFloat(data.y); var is_back_logo = _.isUndefined(data.is_back_logo) ? 0 : parseInt(data.is_back_logo); if( _.isUndefined(data.is_logo) || data.is_logo == 1 ) { %>
Drag to move
low resolution image - not recommended for printing
Zoom
<% } else if( ! is_back_logo || (is_admin && is_back_logo==1 && 1!=hide_back_logo && no_back_logo)) { %>
Drag to move
<% if( ! is_back_logo) { %>
<% } %>
<% } %> <% }); %>