Fixes in admin
This commit is contained in:
parent
b0881e7267
commit
e10b5295bd
6 changed files with 39 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
from paramecio2.libraries.db.corefields import PhangoField
|
from paramecio2.libraries.db.corefields import PhangoField
|
||||||
from paramecio2.libraries.db.coreforms import PasswordForm
|
from paramecio2.libraries.db.coreforms import PasswordForm
|
||||||
from hmac import compare_digest as compare_hash
|
from hmac import compare_digest as compare_hash
|
||||||
import crypt
|
#import crypt
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class UserNameField(PhangoField):
|
class UserNameField(PhangoField):
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,35 @@ class I18n:
|
||||||
#@staticmethod
|
#@staticmethod
|
||||||
#def set_lang(code_lang):
|
#def set_lang(code_lang):
|
||||||
# if default_lang
|
# if default_lang
|
||||||
|
def __init__(self, module):
|
||||||
|
|
||||||
|
self.module=module
|
||||||
|
|
||||||
|
def slang(self, symbol, text_default, lang=None):
|
||||||
|
"""Method for get a string from selected language but object oriented
|
||||||
|
|
||||||
|
Method for get a string from selected language but object oriented
|
||||||
|
|
||||||
|
Args:
|
||||||
|
symbol (str): The symbol used for identify the text string.
|
||||||
|
text_default (str): The text default used. You have use how base for translations.
|
||||||
|
"""
|
||||||
|
return I18n.lang(self.module, symbol, text_default)
|
||||||
|
|
||||||
|
def tlang(self, text_default, lang=None):
|
||||||
|
"""Method for get a string from selected language but object oriented and using module and symbol by default
|
||||||
|
|
||||||
|
Method for get a string from selected language but object oriented and using module and symbol by default
|
||||||
|
|
||||||
|
Args:
|
||||||
|
symbol (str): The symbol used for identify the text string.
|
||||||
|
text_default (str): The text default used. You have use how base for translations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
symbol=text_default[:60]
|
||||||
|
|
||||||
|
return I18n.lang(self.module, symbol, text_default)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_default_lang():
|
def get_default_lang():
|
||||||
|
|
|
||||||
|
|
@ -157,8 +157,12 @@ class PTemplate:
|
||||||
#print(path.basename(module_env)+' '+base_name+'/languages/')
|
#print(path.basename(module_env)+' '+base_name+'/languages/')
|
||||||
|
|
||||||
self.l=PGetText(module_env+'/app.py')
|
self.l=PGetText(module_env+'/app.py')
|
||||||
|
|
||||||
|
self.i18n=I18n(module_env)
|
||||||
|
|
||||||
self.add_filter(self._)
|
self.add_filter(self._)
|
||||||
|
|
||||||
|
self.add_filter(self.i18n.tlang)
|
||||||
|
|
||||||
def _(self, text):
|
def _(self, text):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,7 @@ try:
|
||||||
|
|
||||||
t=PTemplate(env)
|
t=PTemplate(env)
|
||||||
|
|
||||||
|
wsgi_module=True
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -1039,6 +1039,7 @@ a.form_button_tab:hover
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/* border: solid #fff 1px;*/
|
/* border: solid #fff 1px;*/
|
||||||
float:left;
|
float:left;
|
||||||
|
overflow:hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1049,6 +1050,7 @@ a.form_button_tab:hover
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/*border: solid #f00 1px;*/
|
/*border: solid #f00 1px;*/
|
||||||
float:left;
|
float:left;
|
||||||
|
overflow:hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1058,6 +1060,7 @@ a.form_button_tab:hover
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/*border: solid #f00 1px;*/
|
/*border: solid #f00 1px;*/
|
||||||
float:left;
|
float:left;
|
||||||
|
overflow:hidden;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ if session.get('theme', '0')=='1':
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||||
<title>${title}</title>
|
<title>${title}</title>
|
||||||
|
|
||||||
<link href="${make_media_url('css/admin.css', 'admin')}" rel="stylesheet" />
|
<link href="${make_media_url('css/admin.css', 'admin')}" rel="stylesheet" />
|
||||||
<link href="${make_media_url('css/font-awesome.min.css', 'admin')}" rel="stylesheet" />
|
<link href="${make_media_url('css/font-awesome.min.css', 'admin')}" rel="stylesheet" />
|
||||||
<link href="${make_media_url('css/responsive-nav.css', 'admin')}" rel="stylesheet" />
|
<link href="${make_media_url('css/responsive-nav.css', 'admin')}" rel="stylesheet" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue