Merge branch 'master' into template

Conflicts:
	core/lib/Thelia/Core/Template/Loop/Feed.php
This commit is contained in:
Etienne Roudeix
2013-09-16 15:32:17 +02:00
64 changed files with 4342 additions and 424 deletions

View File

@@ -206,7 +206,6 @@
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>
<span class="pull-right">{intl l='interface par <a target="_blank" href="http://www.steaw-webdesign.com/">Steaw-Webdesign</a>'}</span>
</p>
{module_include location='in_footer'}

View File

@@ -1,15 +1,102 @@
<div class="form-group">
{ifloop rel="free_attributes"}
<select name="free_attributes" id="free_attributes" class="form-control">
<option value="">Select an attribute...</option>
{loop name="free_attributes" type="attribute" template="$template_id" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="help-block">{intl l='Select an attribute and click (+) to add it to this template'}</span>
<form action="{url path='/admin/configuration/templates/attributes/add'}">
<input type="hidden" name="template_id" value="{$template_id}" />
<div class="input-group">
<select required="required" name="attribute_id" id="attribute_id" class="form-control">
<option value="">Select an attribute...</option>
{loop name="free_attributes" type="attribute" exclude_template="$template_id" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select an attribute and click (+) to add it to this template'}</span>
</form>
{/ifloop}
{elseloop rel="free_attributes"}
<div class="alert alert-info">There is currently no available attributes.</div>
{/elseloop}
</div>
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Attribute title'}</th>
{module_include location='template_attributes_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_attributes" type="attribute" template="$template_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
{module_include location='template_attributes_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.template.attribute.delete"}
<a class="btn btn-default btn-xs delete-attribute" title="{intl l='Delete this attribute'}" href="#delete_attribute_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="assigned_attributes"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This template contains no attributes"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
{* Delete value confirmation dialog *}
{capture "delete_attribute_dialog"}
<input type="hidden" name="template_id" value="{$template_id}" />
<input type="hidden" name="attribute_id" id="attribute_delete_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_attribute_dialog"
dialog_title = {intl l="Remove attribute"}
dialog_message = {intl l="Do you really want to remove this attribute from the template ?"}
form_action = {url path='/admin/configuration/templates/attributes/delete'}
form_content = {$smarty.capture.delete_attribute_dialog nofilter}
}
<script>
$(function() {
// Set proper attribute ID in delete attribute from
$('a.delete-attribute').click(function(ev) {
$('#attribute_delete_id').val($(this).data('id'));
});
});
</script>

View File

@@ -0,0 +1,102 @@
<div class="form-group">
{ifloop rel="free_features"}
<form action="{url path='/admin/configuration/templates/features/add'}">
<input type="hidden" name="template_id" value="{$template_id}" />
<div class="input-group">
<select required="required" name="feature_id" id="feature_id" class="form-control">
<option value="">Select an feature...</option>
{loop name="free_features" type="feature" exclude_template="$template_id" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select an feature and click (+) to add it to this template'}</span>
</form>
{/ifloop}
{elseloop rel="free_features"}
<div class="alert alert-info">There is currently no available features.</div>
{/elseloop}
</div>
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Feature title'}</th>
{module_include location='template_features_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_features" type="feature" template="$template_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
{module_include location='template_features_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.template.feature.delete"}
<a class="btn btn-default btn-xs delete-feature" title="{intl l='Delete this feature'}" href="#delete_feature_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="assigned_features"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This template contains no features"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
{* Delete value confirmation dialog *}
{capture "delete_feature_dialog"}
<input type="hidden" name="template_id" value="{$template_id}" />
<input type="hidden" name="feature_id" id="feature_delete_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_feature_dialog"
dialog_title = {intl l="Remove feature"}
dialog_message = {intl l="Do you really want to remove this feature from the template ?"}
form_action = {url path='/admin/configuration/templates/features/delete'}
form_content = {$smarty.capture.delete_feature_dialog nofilter}
}
<script>
$(function() {
// Set proper feature ID in delete feature from
$('a.delete-feature').click(function(ev) {
$('#feature_delete_id').val($(this).data('id'));
});
});
</script>

View File

@@ -1,11 +1,26 @@
{* this temlate is loaded via Ajax in the login page, to prevent login page slowdown *}
{loop type="feed" name="thelia_feeds" url="http://thelia.net/Flux-rss.html?id_rubrique=8" limit="3"}
<div class="span4 feed-list-item">
<h3>{$DATE}</h3>
<h2><a href="{$URL}" target="_blank" title="{intl l='Lire la suite'}">{$TITLE|strip_tags nofilter}</a></h2>
{* we use unescape:"htmlall" to unescape var before truncate, to prevent a cut in the middel of an HTML entity, eg &ea... *}
<p>{$DESCRIPTION|strip_tags|unescape:"htmlall"|truncate:250:"...":true nofilter}</p>
<p><a class="btn" href="{$URL}" target="_blank">{intl l='Lire la suite »'}</a></p>
</div>
{/loop}
<div class="panel-group" id="accordion">
{loop type="feed" name="thelia_feeds" url="http://thelia.net/Flux-rss.html?id_rubrique=8" limit="3"}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapse-{$LOOP_COUNT}">
{$TITLE|strip_tags nofilter} - {$DATE}
</a>
</h3>
</div>
<div id="collapse-{$LOOP_COUNT}" class="panel-collapse collapse {if $LOOP_COUNT == 1}in{/if}">
<div class="panel-body">
{* we use unescape:"htmlall" to unescape var before truncate, to prevent a cut in the middel of an HTML entity, eg &ea... *}
<p>{$DESCRIPTION|strip_tags|unescape:"htmlall"|truncate:250:"...":true nofilter}</p>
</div>
<div class="panel-footer">
<a href="{$URL}" target="_blank" class="btn btn-defaut btn-primary"><span class="glyphicon glyphicon-book"></span> {intl l='Lire la suite'}</a>
</div>
</div>
</div>
{/loop}
</div>

View File

@@ -0,0 +1,220 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Countries'}{/block}
{block name="check-permissions"}admin.configuration.countries.view{/block}
{block name="main-content"}
<div class="countries">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/countries'}">{intl l="Countries"}</a></li>
</ul>
{module_include location='countries_top'}
<div class="row">
<div class="col-md-12">
<form action="" method="post">
<div class="general-block-decorator">
<table class="table table-striped table-condensed">
<caption class="clearfix">
{intl l='Countries'}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.countries.create"}
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new country'}" href="#add_country_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Default</th>
<th>Shop</th>
<th>N° ISO</th>
<th>ISO Code</th>
{module_include location='countries_table_header'}
<th class="actions">{intl l='Actions'}</th>
</tr>
</thead>
<tbody>
{loop name="countries" type="country" backend_context="1" lang=$lang_id order=$order}
<tr>
<td>{$ID}</td>
<td>{$TITLE}</td>
<td>
<div class="make-switch switch-small switch-radio" 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 class="change-default" type="radio" name="" value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}/>
</div>
</td>
<td>
<div class="make-switch switch-small switch-radio" 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 class="change-default" type="radio" name="" value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}/>
</div>
</td>
<td>{$ISOCODE}</td>
<td>{$ISOALPHA3}</td>
{module_include location='countries_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.countries.change"}
<a class="btn btn-default btn-xs country-change" title="{intl l='Change this country'}" href="{url path="/admin/configuration/countries/update/{$ID}"}">
<span class="glyphicon glyphicon-edit"></span>
</a>
{/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.countries.delete"}
<a class="btn btn-default btn-xs country-delete" title="{intl l='Delete this country'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="countries"}
<tr>
<td colspan="8">
<div class="alert alert-info">
{intl l="No country has been created yet. Click the + button to create one."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</form>
</div>
</div>
{module_include location='countries_bottom'}
</div>
</div>
{* Adding a new Country *}
{form name="thelia.admin.country.creation"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "country_creation_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
{* 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/country/update' country_id='_ID_'}" />
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Country title'}">
</div>
{/form_field}
{form_field form=$form field='area'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
<option value="{$ID}">{$TITLE}</option>
</select>
</div>
{/form_field}
{form_field form=$form field='isocode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='ISO Code'}">
</div>
{/form_field}
{form_field form=$form field='isoalpha2'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Alpha code 2'}">
</div>
{/form_field}
{form_field form=$form field='isoalpha3'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Alpha code 3'}">
</div>
{/form_field}
{module_include location='country_create_form'}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "add_country_dialog"
dialog_title = {intl l="Create a new country"}
dialog_body = {$smarty.capture.country_creation_dialog nofilter}
dialog_ok_label = {intl l="Create this country"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/configuration/countries/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* Delete confirmation dialog *}
{capture "delete_dialog"}
<input type="hidden" name="country_id" id="country_delete_id" value="" />
{module_include location='country_delete_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_dialog"
dialog_title = {intl l="Delete country"}
dialog_message = {intl l="Do you really want to delete this country ?"}
form_action = {url path='/admin/configuration/countries/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
<script src="{$asset_url}"></script>
<script>
// Toogle switch on input radio
$('.switch-radio').on('switch-change', function () {
$('.switch-radio').bootstrapSwitch('toggleRadioState');
});
</script>
{/javascripts}
{/block}

View File

@@ -0,0 +1,147 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit a country'}{/block}
{block name="check-permissions"}admin.configuration.countries.edit{/block}
{block name="main-content"}
<div class="countries edit-country">
<div id="wrapper" class="container">
{loop name="country_edit" type="country" id="$country_id" backend_context="1" lang="$edit_language_id"}
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/countries'}">{intl l="Countries"}</a></li>
<li>{intl l='Editing country "%name"' name="{$TITLE}"}</li>
</ul>
<div class="row">
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-12 title title-without-tabs">
{intl l="Edit country $TITLE"}
</div>
<div class="form-container">
<div class="col-md-12">
{form name="thelia.admin.country.modification"}
<form method="POST" action="{url path='/admin/configuration/countries/save'}" {form_enctype form=$form} class="clearfix">
<div class="row">
<div class="col-md-12">
{* Be sure to get the country ID, even if the form could not be validated *}
<input type="hidden" name="country_id" value="{$country_id}" />
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/countries'}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field form=$form field='area'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
<option value="{$ID}">{$TITLE}</option>
</select>
</div>
{/form_field}
{form_field form=$form field='isocode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='ISO Code'}">
</div>
{/form_field}
{form_field form=$form field='isoalpha2'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Alpha code 2'}">
</div>
{/form_field}
{form_field form=$form field='isoalpha3'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Alpha code 3'}">
</div>
{/form_field}
</div>
<div class="col-md-12 title title-without-tabs">
{intl l="Translations"}
</div>
{loop type="lang" name="lang"}
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}"> {$TITLE}
</h3>
</div>
<div class="panel-body">
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Country title'}">
</div>
{/form_field}
{form_field form=$form field='short-description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Country short description'}"></textarea>
</div>
{/form_field}
{form_field form=$form field='description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Country description'}"></textarea>
</div>
{/form_field}
</div>
</div>
</div>
{/loop}
<div class="col-md-12 text-right">
<button type="submit" class="btn btn-default btn-primary" title="{intl l='Add a new country'}">
{intl l="Save"}
<span class="glyphicon glyphicon-ok"></span>
</button>
</div>
</div>
</form>
{/form}
</div>
</div>
</div>
</div>
</div>
{/loop}
{elseloop rel="country_edit"}
<div class="row">
<div class="col-md-12">
<div class="alert alert-error">
{intl l="Sorry, country ID=$country_id was not found."}
</div>
</div>
</div>
{/elseloop}
</div>
</div>
{/block}

View File

@@ -0,0 +1,316 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit an feature'}{/block}
{block name="check-permissions"}admin.configuration.features.edit{/block}
{block name="main-content"}
<div class="features edit-feature">
<div id="wrapper" class="container">
{loop name="feature_edit" type="feature" id=$feature_id backend_context="1" lang=$edit_language_id}
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/features'}">{intl l="Features"}</a></li>
<li>{intl l='Editing feature "%name"' name="{$TITLE}"}</li>
</ul>
<div class="row">
<div class="col-md-12 general-block-decorator">
<div class="row">
<div class="col-md-12 title title-without-tabs">
{intl l="Edit feature $TITLE"}
</div>
<div class="col-md-12">
<div class="form-container">
{form name="thelia.admin.feature.modification"}
<form method="POST" action="{url path='/admin/configuration/features/save'}" {form_enctype form=$form} class="clearfix">
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/configuration/features'}"}
<div class="col-md-6">
<p class="title title-without-tabs">{intl l='Feature information'}</p>
{form_field form=$form field='id'}
<input type="hidden" name="{$name}" value="{$feature_id}" />
{/form_field}
{* Be sure to get the feature ID, even if the form could not be validated *}
<input type="hidden" name="feature_id" value="{$feature_id}" />
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/features'}" />
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{include file="includes/standard-description-form-fields.html" form=$form}
</div>
<div class="col-md-6">
<p class="title title-without-tabs">
{intl l='Feature values'}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.feature-av.create"}
<span class="pull-right">
<a data-toggle="modal" href="#creation_dialog" title="Add a new feature value" class="btn btn-default btn-primary">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
</span>
{/loop}
</p>
<div class="alert alert-info">
{intl l="Enter here all possible feature values."}
</div>
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>
{admin_sortable_header
current_order=$featureav_order
order='id'
reverse_order='id_reverse'
request_parameter_name='featureav_order'
path={url path='/admin/configuration/features/update' feature_id=$feature_id}
label="{intl l='ID'}"
}
</th>
<th>
{admin_sortable_header
current_order=$featureav_order
order='alpha'
reverse_order='alpha_reverse'
request_parameter_name='featureav_order'
path={url path='/admin/configuration/features/update' feature_id=$feature_id}
label="{intl l='Value'}"
}
</th>
<th class="text-center">
{admin_sortable_header
current_order=$featureav_order
order='manual'
reverse_order='manual_reverse'
request_parameter_name='featureav_order'
path={url path='/admin/configuration/features/update' feature_id=$feature_id}
label="{intl l="Position"}"
}
</th>
{module_include location='features_value_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="list" type="feature_availability" feature=$feature_id backend_context="1" lang=$edit_language_id order=$featureav_order}
<tr>
<td>{$ID}</td>
<td>
{* FIXME : integrate this in the encolsing form to provide standard form processing *}
<input class="js-edit form-control" type="text" name="feature_values[{$ID}]" value="{$TITLE}" />
</td>
<td class="text-center">
{admin_position_block
permission="admin.features.edit"
path={url path='/admin/configuration/features-av/update-position' feature_id=$feature_id}
url_parameter="featureav_id"
in_place_edit_class="positionChange"
position="$POSITION"
id="$ID"
}
</td>
{module_include location='features_value_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.feature-av.delete"}
<a class="btn btn-default btn-xs value-delete" title="{intl l='Delete this value'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="list"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="No value has been created yet. Click the + button to create one."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</form>
{/form}
</div>
</div>
</div>
</div>
</div>
{/loop}
{elseloop rel="feature_edit"}
<div class="row">
<div class="col-md-12">
<div class="alert alert-error">
{intl l="Sorry, feature ID=$feature_id was not found."}
</div>
</div>
</div>
{/elseloop}
</div>
</div>
{* Adding a new feature *}
{form name="thelia.admin.featureav.creation"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "creation_dialog"}
{form_hidden_fields form=$form}
{* Be sure to get the feature ID, even if the form could not be validated *}
<input type="hidden" name="feature_id" value="{$feature_id}" />
{form_field form=$form field='success_url'}
{* on success, redirect to this page *}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/features/update' feature_id=$feature_id}" />
{/form_field}
{form_field form=$form field='feature_id'}
<input type="hidden" name="{$name}" value="{$feature_id}" />
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
{loop type="lang" name="current-edit-lang" id="$edit_language_id"}
<div class="input-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Feature title'}" placeholder="{intl l='Title'}">
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
</div>
<div class="help-block">{intl l="Enter here the value in the current edit language ($TITLE)"}</div>
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$LOCALE}" />
{/form_field}
{/loop}
</div>
{/form_field}
{module_include location='feature_value_create_form'}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "creation_dialog"
dialog_title = {intl l="Create a new feature value"}
dialog_body = {$smarty.capture.creation_dialog nofilter}
dialog_ok_label = {intl l="Create this value"}
form_action = {url path='/admin/configuration/features-av/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* Delete value confirmation dialog *}
{capture "delete_dialog"}
<input type="hidden" name="feature_id" value="{$feature_id}" />
<input type="hidden" name="featureav_id" id="value_delete_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_dialog"
dialog_title = {intl l="Delete feature value"}
dialog_message = {intl l="Do you really want to delete this feature value ?"}
form_action = {url path='/admin/configuration/features-av/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(function() {
// Set proper feature ID in delete from
$('a.value-delete').click(function(ev) {
$('#value_delete_id').val($(this).data('id'));
});
// JS stuff for creation form
{include
file = "includes/generic-js-dialog.html"
dialog_id = "creation_dialog"
form_name = "thelia.admin.featureav.creation"
}
{* Inline editing of object position using bootstrap-editable *}
$('.positionChange').editable({
type : 'text',
title : '{intl l="Enter new value position"}',
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url path='/admin/configuration/features-av/update-position' featureav_id='__ID__' position='__POS__' feature_id=$feature_id}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
});
</script>
{/block}

View File

@@ -0,0 +1,326 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Thelia Product Features'}{/block}
{block name="check-permissions"}admin.configuration.features.view{/block}
{block name="main-content"}
<div class="features">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/features'}">{intl l="Product features"}</a></li>
</ul>
{module_include location='features_top'}
<div class="row">
<div class="col-md-12">
<form action="#" method="post">
<div class="general-block-decorator">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Thelia product features'}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.features.create"}
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new product feature'}" href="#creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th>
{admin_sortable_header
current_order=$order
order='id'
reverse_order='id_reverse'
path='/admin/configuration/features'
label="{intl l='ID'}"
}
</th>
<th>
{admin_sortable_header
current_order=$order
order='alpha'
reverse_order='alpha_reverse'
path='/admin/configuration/features'
label="{intl l='Title'}"
}
</th>
<th class="text-center">
{admin_sortable_header
current_order=$order
order='manual'
reverse_order='manual_reverse'
path='/admin/configuration/features'
label="{intl l="Position"}"
}
</th>
{module_include location='features_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="list" type="feature" backend_context="1" lang=$lang_id order=$order}
<tr>
<td>{$ID}</td>
<td>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.features.change"}
<a title="{intl l='Change this feature'}" href="{url path='/admin/configuration/features/update' feature_id=$ID}">{$TITLE}</a>
{/loop}
{elseloop rel="can_change"}
{$TITLE}
{/elseloop}
</td>
<td class="text-center">
{admin_position_block
permission="admin.features.edit"
path="/admin/configuration/features/update-position"
url_parameter="feature_id"
in_place_edit_class="positionChange"
position="$POSITION"
id="$ID"
}
</td>
{module_include location='features_table_row'}
<td class="actions">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.features.change"}
<div class="btn-group">
<a class="btn btn-default btn-xs feature-remove-from-all" title="{intl l='Remove this feature from all product templates'}" href="#remove_from_all_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-minus"></span>
</a>
<a class="btn btn-default btn-xs feature-add-to-all" title="{intl l='Add this feature to all product templates'}" href="#add_to_all_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
{/loop}
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.features.change"}
<a class="btn btn-default btn-xs feature-change" title="{intl l='Change this product feature'}" href="{url path='/admin/configuration/features/update' feature_id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.features.delete"}
<a class="btn btn-default btn-xs feature-delete" title="{intl l='Delete this product feature'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="list"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="No product feature has been created yet. Click the + button to create one."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</form>
</div>
</div>
{module_include location='features_bottom'}
</div>
</div>
{* Adding a new feature *}
{form name="thelia.admin.feature.creation"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "creation_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
{* on success, redirect to the edition page, _ID_ is replaced with the created feature ID, see controller *}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/features/update' feature_id='_ID_'}" />
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
{loop type="lang" name="default-lang" default_only="1"}
<div class="input-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Feature title'}" placeholder="{intl l='Title'}">
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
</div>
<div class="help-block">{intl l="Enter here the feature name in the default language ($TITLE)"}</div>
{* Switch edition to the current locale *}
<input type="hidden" name="edit_language_id" value="{$ID}" />
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$LOCALE}" />
{/form_field}
{/loop}
</div>
{/form_field}
{form_field form=$form field='add_to_all'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
<input type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
<span class="help-block">{intl l='Check this box if you want to add this features to all product templates'}</span>
</div>
</div>
{/form_field}
{module_include location='feature_create_form'}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "creation_dialog"
dialog_title = {intl l="Create a new feature"}
dialog_body = {$smarty.capture.creation_dialog nofilter}
dialog_ok_label = {intl l="Create this feature"}
form_action = {url path='/admin/configuration/features/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* Delete confirmation dialog *}
{capture "delete_dialog"}
<input type="hidden" name="feature_id" id="feature_delete_id" value="" />
{module_include location='feature_delete_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_dialog"
dialog_title = {intl l="Delete feature"}
dialog_message = {intl l="Do you really want to delete this feature ? It will be removed from all product templates."}
form_action = {url path='/admin/configuration/features/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
}
{* Add to all dialog *}
{capture "add_to_all_dialog"}
<input type="hidden" name="feature_id" id="feature_add_to_all_id" value="" />
{module_include location='feature_add_to_all_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "add_to_all_dialog"
dialog_title = {intl l="Add to all product templates"}
dialog_message = {intl l="Do you really want to add this feature to all product templates ?"}
form_action = {url path='/admin/configuration/features/add-to-all-templates'}
form_content = {$smarty.capture.add_to_all_dialog nofilter}
}
{* Remove from all dialog *}
{capture "remove_from_all_dialog"}
<input type="hidden" name="feature_id" id="feature_remove_from_all_id" value="" />
{module_include location='feature_add_to_all_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "remove_from_all_dialog"
dialog_title = {intl l="Remove from all product templates"}
dialog_message = {intl l="Do you really want to remove this feature from all product templates ? You'll loose all product related data for this feature."}
form_action = {url path='/admin/configuration/features/remove-from-all-templates'}
form_content = {$smarty.capture.remove_from_all_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(function() {
// Set proper feature ID in delete from
$('a.feature-delete').click(function(ev) {
$('#feature_delete_id').val($(this).data('id'));
});
$('a.feature-add-to-all').click(function(ev) {
$('#feature_add_to_all_id').val($(this).data('id'));
});
$('a.feature-remove-from-all').click(function(ev) {
$('#feature_remove_from_all_id').val($(this).data('id'));
});
// JS stuff for creation form
{include
file = "includes/generic-js-dialog.html"
dialog_id = "creation_dialog"
form_name = "thelia.admin.feature.creation"
}
{* Inline editing of object position using bootstrap-editable *}
$('.positionChange').editable({
type : 'text',
title : '{intl l="Enter new feature position"}',
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url path='/admin/configuration/features/update-position' feature_id='__ID__' position='__POS__'}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id'))
.replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
});
</script>
{/block}

View File

@@ -10,11 +10,13 @@
<div class="row">
<div class="col-md-12">
<h1>{intl l="Oops! An Error Occurred"}</h1>
<div class="general-block-decorator text-center">
<h1>{intl l="Oops! An Error Occurred"}</h1>
{block name="error-message"}<div class="alert alert-error">{$error_message}</div>{/block}
<p><i class="glyphicon glyphicon-backward"></i> <a href="{url path='/admin/home'}">{intl l="Go to administration home"}</a></p>
{block name="error-message"}<div class="alert alert-danger">{$error_message}</div>{/block}
<a href="{url path='/admin/home'}" class="btn btn-default btn-info btn-lg"><span class="glyphicon glyphicon-home"></span> {intl l="Go to administration home"}</a>
</div>
</div>
</div>

View File

@@ -6,52 +6,74 @@
{block name="page-title"}{intl l='Welcome'}{/block}
{block name="main-content"}
<div class="loginpage">
<div class="loginpage">
<div id="wrapper" class="container">
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator clearfix">
<h1 class="title title-without-tabs">{intl l='Thelia Back Office'}</h1>
<div id="wrapper" class="container">
<div class="col-md-6">
{module_include location='index_top'}
{form name="thelia.admin.login"}
<form action="{url path='/admin/checklogin'}" method="post" {form_enctype form=$form}>
{module_include location='index_top'}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="jumbotron">
<h1>{intl l='Thelia Back Office'}</h1>
<fieldset>
<legend>{intl l='Login'}</legend>
{form_hidden_fields form=$form}
{form name="thelia.admin.login"}
<form action="{url path='/admin/checklogin'}" method="post" class="well form-inline" {form_enctype form=$form}>
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
{/form_field}
{form_field form=$form field='username'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Username'}" autofocus>
</div>
</div>
{/form_field}
{form_field form=$form field='password'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input type="password" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Password'}">
</div>
</div>
{/form_field}
{if $form_error}<div class="alert alert-error">{$form_error_message}</div>{/if}
{form_field form=$form field='remember_me'}
<div class="checkbox">
<label for="{$label_attr.for}">
<input type="checkbox" name="{$name}" id="{$label_attr.for}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {intl l="{$label}"}
</label>
</div>
{/form_field}
{form_hidden_fields form=$form}
<button type="submit" class="btn btn-default btn-primary pull-right"><span class="glyphicon glyphicon-off"></span> {intl l='Login'}</button>
</fieldset>
</form>
{/form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
{/form_field}
{module_include location='index_middle'}
</div>
{form_field form=$form field='username'}
<span {if $error}class="error"{/if}>
<input type="text" id="username" class="input" placeholder="{intl l='User name'}" name="{$name}" value="{$value}" {$attr} />
</span>
{/form_field}
{form_field form=$form field='password'}
<span {if $error}class="error"{/if}>
<input type="password" id="password" class="input" placeholder="{intl l='Password'}" name="{$name}" {$attr} />
</span>
{/form_field}
{form_field form=$form field='remember_me'}
<label class="checkbox"> <input type="checkbox" name="{$name}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {intl l='Remember me'}</label>
{/form_field}
<span class="pull-right"><button type="submit" class="btn btn-default btn-primary">{intl l='Login'} <span class="glyphicon glyphicon-play"></span></button></span>
</form>
{/form}
</div>
{module_include location='index_middle'}
<div class="row feed-list">
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-info">{intl l="Loading Thelia lastest news..."}</div>
<div class="col-md-6">
<div class="row feed-list">
<div class="col-md-6 col-md-offset-3">
<div class="alert alert-info">{intl l="Loading Thelia lastest news..."}</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -59,6 +81,7 @@
{module_include location='index_bottom'}
</div>
</div>
{/block}
{block name="javascript-initialization"}

View File

@@ -108,8 +108,8 @@
<script>
$(function() {
$('#attribute_list_management').load("{admin_viewurl view='ajax/template-attribute-list' template_id=$template_id}");
$('#feature_list_management').load("{admin_viewurl view='ajax/template-feature-list' template_id=$template_id}");
$('#feature_list_management').load("{url path='/admin/configuration/templates/features/list' template_id=$template_id}");
$('#attribute_list_management').load("{url path='/admin/configuration/templates/attributes/list' template_id=$template_id}");
});
</script>
{/block}