finish language creation process

This commit is contained in:
Manuel Raynaud
2013-10-23 12:00:33 +02:00
parent f881edbaa6
commit 24b504ad3b
10 changed files with 117 additions and 82 deletions

View File

@@ -250,6 +250,17 @@
{block name="javascript-initialization"}{/block}
<script>
(function($) {
$(document).ready(function(){
var testModal = $(".modal-force-show");
if(testModal.length > 0) {
testModal.modal("show");
}
});
})(jQuery);
</script>
{* Modules scripts are included now *}
{module_include location='footer_js'}

View File

@@ -15,7 +15,7 @@ A generic modal creation dialog template. Parameters
ok_button_id (optionnal) = the id of the OK button
*}
<div class="modal fade" id="{$dialog_id}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal fade {if ! empty($form_error_message)}modal-force-show{/if}" id="{$dialog_id}" tabindex="-1" {if empty($form_error_message)}aria-hidden="true"{else}aria-hidden="false"{/if}>
<div class="modal-dialog">
<div class="modal-content">

View File

@@ -162,34 +162,43 @@
</div>
</div>
{form name="thelia.admin.language.creation"}
{form name="thelia.lang.create"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "creation_dialog"}
{form_hidden_fields form=$form}
{* Be sure to get the language_id, even if the form could not be validated *}
<input type="hidden" name="language_id" value="{$language_id}" />
{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/configuration/languages/update' language_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='Language title'}">
</div>
{/form_field}
{form_field form=$form field='isocode'}
{form_field form=$form field='code'}
<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='locale'}
<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='en_US'}">
</div>
{/form_field}
{form_field form=$form field='date_format'}
<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='d-m-Y'}">
</div>
{/form_field}
{form_field form=$form field='time_format'}
<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='H:i:s'}">
</div>
{/form_field}
{module_include location='language_create_form'}
@@ -204,7 +213,7 @@
dialog_ok_label = {intl l="Create this language"}
form_action = {url path='/admin/configuration/languages/create'}
form_action = {url path='/admin/configuration/languages/add'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}