Fixes in webmodel
This commit is contained in:
parent
121cf3a243
commit
af8da27fff
4 changed files with 7 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
${add_js_home_local('tools.js', 'admin')}
|
${add_js_home_local('tools.js', 'admin')}
|
||||||
<div id="languages_form">
|
<div id="languages_form">
|
||||||
${form.show()}
|
${form.form()|n}
|
||||||
<%def name="select_lang(i18n, lang_selected)">
|
<%def name="select_lang(i18n, lang_selected)">
|
||||||
% if i18n==lang_selected:
|
% if i18n==lang_selected:
|
||||||
choose_flag
|
choose_flag
|
||||||
|
|
@ -10,7 +10,7 @@ ${form.show()}
|
||||||
</%def>
|
</%def>
|
||||||
% if lang_selected!=None:
|
% if lang_selected!=None:
|
||||||
% for i18n in arr_i18n:
|
% for i18n in arr_i18n:
|
||||||
<a class="${select_lang(i18n, lang_selected)} lang_form" href="#"><img src="${make_media_url_module('images/languages/'+i18n+'.png', 'admin')}" alt="${i18n}"/></a>
|
<a class="${select_lang(i18n, lang_selected)} lang_form" href="#"><img src="${make_media_url_module('images/languages/'+i18n+'.png', 'admin')}" alt="${name_form}_${i18n}"/></a>
|
||||||
% endfor
|
% endfor
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from paramecio.cromosoma.webmodel import PhangoField
|
from paramecio.cromosoma.webmodel import PhangoField
|
||||||
from paramecio.cromosoma.coreforms import TextForm
|
from paramecio.cromosoma.coreforms import BaseForm
|
||||||
from paramecio.cromosoma.extraforms.i18nform import I18nForm
|
from paramecio.cromosoma.extraforms.i18nform import I18nForm
|
||||||
from paramecio.citoplasma.i18n import I18n
|
from paramecio.citoplasma.i18n import I18n
|
||||||
from paramecio.citoplasma.httputils import GetPostFiles
|
from paramecio.citoplasma.httputils import GetPostFiles
|
||||||
|
|
@ -14,7 +14,7 @@ class I18nField(PhangoField):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
|
|
||||||
self.name_form=I18nForm
|
self.name_form=I18nForm
|
||||||
self.parameters=[TextForm(name, '')]
|
self.extra_parameters=[BaseForm(name, '')]
|
||||||
|
|
||||||
def check(self, value):
|
def check(self, value):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ class I18nForm(BaseForm):
|
||||||
|
|
||||||
self.form_child=form
|
self.form_child=form
|
||||||
|
|
||||||
def form():
|
def form(self):
|
||||||
|
print(self.name)
|
||||||
return standard_t.load_template('forms/i18nform.phtml', form=self.form_child)
|
return standard_t.load_template('forms/i18nform.phtml', name_form=self.name, form=self.form_child, arr_i18n=I18n.dict_i18n, lang_selected=I18n.default_lang)
|
||||||
|
|
@ -854,9 +854,6 @@ class PhangoField:
|
||||||
|
|
||||||
self.txt_error=""
|
self.txt_error=""
|
||||||
|
|
||||||
# Array for create initial parameters for form..
|
|
||||||
self.parameters=[]
|
|
||||||
|
|
||||||
# Themodel where this component or field live
|
# Themodel where this component or field live
|
||||||
|
|
||||||
self.model=None
|
self.model=None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue