Merge branch 'master' into rewrite

Conflicts:
	core/lib/Thelia/Controller/BaseController.php
	install/insert.sql
This commit is contained in:
Etienne Roudeix
2013-09-04 10:06:22 +02:00
27 changed files with 472 additions and 112 deletions

View File

@@ -658,6 +658,7 @@ label {
font-weight: normal;
}
.form-horizontal input + .help-block,
.form-horizontal select + .help-block,
.form-horizontal textarea + .help-block,
@@ -665,9 +666,10 @@ label {
.form-horizontal .input-prepend + .help-block,
.form-horizontal .input-append + .help-block
.help-block, .form-horizontal .help-block {
margin-top: 0px;
margin-top: 5px;
}
// Fix for append-fields shorter than others
// see http://stackoverflow.com/questions/13306670/bootstrap-prepended-and-appended-input-how-to-max-input-field-width
.input-append.input-block-level,

View File

@@ -26,7 +26,7 @@
<div class="row-fluid">
<div class="span12">
<form action="{url path='/admin/configuration/currencies/change-values'}" method="post">
<form action="{url path='/admin/configuration/currencies/update-rates'}" method="post">
<div class="general-block-decorator">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
@@ -35,6 +35,7 @@
<a class="btn btn-primary action-btn" title="{intl l='Add a new currency'}" href="#add_currency_dialog" data-toggle="modal">
<i class="icon-plus-sign icon-white"></i>
</a>
<button class="btn btn-info action-btn" title="{intl l='Update rates'}">{intl l='Update rates'} <i class="icon icon-white icon-globe"></i></button>
{/loop}
</caption>
@@ -117,25 +118,24 @@
{loop name="currencies" type="currency" backend_context="1" lang=$lang_id order=$order}
<tr>
<td>{$ID}</td>
<td>{$ID}</td>
<td>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
<a title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/change' currency_id="$ID"}">{$NAME}</a>
{/loop}
{elseloop rel="can_change"}
{$NAME}
{/elseloop}
</td>
<td>
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
<a title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/change' currency_id="$ID"}">{$NAME}</a>
{/loop}
{elseloop rel="can_change"}
{$NAME}
{/elseloop}
</td>
<td class="text-center">{$ISOCODE}</td>
<td class="text-center">{$ISOCODE}</td>
<td class="text-center">{$SYMBOL}</td>
<td class="text-center">{$SYMBOL}</td>
<td class="text-right">{format_number number="$RATE" decimals="4"}</td>
<td class="text-right">{$RATE|string_format:"%.4f"}</td>
<td class="text-center">
<td class="text-center">
{admin_position_block
permission="admin.currencies.edit"
path="/admin/configuration/currencies"
@@ -144,9 +144,11 @@
position="$POSITION"
id="$ID"
}
</td>
</td>
<td class="text-center"><input type="radio" name="default[{$ID}]" value="1" {if $IS_DEFAULT}checked="checked"{/if}/></td>
<td class="text-center">
<input class="change-default" type="radio" name="is_default" value="{$ID}" {if $IS_DEFAULT}checked="checked"{/if}/>
</td>
{module_include location='currencies_table_row'}
@@ -208,7 +210,7 @@
<div class="modal-body">
{if #form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">#form_error_currency</div>{/if}
{if $form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">{$form_error_message}</div>{/if}
<div class="control-group">
@@ -246,7 +248,7 @@
</label>
<div class="controls">
{form_field form=$form field='symbol'}
{form_field form=$form field='code'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
</span>
@@ -278,11 +280,11 @@
</label>
<div class="controls">
{form_field form=$form field='symbol'}
{form_field form=$form field='rate'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
</span>
<div class="help-block">{intl l="Currency rate, in Euro"}</div>
<div class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</div>
{/form_field}
</div>
</div>
@@ -380,6 +382,18 @@
}
});
{* Change default status *}
$('.change-default').click(function(ev) {
var url = "{url path='/admin/configuration/currencies/set-default' currency_id='__ID__'}";
// Perform ID subtitutions
url = url.replace('__ID__', $(this).val());
// Reload the page
location.href = url;
});
});
</script>
{/block}

View File

