Added new support for new admin css, added dependencies to setup.py, fixes in admin
This commit is contained in:
parent
3456534cb8
commit
2c1e8b9e65
5 changed files with 35 additions and 7 deletions
|
|
@ -1,6 +1,21 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from paramecio.citoplasma.sessions import get_session
|
||||||
|
from paramecio.citoplasma.urls import make_url
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
from settings import config
|
||||||
|
|
||||||
|
except:
|
||||||
|
|
||||||
|
class config:
|
||||||
|
admin_folder='admin'
|
||||||
|
|
||||||
|
def make_admin_url(url, query_args={}):
|
||||||
|
|
||||||
|
return make_url('%s/%s' % (config.admin_folder, url), query_args)
|
||||||
|
|
||||||
def get_language(s):
|
def get_language(s):
|
||||||
|
|
||||||
|
|
@ -31,3 +46,16 @@ def get_menu(modules_admin):
|
||||||
menu[submod[2]]=submod
|
menu[submod[2]]=submod
|
||||||
|
|
||||||
return menu
|
return menu
|
||||||
|
|
||||||
|
def check_login():
|
||||||
|
|
||||||
|
s=get_session()
|
||||||
|
|
||||||
|
if 'login' in s:
|
||||||
|
|
||||||
|
if s['privileges']==2:
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ from mako.lookup import TemplateLookup
|
||||||
from paramecio.citoplasma.urls import make_url, make_media_url, make_media_url_module, add_get_parameters
|
from paramecio.citoplasma.urls import make_url, make_media_url, make_media_url_module, add_get_parameters
|
||||||
from paramecio.citoplasma.i18n import I18n
|
from paramecio.citoplasma.i18n import I18n
|
||||||
from paramecio.citoplasma.sessions import get_session
|
from paramecio.citoplasma.sessions import get_session
|
||||||
|
from paramecio.citoplasma.adminutils import make_admin_url
|
||||||
from paramecio.cromosoma.formsutils import csrf_token
|
from paramecio.cromosoma.formsutils import csrf_token
|
||||||
from settings import config
|
from settings import config
|
||||||
from os import path
|
from os import path
|
||||||
|
|
@ -108,6 +109,8 @@ class PTemplate:
|
||||||
|
|
||||||
self.add_filter(csrf_token)
|
self.add_filter(csrf_token)
|
||||||
|
|
||||||
|
self.add_filter(make_admin_url)
|
||||||
|
|
||||||
I18n_lang=I18n.lang
|
I18n_lang=I18n.lang
|
||||||
|
|
||||||
self.add_filter(I18n.lang)
|
self.add_filter(I18n.lang)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from bottle import get,post,response,request
|
||||||
from settings import config
|
from settings import config
|
||||||
from settings import config_admin
|
from settings import config_admin
|
||||||
from paramecio.citoplasma.lists import SimpleList
|
from paramecio.citoplasma.lists import SimpleList
|
||||||
from paramecio.citoplasma.adminutils import get_menu, get_language
|
from paramecio.citoplasma.adminutils import get_menu, get_language, make_admin_url
|
||||||
from paramecio.citoplasma.generate_admin_class import GenerateAdminClass
|
from paramecio.citoplasma.generate_admin_class import GenerateAdminClass
|
||||||
from paramecio.citoplasma.httputils import GetPostFiles
|
from paramecio.citoplasma.httputils import GetPostFiles
|
||||||
from paramecio.cromosoma.formsutils import show_form, pass_values_to_form, set_extra_forms_user
|
from paramecio.cromosoma.formsutils import show_form, pass_values_to_form, set_extra_forms_user
|
||||||
|
|
@ -45,10 +45,6 @@ module_admin=path.dirname(__file__)
|
||||||
|
|
||||||
env=env_theme(__file__)
|
env=env_theme(__file__)
|
||||||
|
|
||||||
def make_admin_url(url, query_args={}):
|
|
||||||
|
|
||||||
return make_url('%s/%s' % (config.admin_folder, url), query_args)
|
|
||||||
|
|
||||||
@get('/'+config.admin_folder)
|
@get('/'+config.admin_folder)
|
||||||
@get('/'+config.admin_folder+'/<module>')
|
@get('/'+config.admin_folder+'/<module>')
|
||||||
@post('/'+config.admin_folder+'/<module>')
|
@post('/'+config.admin_folder+'/<module>')
|
||||||
|
|
|
||||||
|
|
@ -518,6 +518,7 @@ a:hover.no_choose_flag
|
||||||
{
|
{
|
||||||
|
|
||||||
background: #f0ad4e;
|
background: #f0ad4e;
|
||||||
|
border: solid #f0ad4e 1px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
setup.py
4
setup.py
|
|
@ -11,7 +11,7 @@ if sys.version_info < (3, 3):
|
||||||
#import paramecio
|
#import paramecio
|
||||||
|
|
||||||
setup(name='paramecio',
|
setup(name='paramecio',
|
||||||
version='0.1.1b',
|
version='0.1.2',
|
||||||
description='Fast and simple Framework based in bottle and Mako.',
|
description='Fast and simple Framework based in bottle and Mako.',
|
||||||
long_description='This framework is simple framework used for create web apps. Paramecio is modular and fast. By default have a module called admin that can be used for create ',
|
long_description='This framework is simple framework used for create web apps. Paramecio is modular and fast. By default have a module called admin that can be used for create ',
|
||||||
author='Antonio de la Rosa Caballero',
|
author='Antonio de la Rosa Caballero',
|
||||||
|
|
@ -19,7 +19,7 @@ setup(name='paramecio',
|
||||||
url='http://paramecioproject.com/',
|
url='http://paramecioproject.com/',
|
||||||
packages=['paramecio'],
|
packages=['paramecio'],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=['bottle', 'mako', 'passlib', 'bcrypt', 'mysqlclient', 'sqlalchemy', 'Pillow', 'beaker'],
|
install_requires=['bottle', 'mako', 'passlib', 'bcrypt', 'mysqlclient', 'sqlalchemy', 'Pillow', 'beaker>=1.8.0'],
|
||||||
entry_points={'console_scripts': [
|
entry_points={'console_scripts': [
|
||||||
'paramecio = paramecio.console:start',
|
'paramecio = paramecio.console:start',
|
||||||
]},
|
]},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue