clipbucket/upload/admin_area/styles/cbv3/layout/edit_photo.html
Fawaz 2767d02906 Added : Photo Tags Manager
Added : Tags manager for photo
Added : bootstrap-transition.js for unsupported browsers
Added : New method get_tags for cbphoto class
Optimized : remove_photo_tag method
Fixed : load_tagging function
2012-07-25 11:53:42 +00:00

469 lines
No EOL
23 KiB
HTML

{$photo=$data}
{if $view}
{if $view == 'tags'}
<h2>Photo Tags</h2>
<p>Complete list of tags for current photo</p>
<div id="photo-tags-advance-search" class="modal hide fade">
<div class="modal-header">
<h3>Advance Search</h3>
</div>
<div class="modal-body">
<form id="search-photo-tags-form" name="search-photo-tags-form" class="form-horizontal" method="get" action="">
<input type="hidden" name="search" value="do" />
<input type="hidden" value="{$smarty.get.photo}" name="photo" />
<input type="hidden" name="view" value="tags" />
<div class="control-group">
<label class="control-label" for="tag">Tag</label>
<div class="controls">
<input type="text" class="input input-xlarge" id="tag" name="tag" value="{'tag'|get_form_val:true}">
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="tagged">Tagged</label>
<div class="controls">
<input type="text" class="input input-xlarge" id="tagged" name="tagged" value="{'tagged'|get_form_val:true}">
<p class="help-block">If you are looking for certain user's photos in which it has been tagged, provide it's userid and empty <label for="tag" class="inline"><code>Tag</code></label> Field</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="tagger">Tagged By</label>
<div class="controls">
<input type="text" class="input input-xlarge" id="tagger" name="tagger" value="{'tagger'|get_form_val:true}">
<p class="help-block">userid of user who has tagged the photos.</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="only_user">Only User Tags</label>
<div class="controls">
<input type="checkbox" id="only_user" name="only_user" value="true"{if $smarty.get.only_user == 'true'} checked="checked"{/if}>
<p class="help-block">Only include tags that are users from database</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="tagger">Order By</label>
<div class="controls">
<select name="order" id="order">
<option value="date_added"{if $smarty.get.order=='date_added'} selected="selected"{/if}>Date</option>
<option value="ptag_id"{if $smarty.get.order == 'ptag_id'} selected="selected"{/if}>ID</option>
<option value="ptag_username"{if $smarty.get.order=='ptag_username'} selected="selected"{/if}>Tag</option>
</select>
<select name="orderby" id="orderby" class="span1">
<option value="asc"{if $smarty.get.orderby=='asc'} selected="selected"{/if} title="Ascending">asc</option>
<option value="desc"{if $smarty.get.orderby == 'desc' || !$smarty.get.orderby} selected="selected"{/if} title="Descending">desc</option>
</select>
<p class="help-block"></p>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<a href="javascript:void(0)" class="btn" data-dismiss="modal">Cancel</a>
<input type="button" class="btn btn-primary" name="search" value="Search" onclick="$('#search-photo-tags-form').submit();" />
</div>
</div>
<div class="manager-list">
<div class="controller scrtolltoFixed white-grad">
<div class="buttons clearfix">
<div class="btn-toolbar">
<div class="btn-group">
<label class="btn check-all"><input type="checkbox"></label>
</div>
<div class="btn-group">
<a href="edit_photo.php?photo={$photo.photo_id}" class="btn">Back to details</a>
</div>
<div class="btn-group">
<a href="#" class="btn btn-danger" onclick="cb_confirm('{lang code="Delete Tags"}','{lang code="Are you sure you want to delete selected photo tags ?"}', function(){
$('#do-action').val('delete_selected'); $('#tags_manager_form').submit();
}); return false;">Delete</a>
</div>
</div>
<div class="right-button">
<form action="" method="get" id="photo-tags-quick-search">
<input type="hidden" value="{$smarty.get.photo}" name="photo" />
<input type="hidden" name="view" value="tags" />
<input class="input valignTop" name="tag" value="{'tag'|get}">
<button class="btn btn-primary" name="search" value="do" type="submit">
<i class="icon-search icon-white"></i>
Search
</button>
<a href="#" data-target="#photo-tags-advance-search" data-toggle="modal" class="btn">Advance Search</a>
</form>
</div>
</div>
</div>
<form id="tags_manager_form" method="post" name="tags_manager_form">
<input type="hidden" name="action" id="do-action" value="" />
<table id="photo_manager_table" class="table table-striped list-block {if !$tags}display-none{/if}">
<thead>
<tr>
<th width="50"></th>
<th width="70">#</th>
<th>Tag Hash <span class="icon-info-sign popover-class" rel="popover" title="What is Tag Hash ?" data-content="Tag Hash is unique identifier for tag string. This helps in keeping tags unique for current photo."></span></th>
<th width="150">Tag</th>
<th width="150">Tagged By</th>
<th width="150">Date</th>
<th width="120"></th>
</tr>
</thead>
{if $tags}
{foreach $tags as $tag}
<tr>
<td><input type="checkbox" class="check-item" name="check_tag[]" value="{$tag.ptag_id}" /></td>
<td>{$tag.ptag_id}</td>
<td>{$tag.ptag_key}</td>
<td>
{if $tag.ptag_isuser}
<a href="view_user.php?uid={$tag.ptag_userid}">{$tag.ptag_username}</a>
{else}
{$tag.ptag_username}
{/if}
</td>
<td><a href="view_user.php?uid={$tag.ptag_by_userid}">{$tag.ptag_by_username}</a></td>
<td>{$tag.date_added|niceTime:true}</td>
<td><a href="#" onclick="cb_confirm('Delete Tag','Are you sure you want to delete this tag ?', function(){
window.location = '?photo={$tag.photo_id}&view=tags&delete_tag={$tag.ptag_id}';
}); return false;" class="btn btn-small">Delete Tag</a></td>
</tr>
{/foreach}
{/if}
</table>
</form>
{if !$tags}
{if $smarty.get.search == 'do'}<div class="alert">No tags found for current criteria</div>{else}<div class="alert">This photo has no tags ..</div>{/if}
{/if}
</div>
{/if}
{if $view == 'exif'}
<script>
$(function(){
$('#settings-container').masonry({
// options
itemSelector : '.settings-block',
columnWidth: 400,
isResizable : true
});
});
</script>
<h2>Exif Data</h2>
<p>Exif data is a record of the settings a camera used to take a photo. This information is embedded into the files the camera saves</p>
<div class="manager-list">
<div class="controller scrtolltoFixed white-grad">
<div class="buttons clearfix">
<div class="btn-toolbar">
<div class="btn-group">
<a href="edit_photo.php?photo={$photo.photo_id}" class="btn btn-primary">Back to details</a>
</div>
</div>
</div>
</div>
</div>
<div id="settings-container">
{if $exif.rest}
<div class="settings-block">
<fieldset>
<legend>Other Information</legend>
<table class="table">
{foreach $exif.rest as $name => $value}
{if $value}
<tr>
<td>{$name|format_exif_camelCase|capitalize}:</td>
<td>{$value}</td>
</tr>
{/if}
{/foreach}
</table>
</fieldset>
</div>
{/if}
<div class="settings-block">
<fieldset>
<legend>Dates</legend>
<table class="table">
{if $exif.dates.taken}
<tr>
<td>Taken on:</td>
<td>{$exif.dates.taken} ( {$exif.dates.taken|niceTime} )</td>
</tr>
{/if}
<tr>
<td>{lang code='Added on %s'|sprintf:'here'}:</td>
<td>{$exif.dates.uploaded} ( {$exif.dates.uploaded|niceTime} )</td>
</tr>
</table>
</fieldset>
</div>
{if $exif.base}
<div class="settings-block">
<fieldset>
<legend>Base Information</legend>
<table class="table">
{foreach $exif.base as $name => $base}
{if $base}
<tr>
<td>{lang code="$name"|capitalize}</td>
<td>{$base}</td>
</tr>
{/if}
{/foreach}
</table>
</fieldset>
</div>
{/if}
</div>
{/if}
{else}
<h2>Edit Photo : {$photo.photo_title}</h2>
<p>This is a complete list of information that is displayed or used for displaying a photo.</p>
<script>
$(function(){
$('#settings-container').masonry({
// options
itemSelector : '.settings-block',
columnWidth: 400,
isResizable : true
});
});
</script>
<div class="controller scrolltoFixed white-grad">
<div class="buttons">
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn" onclick=""><span class="icon icon-eye-open"></span></a>
</div>
<div class="btn-group dropdown">
<a class="btn">Options</a>
<a class="btn dropdown-toggle" onclick="" data-toggle="dropdown"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{$cbphoto->photo_links($photo,'view_photo')}">View Photo</a></li>
{if $photo.is_mature == 'yes'}
<li><a href="?mode=rm&photo={$photo.photo_id}">Remove Mature Flag</a></li>
{else}
<li><a href="?mode=am&photo={$photo.photo_id}">Add Mature Flag</a></li>
{/if}
{if $photo.featured == 'yes'}
<li><a href="?mode=ufp&photo={$photo.photo_id}">Unfeature It</a></li>
{else}
<li><a href="?mode=fp&photo={$photo.photo_id}">Make Featured</a></li>
{/if}
{if $photo.active == 'yes'}
<li><a href="?mode=dap&photo={$photo.photo_id}">Deactivate</a></li>
{else}
<li><a href="?mode=ap&photo={$photo.photo_id}">Activate</a></li>
{/if}
{display_manager_links($photo)}
<li class="divider"></li>
<li><a href="#" onclick=" cb_confirm('Delete Photo','Are you sure you want to delete this photo ?', function(){
window.location = 'photo_manager.php?delete_photo={$photo.photo_id}'
}); return false;">Delete Photo</a></li>
</ul>
</div>
<div class="btn-group">
<a href="#" class="btn btn-danger" onclick=" cb_confirm('Delete Photo','Are you sure you want to delete this photo ?', function(){
window.location = 'photo_manager.php?delete_photo={$photo.photo_id}'
}); return false;">Delete</a>
</div>
<div class="btn-group">
{$colors=get_photo_meta_value($photo.photo_id,'colors')}
{if $photo.ptags_count > 0}
<a href="edit_photo.php?photo={$photo.photo_id}&view=tags" class="btn">Photo Tags</a>
{/if}
{if $colors}
<a href="#{$photo.photo_id}-colors-modal" class="btn" data-toggle="modal">View Colors</a>
{/if}
{if $photo.exif_data == 'yes'}
<a href="edit_photo.php?photo={$photo.photo_id}&view=exif" class="btn">Exif Data</a>
{/if}
</div>
<div class="right-button">
<button class="btn btn-primary" name="save_photo" value="do-action">Save</button>
</div>
</div>
</div>
</div>
<form action="" method="post" name="edit_photo" id="edit_photo" class="form form-vertical">
<div id="settings-container">
<div class="settings-block">
{get_photo details=$photo size='l' width='360' output='html' style='display:block; margin:auto;'}
</div>
<div class="settings-block">
<fieldset>
<legend>Important Details</legend>
<div class="control-group">
<label class="control-label" for="userid">Uploader Userid</label>
<div class="controls">
<div class=" input-append">
<input type="text" class="input-xlarge" id="userid" name="userid" value="{$photo.userid}"{if $photo.is_avatar == 'yes'} disabled="disabled"{/if}><span class="add-on">{$photo.username}</span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="photo_id">Photo ID</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="photo_id" type="text" id="photo_id" value="{$data.photo_id}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="photo_key">Photo Key</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="photo_key" type="text" id="photo_key" value="{$data.photo_key}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="filename">Filename</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="filename" type="text" id="filename" value="{$data.filename}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ext">Extension</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="ext" type="text" id="ext" value="{$data.ext|strtoupper}" />
</div>
</div>
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Required Fields</legend>
{foreach from=$requiredFields item=field}
<div class="control-group">
<label for="{$field.id}" class="control-label">{$field.title}</label>
<div class="controls">
{$field.class='input-xlarge'}
{$formObj->createField($field)}
{if $field.hint_2}<p class="help-block">{$field.hint_2}</p>{/if}
</div>
</div>
{/foreach}
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Other Fields</legend>
{foreach from=$otherFields item=field}
<div class="control-group">
<label for="{$field.id}" class="control-label">{$field.title}</label>
<div class="controls">
{$field.class='input-xlarge'}
{if $field.type=='checkbox' || $field.type=='radiobutton'}
{$field.sep=' '}
{if $field.type=='checkbox'}
{$field.class='checkbox'}
{else}
{$field.class='radio'}
{/if}
{/if}
{$formObj->createField($field)}
{if $field.hint_2}<p class="help-block">{$field.hint_2}</p>{/if}
</div>
</div>
{/foreach}
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Photos Stats and Info</legend>
<div class="control-group">
<label class="control-label" for="views">Views</label>
<div class="controls">
<input type="text" class="input-xlarge" id="views" name="views" value="{$photo.views}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="total_favorites">Total Favorites</label>
<div class="controls">
<input type="text" class="input-xlarge" id="total_favorites" name="total_favorites" value="{$photo.total_favorites}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="total_comments">Total Comments</label>
<div class="controls">
<input type="text" class="input-xlarge" id="total_comments" name="total_comments" value="{$photo.total_comments}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="downloaded">Total Downloads</label>
<div class="controls">
<input type="text" class="input-xlarge" id="downloaded" name="downloaded" value="{$photo.downloaded}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="rating">Rating</label>
<div class="controls">
<div class=" input-append">
<input class="input-xlarge" name="rating" type="text" id="rating" value="{$photo.rating}"><span class="add-on"> of 10</span>
</div>
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="rated_by">Rated By</label>
<div class="controls">
<input type="text" class="input-xlarge" id="rated_by" name="rated_by" value="{$photo.rated_by}" />
<p class="help-block"></p>
</div>
</div>
</fieldset>
</div>
</div>
</form>
{if $colors}
<script type="text/javascript">
$(document).ready(function(){
$('div[rel=tooltip]').tooltip();
});
</script>
{$basedir=$smarty.const.STYLES_DIR}
{include file="$basedir/global/colors.html" colors=$colors|json_decode}
{/if}
{/if}