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.coreforms import PasswordForm
|
||||
from hmac import compare_digest as compare_hash
|
||||
import crypt
|
||||
#import crypt
|
||||
import re
|
||||
|
||||
class UserNameField(PhangoField):
|
||||
|
|
|
|||
|
|
@ -108,6 +108,34 @@ class I18n:
|
|||
#@staticmethod
|
||||
#def set_lang(code_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
|
||||
|
|
|
|||
|
|
@ -158,8 +158,12 @@ class PTemplate:
|
|||
|
||||
self.l=PGetText(module_env+'/app.py')
|
||||
|
||||
self.i18n=I18n(module_env)
|
||||
|
||||
self.add_filter(self._)
|
||||
|
||||
self.add_filter(self.i18n.tlang)
|
||||
|
||||
def _(self, text):
|
||||
|
||||
return self.l.gettext(text)
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@ try:
|
|||
|
||||
t=PTemplate(env)
|
||||
|
||||
wsgi_module=True
|
||||
|
||||
except:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1039,6 +1039,7 @@ a.form_button_tab:hover
|
|||
box-sizing: border-box;
|
||||
/* border: solid #fff 1px;*/
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1049,6 +1050,7 @@ a.form_button_tab:hover
|
|||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
float:left;
|
||||
overflow:hidden;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1058,6 +1060,7 @@ a.form_button_tab:hover
|
|||
box-sizing: border-box;
|
||||
/*border: solid #f00 1px;*/
|
||||
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 name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<title>${title}</title>
|
||||
|
||||
<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/responsive-nav.css', 'admin')}" rel="stylesheet" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue