Merge branch 'master' of github.com:thelia/thelia

This commit is contained in:
Manuel Raynaud
2013-09-05 17:43:32 +02:00
5 changed files with 70 additions and 44 deletions

View File

@@ -40,11 +40,47 @@ class CurrencyCreationForm extends BaseForm
} }
$this->formBuilder $this->formBuilder
->add("name" , "text" , array("constraints" => array(new NotBlank()))) ->add("name" , "text" , array(
->add("locale" , "text" , array("constraints" => array(new NotBlank()))) "constraints" => array(
->add("symbol" , "text" , array("constraints" => array(new NotBlank()))) new NotBlank()
->add("rate" , "text" , array("constraints" => array(new NotBlank()))) ),
->add("code" , "text" , array("constraints" => $code_constraints)) "label" => "Name *",
"label_attr" => array(
"for" => "name"
))
)
->add("locale" , "text" , array(
"constraints" => array(
new NotBlank()
))
)
->add("symbol" , "text" , array(
"constraints" => array(
new NotBlank()
),
"label" => "Symbol *",
"label_attr" => array(
"for" => "symbol"
))
)
->add("rate" , "text" , array(
"constraints" => array(
new NotBlank()
),
"label" => "Rate from € *",
"label_attr" => array(
"for" => "rate"
))
)
->add("code" , "text" , array(
"constraints" => array(
new NotBlank()
),
"label" => "ISO 4217 code *",
"label_attr" => array(
"for" => "iso_4217_code"
))
)
; ;
} }

View File

@@ -210,9 +210,7 @@
{block name="before-javascript-include"}{/block} {block name="before-javascript-include"}{/block}
{javascripts file='assets/js/jquery.min.js'} <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="{$asset_url}"></script>
{/javascripts}
{block name="after-javascript-include"}{/block} {block name="after-javascript-include"}{/block}

View File

@@ -4,12 +4,6 @@
{block name="check-permissions"}admin.catalog.view{/block} {block name="check-permissions"}admin.catalog.view{/block}
{block name="after-admin-css"}
{stylesheets file='assets/bootstrap-editable/css/bootstrap-editable.css' filters='cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{/block}
{block name="main-content"} {block name="main-content"}
<div class="catalog"> <div class="catalog">
<div id="wrapper" class="container"> <div id="wrapper" class="container">
@@ -278,13 +272,11 @@
{include file="includes/delete-category-dialog.html"} {include file="includes/delete-category-dialog.html"}
{/block} {/block}
{block name="after-javascript-include"} {block name="javascript-initialization"}
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script> <script src="{$asset_url}"></script>
{/javascripts} {/javascripts}
{/block}
{block name="javascript-initialization"}
<script> <script>
$(function() { $(function() {

View File

@@ -225,23 +225,23 @@
{form_field form=$form field='name'} {form_field form=$form field='name'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label>{intl l='Name *'}</label> <label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
{loop type="lang" name="default-lang" default_only="1"} {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='Currency name'}" placeholder="{intl l='Name'}">
<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 currency name in the default language ($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}
<div class="input-group">
<input type="text" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
<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 currency name in the default language ($TITLE)"}</div>
{/loop} {/loop}
</div> </div>
@@ -249,23 +249,23 @@
{form_field form=$form field='code'} {form_field form=$form field='code'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label class="control-label">{intl l='ISO 4217 code *'}</label> <label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
<span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span> <span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span>
</div> </div>
{/form_field} {/form_field}
{form_field form=$form field='symbol'} {form_field form=$form field='symbol'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label class="control-label">{intl l='Symbol *'}</label> <label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
</div> </div>
{/form_field} {/form_field}
{form_field form=$form field='rate'} {form_field form=$form field='rate'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label class="control-label">{intl l='Rate *'}</label> <label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
<span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span> <span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span>
</div> </div>
{/form_field} {/form_field}

View File

@@ -47,26 +47,26 @@
<input type="hidden" name="{$name}" value="{$edit_language_locale}" /> <input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field} {/form_field}
{if $form_error}<div class="alert alert-block alert-error">{$form_error_message}</div>{/if} {if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="col-md-6"> <div class="col-md-6">
{form_field form=$form field='name'} {form_field form=$form field='name'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label>{intl l='Name *'}</label> <label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency name'}" placeholder="{intl l='Currency name'}" class="form-control"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency name'}" placeholder="{intl l='Currency name'}" class="form-control">
</div> </div>
{/form_field} {/form_field}
{form_field form=$form field='code'} {form_field form=$form field='code'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label> <label for="{$label_attr.for}" class="control-label">
{intl l='ISO 4217 Code *'} {intl l="{$label}"} :
<span class="label-help-block"> <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> <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> </span>
</label> </label>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency ISO 4217 Code'}" placeholder="{intl l='Code'}" class="form-control"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency ISO 4217 Code'}" placeholder="{intl l='Code'}" class="form-control">
</div> </div>
{/form_field} {/form_field}
@@ -76,21 +76,21 @@
{form_field form=$form field='symbol'} {form_field form=$form field='symbol'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label> <label for="{$label_attr.for}" class="control-label">
{intl l='Symbol *'} {intl l="{$label}"} :
<span class="label-help-block">The symbol, sur as $, £, &euro;...</span> <span class="label-help-block">The symbol, sur as $, £, &euro;...</span>
</label> </label>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}" class="form-control"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}" class="form-control">
</div> </div>
{/form_field} {/form_field}
{form_field form=$form field='rate'} {form_field form=$form field='rate'}
<div class="form-group {if $error}has-error{/if}"> <div class="form-group {if $error}has-error{/if}">
<label> <label for="{$label_attr.for}" class="control-label">
{intl l='Rate from &euro; *'} {intl l="{$label}"} :
<span class="label-help-block">The rate from Euro</span> <span class="label-help-block">The rate from Euro</span>
</label> </label>
<input type="text" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Rate from Euro'}" placeholder="{intl l='Rate'}" class="form-control"> <input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value|htmlspecialchars}" title="{intl l='Rate from Euro'}" placeholder="{intl l='Rate'}" class="form-control">
<span class="help-block">Price in Euro x rate = Price in this currency</span> <span class="help-block">Price in Euro x rate = Price in this currency</span>
</div> </div>
{/form_field} {/form_field}