@@ -0,0 +1,147 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit a currency'}{/block}
{block name="check-permissions"}admin.configuration.currencies.edit{/block}
{block name="main-content"}
<div class="currencies edit-currency">
<div id="wrapper" class="container">
{loop name="currency_edit" type="currency" id="$currency_id" backend_context="1" lang="$edit_language_id"}
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a> <span class="divider">/</span></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a> <span class="divider">/</span></li>
<li><a href="{url path='/admin/configuration/currencies'}">{intl l="Currencies"}</a> <span class="divider">/</span></li>
<li>{intl l='Editing currency "%name"' name="{$NAME}"}</li>
</ul>
<div class="row-fluid">
<div class="span12 general-block-decorator">
<div class="row-fluid">
<div class="span12 title title-without-tabs">
{intl l="Edit currency $NAME"}
</div>
<div class="form-container">
<div class="form-horizontal span12">
{form name="thelia.admin.currency.modification"}
<form method="POST" action="{url path='/admin/configuration/currencies/save-change'}" {form_enctype form=$form}>
<fieldset>
{* Be sure to get the currency ID, even if the form could not be validated *}
<input type="hidden" name="currency_id" value="{$currency_id}" />
{include file="includes/inner-form-toolbar.html"}
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies'}" />
{/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-block alert-error">{$form_error_message}</div>{/if}
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<label class="control-label">
{intl l='Name *'}
</label>
<div class="controls">
{form_field form=$form field='name'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency name'}" placeholder="{intl l='Currency name'}" class="input-medium">
</span>
{/form_field}
</div>
</div>
<div class="control-group">
<label class="control-label">
{intl l='ISO 4217 Code *'}
<span class="label-help-block"><a title="{intl l='More information about ISO 4217'}" href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">List of ISO 4217 code</a></span>
</label>
<div class="controls">
{form_field form=$form field='code'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency ISO 4217 Code'}" placeholder="{intl l='Code'}" class="input-mini">
</span>
{/form_field}
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label class="control-label">
{intl l='Symbol *'}
<span class="label-help-block">The symbol, sur as $, £, &euro;...</span>
</label>
<div class="controls">
{form_field form=$form field='symbol'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}" class="input-mini">
</span>
{/form_field}
</div>
</div>
<div class="control-group">
<label class="control-label">
{intl l='Rate from &euro; *'}
<span class="label-help-block">The rate from Euro</span>
</label>
<div class="controls">
{form_field form=$form field='rate'}
<span {if $error}class="error"{/if}>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Rate from Euro'}" placeholder="{intl l='Rate'}" class="input-mini">
</span>
{/form_field}
<span class="help-block">Price in Euro x rate = Price in this currency</span>
</div>
</div>
</div>
</div>
<div class="control-group">
<div class="controls">
<p>{intl l='Currency created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>
</fieldset>
</form>
{/form}
</div>
</div>
</div>
</div>
</div>
{/loop}
{elseloop rel="currency_edit"}
<div class="row-fluid">
<div class="span12">
<div class="alert alert-error">
{intl l="Sorry, currency ID=$currency_id was not found."}
</div>
</div>
</div>
{/elseloop}
</div>
</div>
{/block}

View File

@@ -123,7 +123,7 @@
<div class="control-group">
<lablel>&nbsp;</lablel>
<div class="controls">
<p>{intl l='Category created on %date_create. Last modification: %date_change' date_create=$CREATE_DATE->format($datetime_format) date_change=$UPDATE_DATE->format($datetime_format)}</p>
<p>{intl l='Category created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}}</p>
</div>
</div>
</div>

View File

@@ -144,7 +144,7 @@
<div class="control-group">
<div class="controls">
<p>{intl l='Message created on %date_create. Last modification: %date_change' df=$datetime_format date_create=$CREATE_DATE->format($datetime_format) date_change=$UPDATE_DATE->format($datetime_format)}</p>
<p>{intl l='Message created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}}</p>
</div>
</div>
</fieldset>

View File

@@ -108,7 +108,7 @@
<div class="control-group">
<div class="controls">
<p>{intl l='Variable created on %date_create. Last modification: %date_change' df=$datetime_format date_create=$CREATE_DATE->format($datetime_format) date_change=$UPDATE_DATE->format($datetime_format)}</p>
<p>{intl l='Variable created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>