revert hange in folder admin template

This commit is contained in:
Manuel Raynaud
2013-09-30 14:24:33 +02:00
parent 84847b8765
commit 906c97ca62

View File

@@ -5,332 +5,337 @@
{block name="check-permissions"}admin.folders.view{/block} {block name="check-permissions"}admin.folders.view{/block}
{block name="main-content"} {block name="main-content"}
<div class="folders"> <div class="folders">
<div id="wrapper" class="container"> <div id="wrapper" class="container">
{* include file="includes/folder-breadcrumb.html" *} {* include file="includes/folder-breadcrumb.html" *}
{module_include location='folders_top'} {module_include location='folders_top'}
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="general-block-decorator"> <div class="general-block-decorator">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-condensed" id="folder_list"> <table class="table table-striped table-condensed" id="folder_list">
<caption> <caption>
{* display parent folder name, and get current folder ID *} {* display parent folder name, and get current folder ID *}
{loop name="folder_title" type="folder" visible="*" id=$folder_id} {loop name="folder_title" type="folder" visible="*" id=$parent}
{intl l="Folders in %fold" fold=$TITLE} {intl l="Folders in %fold" fold=$TITLE}
{$fold_id = $ID} {$fold_id = $ID}
{/loop} {/loop}
{elseloop rel="folder_title"} {elseloop rel="folder_title"}
{intl l="Top level folders"} {intl l="Top level folders"}
{/elseloop} {/elseloop}
{module_include location='folder_list_caption'} <td class="object-title">
<a href="{url path='admin/folders' parent=$ID}" title="{intl l='Browse this folder'}">
{$TITLE}
</a>
</td>
{module_include location='folder_list_caption'}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"} {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"}
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new folder'}" href="#folder_creation_dialog" data-toggle="modal"> <a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new folder'}" href="#folder_creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span> <span class="glyphicon glyphicon-plus-sign"></span>
</a> </a>
{/loop} {/loop}
</caption> </caption>
{ifloop rel="folder_list"} {ifloop rel="folder_list"}
<thead> <thead>
<tr> <tr>
<th class="object-title"> <th class="object-title">
{admin_sortable_header {admin_sortable_header
current_order=$folder_order current_order=$folder_order
order='id' order='id'
reverse_order='id_reverse' reverse_order='id_reverse'
path={url path='/admin/folders' id_folder=$folder_id} path={url path='/admin/folders' parent=$parent}
request_parameter_name='folder_order' request_parameter_name='folder_order'
label="{intl l='ID'}" label="{intl l='ID'}"
} }
</th> </th>
<th class="object-image">&nbsp;</th> <th class="object-image">&nbsp;</th>
<th class="object-title"> <th class="object-title">
{admin_sortable_header {admin_sortable_header
current_order=$folder_order current_order=$folder_order
order='alpha' order='alpha'
reverse_order='alpha_reverse' reverse_order='alpha_reverse'
path={url path='/admin/folders' id_folder=$folder_id} path={url path='/admin/folders' parent=$parent}
request_parameter_name='folder_order' request_parameter_name='folder_order'
label="{intl l='Folder title'}" label="{intl l='Folder title'}"
} }
</th> </th>
{module_include location='folder_list_header'} {module_include location='folder_list_header'}
<th> <th>
{admin_sortable_header {admin_sortable_header
current_order=$folder_order current_order=$folder_order
order='visible' order='visible'
reverse_order='visible_reverse' reverse_order='visible_reverse'
path={url path='/admin/folders' id_folder=$folder_id} path={url path='/admin/folders' parent=$parent}
request_parameter_name='folder_order' request_parameter_name='folder_order'
label="{intl l='Online'}" label="{intl l='Online'}"
} }
</th> </th>
<th> <th>
{admin_sortable_header {admin_sortable_header
current_order=$folder_order current_order=$folder_order
order='manual' order='manual'
reverse_order='manual_reverse' reverse_order='manual_reverse'
path={url path='/admin/folders' id_folder=$folder_id} path={url path='/admin/folders' parent=$parent}
request_parameter_name='folder_order' request_parameter_name='folder_order'
label="{intl l='Position'}" label="{intl l='Position'}"
} }
</th> </th>
<th class="actions">{intl l='Actions'}</th> <th class="actions">{intl l='Actions'}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{loop name="folder_list" type="folder" visible="*" parent=$folder_id order=$folder_order backend_context="1" lang=$lang_id} {loop name="folder_list" type="folder" visible="*" parent=$parent order=$folder_order backend_context="1" lang=$lang_id}
<tr> <tr>
<td>{$ID}</td> <td>{$ID}</td>
<td> <td>
{loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} {loop type="image" name="folder_image" source="folder" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
<a href="{url path='admin/folder' folder_id=$ID}" title="{intl l='Browse this folder'}"><img class="img-thumbnail" src="{$IMAGE_URL}" alt="{$TITLE}" /></a> <a href="{url path='admin/folders' parent=$ID}" title="{intl l='Browse this folder'}"><img class="img-thumbnail" src="{$IMAGE_URL}" alt="{$TITLE}" /></a>
{/loop} {/loop}
</td> </td>
<td class="object-title"> <td class="object-title">
<a href="{url path='admin/folder' folder_id=$ID}" title="{intl l='Browse this folder'}"> <a href="{url path='admin/folders' parent=$ID}" title="{intl l='Browse this folder'}">
{$TITLE} {$TITLE}
</a> </a>
</td> </td>
{module_include location='folder_list_row'} {module_include location='folder_list_row'}
<td> <td>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
<div class="make-switch switch-small folderVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>"> <div class="make-switch switch-small folderVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" class="folderVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}> <input type="checkbox" class="folderVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
</div> </div>
{/loop} {/loop}
{elseloop rel="can_change"} {elseloop rel="can_change"}
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>"> <div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}> <input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}>
</div> </div>
{/elseloop} {/elseloop}
</td> </td>
<td> <td>
{admin_position_block {admin_position_block
permission="admin.folders.edit" permission="admin.folders.edit"
path={url path='admin/folders/update-position' folder_id=$ID} path={url path='admin/folders/update-position' folder_id=$ID}
url_parameter="folder_id" url_parameter="folder_id"
in_place_edit_class="folderPositionChange" in_place_edit_class="folderPositionChange"
position=$POSITION position=$POSITION
id=$ID id=$ID
} }
</td> </td>
<td class="actions"> <td class="actions">
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Browse this folder'}" href="{url path='admin/folder' folder_id=$ID}"><i class="glyphicon glyphicon-folder-open"></i></a> <a class="btn btn-default btn-xs" title="{intl l='Browse this folder'}" href="{url path='admin/folders' parent=$ID}"><i class="glyphicon glyphicon-folder-open"></i></a>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.folders.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this folder'}" href="{url path='/admin/folders/update' folder_id=$ID}"><i class="glyphicon glyphicon-edit"></i></a> <a class="btn btn-default btn-xs" title="{intl l='Edit this folder'}" href="{url path="/admin/folders/update/{$ID}"}"><i class="glyphicon glyphicon-edit"></i></a>
{/loop} {/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.folders.delete"} {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.folders.delete"}
<a class="btn btn-default btn-xs folder-delete" title="{intl l='Delete this folder and all its contents'}" href="#folder_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a> <a class="btn btn-default btn-xs folder-delete" title="{intl l='Delete this folder and all its contents'}" href="#folder_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
{/loop} {/loop}
</div> </div>
</td> </td>
</tr> </tr>
{/loop} {/loop}
</tbody> </tbody>
{/ifloop} {/ifloop}
{elseloop rel="folder_list"} {elseloop rel="folder_list"}
<thead> <thead>
<tr> <tr>
<td class="message"> <td class="message">
<div class="alert alert-info"> <div class="alert alert-info">
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"} {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.folders.create"}
{intl l="This folder has no sub-folders. To create a new one, click the + button above."} {intl l="This folder has no sub-folders. To create a new one, click the + button above."}
{/loop} {/loop}
{elseloop rel="can_create"} {elseloop rel="can_create"}
{intl l="This folder has no sub-folders."} {intl l="This folder has no sub-folders."}
{/elseloop} {/elseloop}
</div> </div>
</td> </td>
</tr> </tr>
</thead> </thead>
{/elseloop} {/elseloop}
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
{* -- CONTENT MANAGEMENT ---------------------------------------------------- *} {* -- CONTENT MANAGEMENT ---------------------------------------------------- *}
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="general-block-decorator"> <div class="general-block-decorator">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-condensed"> <table class="table table-striped table-condensed">
<caption> <caption>
{* display parent folder name *} {* display parent folder name *}
{loop name="folder_title" type="folder" visible="*" id=$folder_id} {loop name="folder_title" type="folder" visible="*" id=$parent}
{intl l="Contents in %fold" fold=$TITLE} {intl l="Contents in %fold" fold=$TITLE}
{/loop} {/loop}
{elseloop rel="folder_title"} {elseloop rel="folder_title"}
{intl l="Top level Contents"} {intl l="Top level Contents"}
{/elseloop} {/elseloop}
{module_include location='content_list_caption'} {module_include location='content_list_caption'}
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new content'}" href="#content_creation_dialog" data-toggle="modal"> <a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new content'}" href="#content_creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span> <span class="glyphicon glyphicon-plus-sign"></span>
</a> </a>
</caption> </caption>
{ifloop rel="content_list"} {ifloop rel="content_list"}
<thead> <thead>
<tr> <tr>
<th class="object-title"> <th class="object-title">
{admin_sortable_header {admin_sortable_header
current_order=$content_order current_order=$content_order
order='id' order='id'
reverse_order='id_reverse' reverse_order='id_reverse'
path={url path='/admin/folders' id_folder=$folder_id target='contents'} path={url path='/admin/folders' parent=$parent target='contents'}
label="{intl l='ID'}" label="{intl l='ID'}"
} }
<th>&nbsp;</th> <th>&nbsp;</th>
<th class="object-title"> <th class="object-title">
{admin_sortable_header {admin_sortable_header
current_order=$content_order current_order=$content_order
order='alpha' order='alpha'
reverse_order='alpha_reverse' reverse_order='alpha_reverse'
path={url path='/admin/folders' id_folder=$folder_id target='contents'} path={url path='/admin/folders' parent=$parent target='contents'}
label="{intl l='Content title'}" label="{intl l='Content title'}"
} }
{module_include location='content_list_header'} {module_include location='content_list_header'}
<th> <th>
{admin_sortable_header {admin_sortable_header
current_order=$content_order current_order=$content_order
order='visible' order='visible'
reverse_order='visible_reverse' reverse_order='visible_reverse'
path={url path='/admin/folders' id_folder=$folder_id target='contents'} path={url path='/admin/folders' parent=$parent target='contents'}
label="{intl l='Online'}" label="{intl l='Online'}"
} }
</th> </th>
<th> <th>
{admin_sortable_header {admin_sortable_header
current_order=$content_order current_order=$content_order
order='manual' order='manual'
reverse_order='manual_reverse' reverse_order='manual_reverse'
path={url path='/admin/folders' id_folder=$folder_id target='contents'} path={url path='/admin/folders' parent=$parent target='contents'}
label="{intl l='Position'}" label="{intl l='Position'}"
} }
</th> </th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{loop name="content_list" type="content" visible="*" folder_default=$folder_id order=$content_order} {loop name="content_list" type="content" visible="*" folder_default=$parent order=$content_order}
<tr> <tr>
<td>{$ID}</td> <td>{$ID}</td>
<td> <td>
{loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} {loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
<a href="{url path='admin/content/edit' id=$ID}" title="{intl l='Edit this content'}"> <a href="{url path="admin/content/update/$ID"}" title="{intl l='Edit this content'}">
<img src="{$IMAGE_URL}" alt="{$TITLE}" /> <img src="{$IMAGE_URL}" alt="{$TITLE}" />
</a> </a>
{/loop} {/loop}
<td class="object-title"><a href="{url path="/admin/content/update/$ID"}" title="{intl l='Edit this content'}">{$TITLE}</a></td> <td class="object-title"><a href="{url path="/admin/content/update/$ID"}" title="{intl l='Edit this content'}">{$TITLE}</a></td>
{module_include location='content_list_row'} {module_include location='content_list_row'}
<td> <td>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.contents.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.contents.edit"}
<div class="make-switch switch-small contentVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>"> <div class="make-switch switch-small contentVisibleToggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" class="contentVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}> <input type="checkbox" class="contentVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
</div>
{/loop}
{elseloop rel="can_change"}
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}>
</div>
{/elseloop}
</td>
<td>
{admin_position_block
permission="admin.content.edit"
path={url path='/admin/content/update-position' content_id=$ID}
url_parameter="content_id"
in_place_edit_class="contentPositionChange"
position=$POSITION
id=$ID
}
</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.content.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this content'}" href="{url path="admin/content/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
{/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.content.delete"}
<a class="btn btn-default btn-xs content-delete" title="{intl l='Delete this content'}" href="#content_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
{/loop}
</div> </div>
{/loop} </td>
</tr>
{/loop}
</tbody>
{/ifloop}
{elseloop rel="can_change"} {elseloop rel="content_list"}
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>"> <thead>
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}> <tr>
</div> <td class="message"><div class="alert alert-info">{intl l="This folder doesn't contains any contents. To add a new content, <strong>click the + button</strong> above."}</div></td>
{/elseloop} </tr>
</td> </thead>
{/elseloop}
<td> </table>
{admin_position_block
permission="admin.content.edit"
path={url path='/admin/content/update-position' content_id=$ID}
url_parameter="content_id"
in_place_edit_class="contentPositionChange"
position=$POSITION
id=$ID
}
</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.content.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this content'}" href="{url path="admin/content/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
{/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.content.delete"}
<a class="btn btn-default btn-xs content-delete" title="{intl l='Delete this content'}" href="#content_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
{/loop}
</div>
</td>
</tr>
{/loop}
</tbody>
{/ifloop}
{elseloop rel="content_list"}
<thead>
<tr>
<td class="message"><div class="alert alert-info">{intl l="This folder doesn't contains any contents. To add a new content, <strong>click the + button</strong> above."}</div></td>
</tr>
</thead>
{/elseloop}
</table>
</div> </div>
</div>
</div> </div>
</div> </div>
</div>
{module_include location='folders_bottom'} {module_include location='folders_bottom'}
</div> </div>
</div> </div>
{* -- Adding a new folder ------------------------------------------------- *} {* -- Adding a new folder ------------------------------------------------- *}
{form name="thelia.admin.folder.creation"} {form name="thelia.admin.folder.creation"}
{* Capture the dialog body, to pass it to the generic dialog *} {* Capture the dialog body, to pass it to the generic dialog *}
{capture "folder_creation_dialog"} {capture "folder_creation_dialog"}
@@ -338,12 +343,12 @@
{form_hidden_fields form=$form} {form_hidden_fields form=$form}
{form_field form=$form field='success_url'} {form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
<input type="hidden" name="{$name}" value="{url path='/admin/folders/update' folder_id='_ID_'}" /> <input type="hidden" name="{$name}" value="{url path='/admin/folders/update/_ID_'}" />
{/form_field} {/form_field}
{form_field form=$form field='parent'} {form_field form=$form field='parent'}
<input type="hidden" name="{$name}" value="{$folder_id}" /> <input type="hidden" name="{$name}" value="{$parent}" />
{/form_field} {/form_field}
{form_field form=$form field='title'} {form_field form=$form field='title'}
@@ -357,12 +362,12 @@
<div class="help-block">{intl l='Enter here the folder name in the default language (%title)' title="$TITLE"}</div> <div class="help-block">{intl l='Enter here the folder name in the default language (%title)' title="$TITLE"}</div>
{* Switch edition to the current locale *} {* Switch edition to the current locale *}
<input type="hidden" name="edit_language_id" value="{$ID}" /> <input type="hidden" name="edit_language_id" value="{$ID}" />
{form_field form=$form field='locale'} {form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$LOCALE}" /> <input type="hidden" name="{$name}" value="{$LOCALE}" />
{/form_field} {/form_field}
{/loop} {/loop}
</div> </div>
{/form_field} {/form_field}
@@ -382,55 +387,55 @@
{/capture} {/capture}
{include {include
file = "includes/generic-create-dialog.html" file = "includes/generic-create-dialog.html"
dialog_id = "folder_creation_dialog" dialog_id = "folder_creation_dialog"
dialog_title = {intl l="Create a new folder"} dialog_title = {intl l="Create a new folder"}
dialog_body = {$smarty.capture.folder_creation_dialog nofilter} dialog_body = {$smarty.capture.folder_creation_dialog nofilter}
dialog_ok_label = {intl l="Create this folder"} dialog_ok_label = {intl l="Create this folder"}
form_action = {url path='/admin/folders/create'} form_action = {url path='/admin/folders/create'}
form_enctype = {form_enctype form=$form} form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message form_error_message = $form_error_message
} }
{/form} {/form}
{* -- Adding a new content -------------------------------------------------- *} {* -- Adding a new content -------------------------------------------------- *}
{form name="thelia.admin.content.creation"} {form name="thelia.admin.content.creation"}
{* Capture the dialog body, to pass it to the generic dialog *} {* Capture the dialog body, to pass it to the generic dialog *}
{capture "content_creation_dialog"} {capture "content_creation_dialog"}
{form_hidden_fields form=$form} {form_hidden_fields form=$form}
{* Be sure to get the folder_id, even if the form could not be validated *} {* Be sure to get the folder_id, even if the form could not be validated *}
<input type="hidden" name="folder_id" value="{$folder_id}" /> <input type="hidden" name="parent" value="{$parent}" />
{form_field form=$form field='success_url'} {form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
<input type="hidden" name="{$name}" value="{url path='/admin/contents/update' content_id='_ID_'}" /> <input type="hidden" name="{$name}" value="{url path='/admin/content/update/_ID_' }" />
{/form_field} {/form_field}
{form_field form=$form field='default_folder'} {form_field form=$form field='default_folder'}
<input type="hidden" name="{$name}" value="{$folder_id}" /> <input type="hidden" name="{$name}" value="{$parent}" />
{/form_field} {/form_field}
{form_field form=$form field='title'} {form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label> <label for="{$label_attr.for}" class="control-label">{$label} : </label>
{loop type="lang" name="default-lang" default_only="1"} {loop type="lang" name="default-lang" default_only="1"}
<div class="input-group"> <div class="input-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Title'}"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Title'}">
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span> <span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
</div> </div>
<div class="help-block">{intl l='Enter here the content name in the default language (%title)' title="$TITLE"}</div> <div class="help-block">{intl l='Enter here the content name in the default language (%title)' title="$TITLE"}</div>
{* Switch edition to the current locale *} {* Switch edition to the current locale *}
<input type="hidden" name="edit_language_id" value="{$ID}" /> <input type="hidden" name="edit_language_id" value="{$ID}" />
{form_field form=$form field='locale'} {form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$LOCALE}" /> <input type="hidden" name="{$name}" value="{$LOCALE}" />
@@ -455,18 +460,18 @@
{/capture} {/capture}
{include {include
file = "includes/generic-create-dialog.html" file = "includes/generic-create-dialog.html"
dialog_id = "content_creation_dialog" dialog_id = "content_creation_dialog"
dialog_title = {intl l="Create a new content"} dialog_title = {intl l="Create a new content"}
dialog_body = {$smarty.capture.content_creation_dialog nofilter} dialog_body = {$smarty.capture.content_creation_dialog nofilter}
dialog_ok_label = {intl l="Create this content"} dialog_ok_label = {intl l="Create this content"}
form_action = {url path='/admin/contents/create'} form_action = {url path='/admin/content/create'}
form_enctype = {form_enctype form=$form} form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message form_error_message = $form_error_message
} }
{/form} {/form}
{* -- Delete folder confirmation dialog ----------------------------------- *} {* -- Delete folder confirmation dialog ----------------------------------- *}
@@ -479,36 +484,36 @@
{/capture} {/capture}
{include {include
file = "includes/generic-confirm-dialog.html" file = "includes/generic-confirm-dialog.html"
dialog_id = "folder_delete_dialog" dialog_id = "folder_delete_dialog"
dialog_title = {intl l="Delete folder"} dialog_title = {intl l="Delete folder"}
dialog_message = {intl l="Do you really want to delete this folder and all its content ?"} dialog_message = {intl l="Do you really want to delete this folder and all its content ?"}
form_action = {url path='/admin/folders/delete'} form_action = {url path='/admin/folders/delete'}
form_content = {$smarty.capture.folder_delete_dialog nofilter} form_content = {$smarty.capture.folder_delete_dialog nofilter}
} }
{* -- Delete content confirmation dialog ------------------------------------ *} {* -- Delete content confirmation dialog ------------------------------------ *}
{capture "content_delete_dialog"} {capture "content_delete_dialog"}
<input type="hidden" name="content_id" id="content_delete_id" value="" /> <input type="hidden" name="content_id" id="content_delete_id" value="" />
<input type="hidden" name="folder_id" value="{$folder_id}" /> <input type="hidden" name="folder_id" value="{$parent}" />
{module_include location='content_delete_form'} {module_include location='content_delete_form'}
{/capture} {/capture}
{include {include
file = "includes/generic-confirm-dialog.html" file = "includes/generic-confirm-dialog.html"
dialog_id = "content_delete_dialog" dialog_id = "content_delete_dialog"
dialog_title = {intl l="Delete content"} dialog_title = {intl l="Delete content"}
dialog_message = {intl l="Do you really want to delete this content ?"} dialog_message = {intl l="Do you really want to delete this content ?"}
form_action = {url path='/admin/content/delete'} form_action = {url path='/admin/content/delete'}
form_content = {$smarty.capture.content_delete_dialog nofilter} form_content = {$smarty.capture.content_delete_dialog nofilter}
} }
{/block} {/block}
{block name="javascript-initialization"} {block name="javascript-initialization"}
@@ -536,23 +541,23 @@
// JS stuff for creation form // JS stuff for creation form
{include {include
file = "includes/generic-js-dialog.html" file = "includes/generic-js-dialog.html"
dialog_id = "folder_creation_dialog" dialog_id = "folder_creation_dialog"
form_name = "thelia.admin.folder.creation" form_name = "thelia.admin.folder.creation"
} }
{include {include
file = "includes/generic-js-dialog.html" file = "includes/generic-js-dialog.html"
dialog_id = "content_creation_dialog" dialog_id = "content_creation_dialog"
form_name = "thelia.admin.content.creation" form_name = "thelia.admin.content.creation"
} }
{* Toggle object visibility *} {* Toggle object visibility *}
$(".folderVisibleToggle").on('switch-change', function(event, data) { $(".folderVisibleToggle").on('switch-change', function(event, data) {
$.ajax({ $.ajax({
url : "{url path='admin/folders/toggle-online'}", url : "{url path='admin/folders/toggle-online'}",
data : { data : {
folder_id : $(this).data('id'), folder_id : $(this).data('id'),
action : 'visibilityToggle' action : 'visibilityToggle'
} }
@@ -570,9 +575,9 @@
}); });
}); });
{* Inline editing of object position using bootstrap-editable *} {* Inline editing of object position using bootstrap-editable *}
$('.folderPositionChange').editable({ $('.folderPositionChange').editable({
type : 'text', type : 'text',
title : '{intl l="Enter new folder position"}', title : '{intl l="Enter new folder position"}',
mode : 'popup', mode : 'popup',
@@ -580,18 +585,18 @@
placement : 'left', placement : 'left',
success : function(response, newValue) { success : function(response, newValue) {
// The URL template // The URL template
var url = "{url noamp='1' path='/admin/folders/update-position' folder_id='__ID__' position='__POS__'}"; var url = "{url path='/admin/folders/update-position' folder_id='__ID__' position='__POS__'}";
// Perform subtitutions // Perform subtitutions
url = url.replace('__ID__', $(this).data('id')) url = url.replace('__ID__', $(this).data('id'))
.replace('__POS__', newValue); .replace('__POS__', newValue);
// Reload the page // Reload the page
location.href = url; location.href = url;
} }
}); });
$('.contentPositionChange').editable({ $('.contentPositionChange').editable({
type : 'text', type : 'text',
title : '{intl l="Enter new content position"}', title : '{intl l="Enter new content position"}',
mode : 'popup', mode : 'popup',
@@ -599,7 +604,7 @@
placement : 'left', placement : 'left',
success : function(response, newValue) { success : function(response, newValue) {
// The URL template // The URL template
var url = "{url noamp='1' path='/admin/contents/update-position' content_id='__ID__' position='__POS__'}"; var url = "{url path='/admin/contents/update-position' content_id='__ID__' position='__POS__'}";
// Perform subtitutions // Perform subtitutions
url = url.replace('__ID__', $(this).data('id')) url = url.replace('__ID__', $(this).data('id'))