PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/mod_translation/templates/_dialog_language_edit.tpl

http://github.com/zotonic/zotonic
Smarty Template | 67 lines | 61 code | 6 blank | 0 comment | 10 complexity | b5a9b0210829940de774f6cbf7d15394 MD5 | raw file
 1{#
 2Params:
 3code
 4lang
 5fallback
 6#}
 7<p>{_ Enter the iso code (for example <em>en</em> or <em>nl</em>), and the title of the language. Use the native form of the language, for example <em>English</em>, <em>Tßrkçe</em> or <em>Français</em>. _}</p>
 8
 9{% wire id=#form type="submit" postback={language_edit code=code} delegate="mod_translation" %}
10<form id="{{ #form }}" method="POST" action="postback" class="form-horizontal">
11    <div class="form-group row">
12	    <label class="control-label col-md-3" for="{{ #code }}">{_ ISO Code _}</label>
13        <div class="col-md-9">
14            <select class="form-control" name="code" id="{{ #code }}">
15                {% for iso,lang in m.translation.language_list_all %}
16                    <option value="{{ iso }}" {% if iso == code %}selected{% endif %}>
17                        {{iso}} ({{ lang.language }})
18                    </option>
19                {% endfor %}
20            </select>
21        </div>
22    </div>
23
24    <div class="form-group row">
25	    <label class="control-label col-md-3" for="{{ #language }}">{_ Language _}</label>
26        <div class="col-md-9">
27	        <input class="form-control" type="text" id="{{ #language }}" name="language" value="{{ lang.language }}" />
28	        {% validate id=#language name="language" type={presence} %}
29        </div>
30    </div>
31    
32    <div class="form-group row">
33        <div class="clearfix">{# clean wrap for hint #}
34            <label class="control-label col-md-3" for="{{ #fallback }}">{_ Fallback language _}</label>
35            <div class="col-md-9">
36                <select class="form-control" name="fallback" id="{{ #fallback }}">
37                    <option value="">{_ none _}</option>
38                    {% for iso,lang in m.translation.language_list_all %}
39                        <option value="{{ iso }}" {% if iso == fallback %}selected{% endif %}>
40                            {{iso}} ({{ lang.language }})
41                        </option>
42                    {% endfor %}
43                </select>
44            </div>
45        </div>
46        <div class="col-md-3"></div>
47        <div class="col-md-9">
48            <p class="help-block">{_ Use this with region-specific languages, for instance 'fr-be'. The fallback language is used to find missing translations in the 'parent' language instead of substituting with English. _}</p>
49        </div>
50    </div>
51    
52    <div class="form-group row">
53	    <label class="control-label col-md-3" for="{{ #enabled }}">{_ Show in menu _}</label>
54        <div class="col-md-9">
55            <div class="checkbox"><label>
56	                <input type="checkbox" id="{{ #enabled }}" name="is_enabled" value="1"
57	                    {% if new or lang.is_enabled %}checked="checked"{% endif %} />
58                </label></div>
59        </div>
60    </div>
61
62    <div class="modal-footer">
63        {% button class="btn btn-default" action={dialog_close} text=_"Cancel" tag="a" %}
64        <button class="btn btn-primary" type="submit">{_ Save _}</button>
65    </div>
66</form>
67