clipbucket/upload/styles/cbv3/layout/manage_collections.html
Fawaz 1c86ef7006 Added : Dashboard functions
Fixed : get_image_file function @functions_photos.php
Added : Add new collection page
Updated : Photo uploader, to select collection if encoded collection_id is provided
2012-12-28 17:33:03 +00:00

319 lines
No EOL
17 KiB
HTML

{include_template_file file="blocks/account_left.html"}
<div class="account-right">
{if $mode == 'add_new'}
<div class="account-heading">
<h2>{lang code='Add new collection'}</h2>
<div class="manager-list">
<form action="" method="post" class="form-horizontal">
<fieldset>
<legend>{lang code='Required fields'}</legend>
{foreach from=$fields item=field}
{include_template_file file='common/form_field.html' field=$field}
{/foreach}
</fieldset>
<fieldset>
<legend>{lang code='Other options'}</legend>
{foreach from=$other_fields item=field}
{include_template_file file='common/form_field.html' field=$field}
{/foreach}
</fieldset>
<div class="form-actions">
<button name="add_collection" id="add_collection" class="btn btn-primary">{lang code='Add new collection'}</button>
</div>
</form>
</div>
</div>
{/if}
{if $mode == "manage" || $mode == ""}
<div class="account-heading">
<h2>{lang code='Manage Collections'} ({$total_collections})</h2>
<div class="account-search absolute top right">
{$search_query=$smarty.get.query}
<form class=" form-search" method="get" action="">
<input type="hidden" name="mode" value="{$mode}" />
<input type="text" class="input-large search-query" name="query" value="{$search_query|form_val}" />
<button type="submit" class="btn">{lang code='Search'}</button>
</form>
</div>
</div>
<div class="manager-list">
<div class="controller scrolltoFixed white-grad">
<div class="buttons">
<div class="btn-toolbar">
<div class="btn-group">
<label class="btn check-all"><input type="checkbox"></label>
</div>
<div class="btn-group">
<a class="btn btn-danger" onclick="return false;">Delete</a>
</div>
</div>
<div class="right-button">
<div class="btn-group">
<button class="btn btn-primary">{current_collection_order()}</button>
<button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right">
{display_collection_manger_orders()}
</ul>
</div>
</div>
</div>
</div>
<form id="photo-manager" method="post">
{if $collections}
<table class="table table-hover">
<thead>
<tr>
<th width="25"></th>
<th></th>
<th width="120"></th>
</tr>
</thead>
<tbody>
{if $collections}
{foreach $collections as $collection}
<tr>
<td class="text-center"><input type="checkbox" class="check-item" name="check_col[]" value="{$collection.collection_id}" /></td>
<td>
<div class="relative collection-manager-thumbs">
<div class="object-manager-thumb image-not-loaded-background">
<img src="{$cbcollection->get_thumb($collection)}" />
</div>
{$cover_id=$collection.cover_photo}
{$random_items=$cbcollection->get_collection_items_with_details($collection.collection_id,'RAND()',2," AND object_id != $cover_id")}
{if $random_items}
{$total=count($random_items)}
{foreach $random_items as $ri}
<div class="collection-other-items collection-{$total}-items"><img src="{get_photo details=$ri}" /></div>
{/foreach}
{/if}
</div>
<div class="object-manager-content">
<a href="{collection_links($collection,'edit')}" class="object-manager-title">{$collection.collection_name}</a>
<div class="object-manager-details">
<ul>
<li><i class="icon-picture"></i> <a href="{collection_links( $collection, 'manage_items')}">{$collection.total_objects} {lang code='photo'}{if $collection.total_objects > 1}s{/if}</a></li>
<li><i class="icon-calendar"></i> {$collection.date_added|date_format:"%B %e, %Y"}</li>
<li><i class="icon-eye-open"></i> {$collection.views|number_format} {lang code='views'}</li>
<li><i class="icon-comment"></i> {$collection.total_comments|number_format} {lang code='comments'}</li>
<li><i class="icon-heart"></i> {$collection.total_favorites|number_format} {lang code='favorites'}</li>
</ul>
</div>
</div>
</td>
<td>
<div class="btn-group">
<button class="btn btn-block dropdown-toggle" type="button" data-toggle="dropdown">Options <span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<li><a href="{collection_links($collection,'vc')}">{lang code='View collection'}</a></li>
<li><a href="{collection_links($collection,'edit')}">{lang code='Edit collection'}</a></li>
<li class="divider"></li>
<li><a href="#">{lang code='Delete collection'}</a></li>
</ul>
</div>
</td>
</tr>
{/foreach}
<script type="text/javascript">
$( document ).ready( function(){
$('.collection-manager-thumbs .collection-other-items').each( function(i, object){
var other_img = $( object ).find('img');
other_img.load( function() {
other_img.css({
'position': 'absolute',
'top' : '50%',
'left' : '50%',
'marginLeft' : '-'+( other_img.width() / 2 )+'px',
'marginTop' : '-'+( other_img.height() / 2 )+'px'
})
});
});
});
</script>
{/if}
</tbody>
</table>
{/if}
{if !$collections}
<p class="alert alert-large">{lang code='No collections found'}{if $smarty.get.query},{lang code='matching this keyword'}{/if}.</p>
{/if}
</form>
</div>
{/if}
{if $mode == "manage_items" || $mode == "collection_items"}
<div class="account-heading clearfix">
<h2 class="margin0">{$collection.collection_name} ({$collection.total_objects})</h2>
{if $collection.collection_description}<p class="muted">{$collection.collection_description}</p>{/if}
<div class="account-search absolute top right">
{lang code='Last update'} {$collection.last_updated|niceTime}<br/>
{$collection.views|number_format} {lang code='views'}
</div>
</div>
<div class="manager-list">
<div class="controller scrolltoFixed white-grad clearfix">
<div class="buttons">
<div class="btn-toolbar">
<div class="btn-group pull-right">
<button class="btn btn-primary">{current_photo_order()}</button>
<button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right">
{display_photo_manger_orders()}
</ul>
</div>
</div>
</div>
</div>
{if $objs}
<div id="collection-items-container">
{foreach $objs as $avatar}
<div class="manage-collection-items">
<div class="manage-collection-item">
<img src="{get_photo details=$avatar size='m'}" class="manage-collection-item-thumb cbv3-center-image" />
<div class="black-gradient absolute bottom manage-collection-item-details">
<h4><a href="{$cbphoto->collection->collection_links($collection,'vc')}">{$collection.collection_name}</a></h4>
<div class="pull-left">{$avatar.date_added|date_format}</div>
<div class="pull-right">{$avatar.views|number_format} {lang code='views'}</div>
</div>
</div>
<ul class="nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{lang code='Options'}"><i class="icon-cog icon-white"></i></a>
<ul class="dropdown-menu pull-right">
<li><a href="{view_photo_link($avatar)}">{lang code='View'}</a></li>
<li><a href="edit_photo.php?photo={$avatar.photo_id}">{lang code='Edit'}</a></li>
{display_manager_links($avatar)}
<li class="divider"></li>
<li><a href="#" onclick="cb_confirm('Delete Photo', 'Are you sure you want to delete this photo ? This action will delete photo permanently.', function(){
window.location = '?mode={$mode}&cid={$avatar.collection_id}&delete_photo={$avatar.photo_id}';
});">Delete</a></li>
</ul>
</li>
</ul>
</div>
{/foreach}
</div>
{/if}
</div>
{/if}
{if $mode == 'edit_collection'}
<ul class="breadcrumb">
<li><a href="#">My account</a> <span class="divider">/</span></li>
<li><a href="#">Library</a> <span class="divider">/</span></li>
<li class="active">Data</li>
</ul>
<div class="account-heading">
<h4>{lang code='edit_type_collection' sprintf=$c.collection_name}</h4>
</div>
<div class="account-inner-left">
<form method="post" action="" name="edit-collection">
<fieldset>
<legend>{lang code='Collection Details'}</legend>
{foreach $fields as $field}
{* Formating field for our template *}
{$field.class='input-xxlarge'}
{if $field.type=='checkbox' || $field.type=='radiobutton'}
{$field.sep=' '}
{if $field.type=='checkbox'}
{$field.class='checkbox'}
{else}
{$field.class='radio'}
{/if}
{/if}
<div class="control-group"{if $field@first} style="margin-top:0px;"{/if}>
<label class="control-label" for="{$field.id}">{$field.title}
{if $field.hint_before}
<div>{$field.hint_before}</div>
{/if}
</label>
<div class="controls">
{ANCHOR place=$field.anchor_before}
{$formObj->createField($field)}
{ANCHOR place=$field.anchor_after}
{if $field.hint_after}
<p class="help-block">{$field.hint_after}</p>
{/if}
</div>
</div>
{/foreach}
</fieldset>
<fieldset>
<legend>{lang code='Collection Options'}</legend>
{foreach $other_fields as $field}
{* Formating field for our template *}
{$field.class='input-xxlarge'}
{if $field.type=='checkbox' || $field.type=='radiobutton'}
{$field.sep=' '}
{if $field.type=='checkbox'}
{$field.class='checkbox'}
{else}
{$field.class='radio'}
{/if}
{/if}
<div class="control-group"{if $field@first} style="margin-top:0px;"{/if}>
<label class="control-label" for="{$field.id}">{$field.title}
{if $field.hint_before}
<div>{$field.hint_before}</div>
{/if}
</label>
<div class="controls">
{ANCHOR place=$field.anchor_before}
{$formObj->createField($field)}
{ANCHOR place=$field.anchor_after}
{if $field.hint_after}
<p class="help-block">{$field.hint_after}</p>
{/if}
</div>
</div>
{/foreach}
</fieldset>
<input type="hidden" name="collection_id" id="collection_id" value="{$collection.collection_id}" />
<div class="form-actions">
<button type="submit" name="update_collection" class="btn btn-primary">{lang code='Save Changes'}</button>
</div>
</form>
</div>
<div class="account-inner-nav">
<ul class="nav nav-list">
<li class="nav-header">{lang code='Available Actions'}</li>
<li><a href="{collection_links($collection)}">{lang code='View collection'}</a></li>
<li class="divider"></li>
<li><a href="javascript:void(0)" onclick="cb_confirm('Delete Photo','Are you sure you want to delete this photo ? This action will delete photo permanently.', function(){
window.location = '?mode=uploaded&delete_photo={$photo.photo_id}';
})">{lang code='Delete collection'}</a></li>
</ul>
</div>
{/if}
</div>