improved admin navigation, thanks Vladyslav
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-07-15 10:02:59) dev
|
Version 2.00.0 (2012-07-15 17:28:41) dev
|
||||||
|
|||||||
@@ -8,11 +8,15 @@ if EXPERIMENTAL_STUFF:
|
|||||||
response.view = response.view.replace('default/','default.mobile/')
|
response.view = response.view.replace('default/','default.mobile/')
|
||||||
response.menu = []
|
response.menu = []
|
||||||
|
|
||||||
|
import re
|
||||||
from gluon.admin import *
|
from gluon.admin import *
|
||||||
from gluon.fileutils import abspath, read_file, write_file
|
from gluon.fileutils import abspath, read_file, write_file
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
|
from gluon.languages import (regex_language, read_possible_languages,
|
||||||
|
lang_sampling, read_dict, write_dict)
|
||||||
|
|
||||||
|
|
||||||
if DEMO_MODE and request.function in ['change_password','pack','pack_plugin','upgrade_web2py','uninstall','cleanup','compile_app','remove_compiled_app','delete','delete_plugin','create_file','upload_file','update_languages','reload_routes']:
|
if DEMO_MODE and request.function in ['change_password','pack','pack_plugin','upgrade_web2py','uninstall','cleanup','compile_app','remove_compiled_app','delete','delete_plugin','create_file','upload_file','update_languages','reload_routes']:
|
||||||
session.flash = T('disabled in demo mode')
|
session.flash = T('disabled in demo mode')
|
||||||
@@ -186,14 +190,14 @@ def site():
|
|||||||
elif file_or_appurl and request.vars.filename:
|
elif file_or_appurl and request.vars.filename:
|
||||||
# fetch an application via URL or file upload
|
# fetch an application via URL or file upload
|
||||||
f = None
|
f = None
|
||||||
if request.vars.appurl is not '':
|
if request.vars.appurl:
|
||||||
try:
|
try:
|
||||||
f = urllib.urlopen(request.vars.appurl)
|
f = urllib.urlopen(request.vars.appurl)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
session.flash = DIV(T('Unable to download app because:'),PRE(str(e)))
|
session.flash = DIV(T('Unable to download app because:'),PRE(str(e)))
|
||||||
redirect(URL(r=request))
|
redirect(URL(r=request))
|
||||||
fname = request.vars.appurl
|
fname = request.vars.appurl
|
||||||
elif request.vars.file is not '':
|
elif request.vars.file:
|
||||||
f = request.vars.file.file
|
f = request.vars.file.file
|
||||||
fname = request.vars.file.filename
|
fname = request.vars.file.filename
|
||||||
|
|
||||||
@@ -247,7 +251,7 @@ def report_progress(app):
|
|||||||
counter += int(m[1])
|
counter += int(m[1])
|
||||||
events.append([days,counter])
|
events.append([days,counter])
|
||||||
return events
|
return events
|
||||||
|
|
||||||
|
|
||||||
def pack():
|
def pack():
|
||||||
app = get_app()
|
app = get_app()
|
||||||
@@ -357,7 +361,7 @@ def delete():
|
|||||||
sender = sender[0]
|
sender = sender[0]
|
||||||
|
|
||||||
if 'nodelete' in request.vars:
|
if 'nodelete' in request.vars:
|
||||||
redirect(URL(sender))
|
redirect(URL(sender, anchor=request.vars.id))
|
||||||
elif 'delete' in request.vars:
|
elif 'delete' in request.vars:
|
||||||
try:
|
try:
|
||||||
full_path = apath(filename, r=request)
|
full_path = apath(filename, r=request)
|
||||||
@@ -369,7 +373,7 @@ def delete():
|
|||||||
except Exception:
|
except Exception:
|
||||||
session.flash = T('unable to delete file "%(filename)s"',
|
session.flash = T('unable to delete file "%(filename)s"',
|
||||||
dict(filename=filename))
|
dict(filename=filename))
|
||||||
redirect(URL(sender))
|
redirect(URL(sender, anchor=request.vars.id2))
|
||||||
return dict(filename=filename, sender=sender)
|
return dict(filename=filename, sender=sender)
|
||||||
|
|
||||||
def enable():
|
def enable():
|
||||||
@@ -384,22 +388,25 @@ def enable():
|
|||||||
|
|
||||||
def peek():
|
def peek():
|
||||||
""" Visualize object code """
|
""" Visualize object code """
|
||||||
app = get_app()
|
app = get_app(request.vars.app)
|
||||||
filename = '/'.join(request.args)
|
filename = '/'.join(request.args)
|
||||||
|
if request.vars.app:
|
||||||
|
path = abspath(filename, gluon=False)
|
||||||
|
else:
|
||||||
|
path = apath(filename, r=request)
|
||||||
try:
|
try:
|
||||||
data = safe_read(apath(filename, r=request)).replace('\r','')
|
data = safe_read(path).replace('\r','')
|
||||||
except IOError:
|
except IOError:
|
||||||
session.flash = T('file does not exist')
|
session.flash = T('file does not exist')
|
||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
|
|
||||||
extension = filename[filename.rfind('.') + 1:].lower()
|
extension = filename[filename.rfind('.') + 1:].lower()
|
||||||
|
|
||||||
return dict(app=request.args[0],
|
return dict(app=app,
|
||||||
filename=filename,
|
filename=filename,
|
||||||
data=data,
|
data=data,
|
||||||
extension=extension)
|
extension=extension)
|
||||||
|
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
""" Execute controller tests """
|
""" Execute controller tests """
|
||||||
app = get_app()
|
app = get_app()
|
||||||
@@ -428,14 +435,18 @@ def search():
|
|||||||
files2 = glob(os.path.join(path,'*/*.html'))
|
files2 = glob(os.path.join(path,'*/*.html'))
|
||||||
files3 = glob(os.path.join(path,'*/*/*.html'))
|
files3 = glob(os.path.join(path,'*/*/*.html'))
|
||||||
files=[x[len(path)+1:].replace('\\','/') for x in files1+files2+files3 if match(x,keywords)]
|
files=[x[len(path)+1:].replace('\\','/') for x in files1+files2+files3 if match(x,keywords)]
|
||||||
return response.json({'files':files})
|
return response.json(dict(files=files, message=T('@Searching: **%s** %%{file}', len(files))))
|
||||||
|
|
||||||
def edit():
|
def edit():
|
||||||
""" File edit handler """
|
""" File edit handler """
|
||||||
# Load json only if it is ajax edited...
|
# Load json only if it is ajax edited...
|
||||||
app = get_app()
|
app = get_app(request.vars.app)
|
||||||
filename = '/'.join(request.args)
|
filename = '/'.join(request.args)
|
||||||
# Try to discover the file type
|
if request.vars.app:
|
||||||
|
path = abspath(filename)
|
||||||
|
else:
|
||||||
|
path = apath(filename, r=request)
|
||||||
|
# Try to discover the file type
|
||||||
if filename[-3:] == '.py':
|
if filename[-3:] == '.py':
|
||||||
filetype = 'python'
|
filetype = 'python'
|
||||||
elif filename[-5:] == '.html':
|
elif filename[-5:] == '.html':
|
||||||
@@ -450,9 +461,6 @@ def edit():
|
|||||||
filetype = 'html'
|
filetype = 'html'
|
||||||
|
|
||||||
# ## check if file is not there
|
# ## check if file is not there
|
||||||
|
|
||||||
path = apath(filename, r=request)
|
|
||||||
|
|
||||||
if ('revert' in request.vars) and os.path.exists(path + '.bak'):
|
if ('revert' in request.vars) and os.path.exists(path + '.bak'):
|
||||||
try:
|
try:
|
||||||
data = safe_read(path + '.bak')
|
data = safe_read(path + '.bak')
|
||||||
@@ -672,9 +680,13 @@ def edit_language():
|
|||||||
""" Edit language file """
|
""" Edit language file """
|
||||||
app = get_app()
|
app = get_app()
|
||||||
filename = '/'.join(request.args)
|
filename = '/'.join(request.args)
|
||||||
from gluon.languages import read_dict, write_dict
|
|
||||||
strings = read_dict(apath(filename, r=request))
|
strings = read_dict(apath(filename, r=request))
|
||||||
keys = sorted(strings.keys(),lambda x,y: cmp(x.lower(), y.lower()))
|
|
||||||
|
if '__corrupted__' in strings:
|
||||||
|
form = SPAN(strings['__corrupted__'],_class='error')
|
||||||
|
return dict(filename=filename, form=form)
|
||||||
|
|
||||||
|
keys = sorted(strings.keys(),lambda x,y: cmp(unicode(x,'utf-8').lower(), unicode(y,'utf-8').lower()))
|
||||||
rows = []
|
rows = []
|
||||||
rows.append(H2(T('Original/Translation')))
|
rows.append(H2(T('Original/Translation')))
|
||||||
|
|
||||||
@@ -711,6 +723,54 @@ def edit_language():
|
|||||||
return dict(app=request.args[0], filename=filename, form=form)
|
return dict(app=request.args[0], filename=filename, form=form)
|
||||||
|
|
||||||
|
|
||||||
|
def edit_plurals():
|
||||||
|
""" Edit plurals file """
|
||||||
|
#import ipdb; ipdb.set_trace()
|
||||||
|
app = get_app()
|
||||||
|
filename = '/'.join(request.args)
|
||||||
|
plurals = read_plural_dict(apath(filename, r=request)) # plural forms dictionary
|
||||||
|
nplurals = int(request.vars.nplurals)-1 # plural forms quantity
|
||||||
|
xnplurals = xrange(nplurals)
|
||||||
|
|
||||||
|
if '__corrupted__' in plurals:
|
||||||
|
# show error message and exit
|
||||||
|
form = SPAN(plurals['__corrupted__'],_class='error')
|
||||||
|
return dict(filename=filename, form=form)
|
||||||
|
|
||||||
|
keys = sorted(plurals.keys(),lambda x,y: cmp(unicode(x,'utf-8').lower(), unicode(y,'utf-8').lower()))
|
||||||
|
rows = []
|
||||||
|
|
||||||
|
row=[T("Singular Form")]
|
||||||
|
row.extend([T("Plural Form #%s", n+1) for n in xnplurals])
|
||||||
|
table=TABLE(THEAD(TR(row)))
|
||||||
|
|
||||||
|
for key in keys:
|
||||||
|
name = md5_hash(key)
|
||||||
|
forms = plurals[key]
|
||||||
|
|
||||||
|
if len(forms) < nplurals:
|
||||||
|
forms.extend(None for i in xrange(nplurals-len(forms)))
|
||||||
|
|
||||||
|
row = [B(key)]
|
||||||
|
row.extend([INPUT(_type='text', _name=name+'_'+str(n), value=forms[n], _size=20) for n in xnplurals])
|
||||||
|
row.append(TD(TAG.BUTTON(T('delete'), _onclick='return delkey("%s")' % name)))
|
||||||
|
rows.append(TR(row, _id=name))
|
||||||
|
if rows:
|
||||||
|
table.append(TBODY(rows))
|
||||||
|
rows=[table, INPUT(_type='submit', _value=T('update'))]
|
||||||
|
form = FORM(*rows)
|
||||||
|
if form.accepts(request.vars, keepvalues=True):
|
||||||
|
new_plurals = dict()
|
||||||
|
for key in keys:
|
||||||
|
name = md5_hash(key)
|
||||||
|
if form.vars[name+'_0']==chr(127): continue
|
||||||
|
new_plurals[key] = [form.vars[name+'_'+str(n)] for n in xnplurals]
|
||||||
|
write_plural_dict(apath(filename, r=request), new_plurals)
|
||||||
|
session.flash = T('file saved on %(time)s', dict(time=time.ctime()))
|
||||||
|
redirect(URL(r=request, args=request.args, vars=dict(nplurals=request.vars.nplurals)))
|
||||||
|
return dict(app=request.args[0], filename=filename, form=form)
|
||||||
|
|
||||||
|
|
||||||
def about():
|
def about():
|
||||||
""" Read about info """
|
""" Read about info """
|
||||||
app = get_app()
|
app = get_app()
|
||||||
@@ -794,8 +854,34 @@ def design():
|
|||||||
statics.sort()
|
statics.sort()
|
||||||
|
|
||||||
# Get all languages
|
# Get all languages
|
||||||
languages = listdir(apath('%s/languages/' % app, r=request), '[\w-]*\.py')
|
all_languages = dict([(lang+'.py',info[0]) for lang,info
|
||||||
|
in read_possible_languages(apath(app, r=request)).iteritems()
|
||||||
|
if info[2]!=0]) # info[2] is langfile_mtime:
|
||||||
|
# get only existing files
|
||||||
|
languages = sorted(all_languages)
|
||||||
|
|
||||||
|
plural_rules = {}
|
||||||
|
try:
|
||||||
|
all_plurals = read_possible_plurals()
|
||||||
|
except:
|
||||||
|
all_plurals = {} # not implemented yet
|
||||||
|
for langfile,lang in all_languages.iteritems():
|
||||||
|
lang=lang.strip()
|
||||||
|
match_language = regex_language.match(lang)
|
||||||
|
if match_language:
|
||||||
|
match_language = tuple(part
|
||||||
|
for part in match_language.groups()
|
||||||
|
if part)
|
||||||
|
plang = lang_sampling(match_language, all_plurals.keys())
|
||||||
|
if plang:
|
||||||
|
plural=all_plurals[plang]
|
||||||
|
plural_rules[langfile]=(plural[0],plang,plural[1],plural[3])
|
||||||
|
else:
|
||||||
|
plural_rules[langfile]=(0,lang,'plural_rules-%s.py'%lang,'')
|
||||||
|
|
||||||
|
plurals = listdir(apath('%s/languages/' % app, r=request),
|
||||||
|
'^plural-[\w-]+\.py$')
|
||||||
|
|
||||||
#Get crontab
|
#Get crontab
|
||||||
cronfolder = apath('%s/cron' % app, r=request)
|
cronfolder = apath('%s/cron' % app, r=request)
|
||||||
if not os.path.exists(cronfolder): os.mkdir(cronfolder)
|
if not os.path.exists(cronfolder): os.mkdir(cronfolder)
|
||||||
@@ -821,6 +907,8 @@ def design():
|
|||||||
include=include,
|
include=include,
|
||||||
statics=filter_plugins(statics,plugins),
|
statics=filter_plugins(statics,plugins),
|
||||||
languages=languages,
|
languages=languages,
|
||||||
|
plurals=plurals,
|
||||||
|
plural_rules=plural_rules,
|
||||||
crontab=crontab,
|
crontab=crontab,
|
||||||
plugins=plugins)
|
plugins=plugins)
|
||||||
|
|
||||||
@@ -830,7 +918,7 @@ def delete_plugin():
|
|||||||
plugin = request.args(1)
|
plugin = request.args(1)
|
||||||
plugin_name='plugin_'+plugin
|
plugin_name='plugin_'+plugin
|
||||||
if 'nodelete' in request.vars:
|
if 'nodelete' in request.vars:
|
||||||
redirect(URL('design',args=app))
|
redirect(URL('design', args=app, anchor=request.vars.id))
|
||||||
elif 'delete' in request.vars:
|
elif 'delete' in request.vars:
|
||||||
try:
|
try:
|
||||||
for folder in ['models','views','controllers','static','modules']:
|
for folder in ['models','views','controllers','static','modules']:
|
||||||
@@ -847,7 +935,7 @@ def delete_plugin():
|
|||||||
except Exception:
|
except Exception:
|
||||||
session.flash = T('unable to delete file plugin "%(plugin)s"',
|
session.flash = T('unable to delete file plugin "%(plugin)s"',
|
||||||
dict(plugin=plugin))
|
dict(plugin=plugin))
|
||||||
redirect(URL('design',args=request.args(0)))
|
redirect(URL('design', args=request.args(0), anchor=request.vars.id2))
|
||||||
return dict(plugin=plugin)
|
return dict(plugin=plugin)
|
||||||
|
|
||||||
def plugin():
|
def plugin():
|
||||||
@@ -940,24 +1028,56 @@ def plugin():
|
|||||||
def create_file():
|
def create_file():
|
||||||
""" Create files handler """
|
""" Create files handler """
|
||||||
try:
|
try:
|
||||||
app = get_app(name=request.vars.location.split('/')[0])
|
anchor='#'+request.vars.id if request.vars.id else ''
|
||||||
path = apath(request.vars.location, r=request)
|
if request.vars.app:
|
||||||
|
app = get_app(request.vars.app)
|
||||||
|
path = abspath(request.vars.location, gluon=False)
|
||||||
|
else:
|
||||||
|
app = get_app(name=request.vars.location.split('/')[0])
|
||||||
|
path = apath(request.vars.location, r=request)
|
||||||
filename = re.sub('[^\w./-]+', '_', request.vars.filename)
|
filename = re.sub('[^\w./-]+', '_', request.vars.filename)
|
||||||
|
if path[-7:] == '/rules/':
|
||||||
|
# Handle plural rules files
|
||||||
|
if len(filename) == 0:
|
||||||
|
raise SyntaxError
|
||||||
|
if not filename[-3:] == '.py':
|
||||||
|
filename += '.py'
|
||||||
|
lang = re.match('^plural_rules-(.*)\.py$',filename).group(1)
|
||||||
|
langinfo = read_possible_languages(apath(app, r=request))[lang]
|
||||||
|
text = dedent("""
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf8 -*-
|
||||||
|
# Plural-Forms for %(lang)s (%(langname)s)
|
||||||
|
|
||||||
if path[-11:] == '/languages/':
|
nplurals=2 # for example, English language has 2 forms:
|
||||||
|
# 1 singular and 1 plural
|
||||||
|
|
||||||
|
# Determine plural_id for number *n* as sequence of positive
|
||||||
|
# integers: 0,1,...
|
||||||
|
# NOTE! For singular form ALWAYS return plural_id = 0
|
||||||
|
get_plural_id = lambda n: int(n != 1)
|
||||||
|
|
||||||
|
# Construct and return plural form of *word* using
|
||||||
|
# *plural_id* (which ALWAYS>0). This function will be executed
|
||||||
|
# for words (or phrases) not found in plural_dict dictionary.
|
||||||
|
# By default this function simply returns word in singular:
|
||||||
|
construct_plural_form = lambda word, plural_id: word
|
||||||
|
""")[1:] % dict(lang=langinfo[0], langname=langinfo[1])
|
||||||
|
|
||||||
|
elif path[-11:] == '/languages/':
|
||||||
# Handle language files
|
# Handle language files
|
||||||
if len(filename) == 0:
|
if len(filename) == 0:
|
||||||
raise SyntaxError
|
raise SyntaxError
|
||||||
if not filename[-3:] == '.py':
|
if not filename[-3:] == '.py':
|
||||||
filename += '.py'
|
filename += '.py'
|
||||||
app = path.split('/')[-3]
|
|
||||||
path=os.path.join(apath(app, r=request),'languages',filename)
|
path=os.path.join(apath(app, r=request),'languages',filename)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
safe_write(path, '')
|
safe_write(path, '')
|
||||||
|
# create language xx[-yy].py file:
|
||||||
findT(apath(app, r=request), filename[:-3])
|
findT(apath(app, r=request), filename[:-3])
|
||||||
session.flash = T('language file "%(filename)s" created/updated',
|
session.flash = T('language file "%(filename)s" created/updated',
|
||||||
dict(filename=filename))
|
dict(filename=filename))
|
||||||
redirect(request.vars.sender)
|
redirect(request.vars.sender+anchor)
|
||||||
|
|
||||||
elif path[-8:] == '/models/':
|
elif path[-8:] == '/models/':
|
||||||
# Handle python models
|
# Handle python models
|
||||||
@@ -1024,7 +1144,7 @@ def create_file():
|
|||||||
filename = 'plugin_%s/%s' % (request.vars.plugin, filename)
|
filename = 'plugin_%s/%s' % (request.vars.plugin, filename)
|
||||||
text = ''
|
text = ''
|
||||||
else:
|
else:
|
||||||
redirect(request.vars.sender)
|
redirect(request.vars.sender+anchor)
|
||||||
|
|
||||||
full_filename = os.path.join(path, filename)
|
full_filename = os.path.join(path, filename)
|
||||||
dirpath = os.path.dirname(full_filename)
|
dirpath = os.path.dirname(full_filename)
|
||||||
@@ -1039,18 +1159,20 @@ def create_file():
|
|||||||
log_progress(app,'CREATE',filename)
|
log_progress(app,'CREATE',filename)
|
||||||
session.flash = T('file "%(filename)s" created',
|
session.flash = T('file "%(filename)s" created',
|
||||||
dict(filename=full_filename[len(path):]))
|
dict(filename=full_filename[len(path):]))
|
||||||
|
vars={}
|
||||||
|
if request.vars.id: vars['id']=request.vars.id
|
||||||
|
if request.vars.app: vars['app']=request.vars.app
|
||||||
redirect(URL('edit',
|
redirect(URL('edit',
|
||||||
args=[os.path.join(request.vars.location, filename)]))
|
args=[os.path.join(request.vars.location, filename)], vars=vars))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if not isinstance(e,HTTP):
|
if not isinstance(e,HTTP):
|
||||||
session.flash = T('cannot create file')
|
session.flash = T('cannot create file')
|
||||||
|
|
||||||
redirect(request.vars.sender)
|
redirect(request.vars.sender+anchor)
|
||||||
|
|
||||||
|
|
||||||
def upload_file():
|
def upload_file():
|
||||||
""" File uploading handler """
|
""" File uploading handler """
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filename = None
|
filename = None
|
||||||
app = get_app(name=request.vars.location.split('/')[0])
|
app = get_app(name=request.vars.location.split('/')[0])
|
||||||
@@ -1123,7 +1245,7 @@ def errors():
|
|||||||
|
|
||||||
hash2error = dict()
|
hash2error = dict()
|
||||||
|
|
||||||
for fn in listdir(errors_path, '^\w.*'):
|
for fn in listdir(errors_path, '^[a-fA-F0-9.\-]+$'):
|
||||||
fullpath = os.path.join(errors_path, fn)
|
fullpath = os.path.join(errors_path, fn)
|
||||||
if not os.path.isfile(fullpath): continue
|
if not os.path.isfile(fullpath): continue
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ response.title = '%s %s' % (_f, '/'.join(request.args))
|
|||||||
response.subtitle = 'admin'
|
response.subtitle = 'admin'
|
||||||
response.menu = [(T('Site'), _f == 'site', URL(_a,'default','site'))]
|
response.menu = [(T('Site'), _f == 'site', URL(_a,'default','site'))]
|
||||||
|
|
||||||
if request.args:
|
if request.vars.app or request.args:
|
||||||
_t = request.args[0]
|
_t = request.vars.app or request.args[0]
|
||||||
response.menu.append((T('Edit'), _c == 'default' and _f == 'design',
|
response.menu.append((T('Edit'), _c == 'default' and _f == 'design',
|
||||||
URL(_a,'default','design',args=_t)))
|
URL(_a,'default','design',args=_t)))
|
||||||
response.menu.append((T('About'), _c == 'default' and _f == 'about',
|
response.menu.append((T('About'), _c == 'default' and _f == 'about',
|
||||||
URL(_a,'default','about',args=_t)))
|
URL(_a,'default','about',args=_t,)))
|
||||||
response.menu.append((T('Errors'), _c == 'default' and _f == 'errors',
|
response.menu.append((T('Errors'), _c == 'default' and _f == 'errors',
|
||||||
URL(_a,'default','errors',args=_t)))
|
URL(_a,'default','errors',args=_t)))
|
||||||
response.menu.append((T('Versioning'),
|
response.menu.append((T('Versioning'),
|
||||||
|
|||||||
@@ -1245,3 +1245,6 @@ color: #222;
|
|||||||
}
|
}
|
||||||
.ie9 #query_panel {padding-bottom:2px;}
|
.ie9 #query_panel {padding-bottom:2px;}
|
||||||
|
|
||||||
|
.error, .error a {color:red}
|
||||||
|
.pluralsform thead td {font-weight:bold; font-size:1.2em; padding-bottom:5px}
|
||||||
|
.pluralsform td {padding-left:5px}
|
||||||
|
|||||||
@@ -2,36 +2,43 @@
|
|||||||
{{
|
{{
|
||||||
def all(items):
|
def all(items):
|
||||||
return reduce(lambda a,b:a and b,items,True)
|
return reduce(lambda a,b:a and b,items,True)
|
||||||
def peekfile(path,file):
|
def peekfile(path,file,vars={},title=None):
|
||||||
return A(file.replace('\\\\','/'),_href=URL('peek', args=(app, path, file)))
|
args=(path,file) if 'app' in vars else (app,path,file)
|
||||||
def editfile(path,file):
|
return A(file.replace('\\\\','/'),_title=title,_href=URL('peek', args=args, vars=vars))
|
||||||
return A(SPAN(T('Edit')),_class='button editbutton',_href=URL('edit', args=(app, path, file)))
|
def editfile(path,file,vars={}):
|
||||||
|
args=(path,file) if 'app' in vars else (app,path,file)
|
||||||
|
return A(SPAN(T('Edit')),_class='button editbutton',_href=URL('edit', args=args, vars=vars))
|
||||||
def testfile(path,file):
|
def testfile(path,file):
|
||||||
return A(TAG[''](IMG(_src=URL('static', 'images/test_icon.png'), _alt=T('test')), SPAN(T("Run tests in this file (to run all files, you may also use the button labelled 'test')"))), _class='icon test tooltip',_href=URL('test', args=(app, file)))
|
return A(TAG[''](IMG(_src=URL('static', 'images/test_icon.png'), _alt=T('test')), SPAN(T("Run tests in this file (to run all files, you may also use the button labelled 'test')"))), _class='icon test tooltip',_href=URL('test', args=(app, file)))
|
||||||
def editlanguagefile(path,file):
|
def editlanguagefile(path,file,vars={}):
|
||||||
return A(SPAN(T('Edit')),_class='button editbutton',_href=URL('edit_language', args=(app, path, file)))
|
return A(SPAN(T('Edit')),_class='button editbutton',_href=URL('edit_language', args=(app, path, file), vars=vars))
|
||||||
def file_upload_form(location):
|
def editpluralsfile(path,file,vars={}):
|
||||||
|
return A(SPAN(T('Edit')),_class='button editbutton',_href=URL('edit_plurals', args=(app, path, file), vars=vars))
|
||||||
|
def file_upload_form(location, anchor=None):
|
||||||
form=FORM(T("upload file:")," ",
|
form=FORM(T("upload file:")," ",
|
||||||
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
INPUT(_type="file",_name="file")," ",T("and rename it:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app, anchor=anchor)),
|
||||||
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
INPUT(_type="submit",_value=T("upload")),_action=URL('upload_file'))
|
||||||
return form
|
return form
|
||||||
def file_create_form(location):
|
def file_create_form(location, anchor=None):
|
||||||
form=FORM(T("create file with filename:")," ",
|
form=FORM(T("create file with filename:")," ",
|
||||||
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
INPUT(_type="text",_name="filename",requires=IS_NOT_EMPTY),
|
||||||
INPUT(_type="hidden",_name="location",_value=location),
|
INPUT(_type="hidden",_name="location",_value=location),
|
||||||
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
INPUT(_type="hidden",_name="sender",_value=URL('design',args=app)),
|
||||||
|
INPUT(_type="hidden",_name="id",_value=anchor),
|
||||||
INPUT(_type="submit",_value=T("Create")),_action=URL('create_file'))
|
INPUT(_type="submit",_value=T("Create")),_action=URL('create_file'))
|
||||||
return form
|
return form
|
||||||
def upload_plugin_form(app):
|
def upload_plugin_form(app, anchor=None):
|
||||||
form=FORM(T("upload plugin file:")," ",
|
form=FORM(T("upload plugin file:")," ",
|
||||||
INPUT(_type="file",_name="pluginfile"),
|
INPUT(_type="file",_name="pluginfile"),
|
||||||
|
INPUT(_type="hidden",_name="id",_value=anchor),
|
||||||
INPUT(_type="submit",_value=T("upload")))
|
INPUT(_type="submit",_value=T("upload")))
|
||||||
return form
|
return form
|
||||||
def deletefile(arglist):
|
def deletefile(arglist, vars={}):
|
||||||
return A(TAG[''](IMG(_src=URL('static', 'images/delete_icon.png')), SPAN(T('Delete this file (you will be asked to confirm deletion)'))), _class='icon delete tooltip', _href=URL('delete',args=arglist,vars=dict(sender=request.function+'/'+app)))
|
vars.update({'sender':request.function+'/'+app})
|
||||||
|
return A(TAG[''](IMG(_src=URL('static', 'images/delete_icon.png')), SPAN(T('Delete this file (you will be asked to confirm deletion)'))), _class='icon delete tooltip', _href=URL('delete',args=arglist,vars=vars))
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{block sectionclass}}design{{end}}
|
{{block sectionclass}}design{{end}}
|
||||||
@@ -73,13 +80,14 @@ def deletefile(arglist):
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{for m in models:}}
|
{{for m in models:}}
|
||||||
<li id="models__{{=m.replace('.','__')}}">
|
{{id="models__"+m.replace('.','__')}}
|
||||||
|
<li id="{{=id}}">
|
||||||
<span class="filetools controls">
|
<span class="filetools controls">
|
||||||
{{=editfile('models',m)}}
|
{{=editfile('models',m, dict(id=id))}}
|
||||||
{{=deletefile([app, 'models', m])}}
|
{{=deletefile([app, 'models', m], dict(id=id, id2='models'))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
{{=peekfile('models',m)}}
|
{{=peekfile('models',m, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="extras">
|
<span class="extras">
|
||||||
{{if len(defines[m]):}}{{=T("defines tables")}} {{pass}}{{=XML(', '.join([B(table).xml() for table in defines[m]]))}}
|
{{if len(defines[m]):}}{{=T("defines tables")}} {{pass}}{{=XML(', '.join([B(table).xml() for table in defines[m]]))}}
|
||||||
@@ -87,7 +95,7 @@ def deletefile(arglist):
|
|||||||
</li>
|
</li>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="controls formfield">{{=file_create_form('%s/models/' % app)}}</div>
|
<div class="controls formfield">{{=file_create_form('%s/models/' % app, 'models')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- FIND CONTROLLER FUNCTIONS -->
|
<!-- FIND CONTROLLER FUNCTIONS -->
|
||||||
@@ -112,14 +120,15 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{pass}}
|
{{pass}}
|
||||||
<ul>
|
<ul>
|
||||||
{{for c in controllers:}}
|
{{for c in controllers:}}
|
||||||
<li id="controllers__{{=c.replace('.','__')}}">
|
{{id="controllers__"+c.replace('.','__')}}
|
||||||
|
<li id="{{=id}}">
|
||||||
<span class="filetools controls">
|
<span class="filetools controls">
|
||||||
{{=editfile('controllers',c)}}
|
{{=editfile('controllers',c, dict(id=id))}}
|
||||||
{{=deletefile([app, 'controllers', c])}}
|
{{=deletefile([app, 'controllers', c], dict(id=id, id2='controllers'))}}
|
||||||
{{=testfile('controllers',c)}}
|
{{=testfile('controllers',c)}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
{{=peekfile('controllers',c)}}
|
{{=peekfile('controllers',c, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="extras">
|
<span class="extras">
|
||||||
{{if functions[c]:}}{{=T("exposes")}} {{pass}}{{=XML(', '.join([A(f,_href=URL(a=app,c=c[:-3],f=f)).xml() for f in functions[c]]))}}
|
{{if functions[c]:}}{{=T("exposes")}} {{pass}}{{=XML(', '.join([A(f,_href=URL(a=app,c=c[:-3],f=f)).xml() for f in functions[c]]))}}
|
||||||
@@ -127,7 +136,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
</li>
|
</li>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="controls formfield">{{=file_create_form('%s/controllers/' % app)}}</div>
|
<div class="controls formfield">{{=file_create_form('%s/controllers/' % app, 'controllers')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- VIEWS -->
|
<!-- VIEWS -->
|
||||||
@@ -143,13 +152,14 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{if not views:}}<p><strong>{{=T("There are no views")}}</strong></p>{{pass}}
|
{{if not views:}}<p><strong>{{=T("There are no views")}}</strong></p>{{pass}}
|
||||||
<ul>
|
<ul>
|
||||||
{{for c in views:}}
|
{{for c in views:}}
|
||||||
<li id="views__{{=c.replace('/','__').replace('.','__')}}">
|
{{id="views__"+c.replace('/','__').replace('.','__')}}
|
||||||
|
<li id="{{=id}}">
|
||||||
<span class="filetools controls">
|
<span class="filetools controls">
|
||||||
{{=editfile('views',c)}}
|
{{=editfile('views',c, dict(id=id))}}
|
||||||
{{=deletefile([app, 'views', c])}}
|
{{=deletefile([app, 'views', c], dict(id=id, id2='views'))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
{{=peekfile('views',c)}}
|
{{=peekfile('views',c, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="extras">
|
<span class="extras">
|
||||||
{{if extend.has_key(c):}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
{{if extend.has_key(c):}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
||||||
@@ -158,7 +168,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
</li>
|
</li>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="controls formfield">{{=file_create_form('%s/views/' % app)}}</div>
|
<div class="controls formfield">{{=file_create_form('%s/views/' % app, 'views')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- LANGUAGES -->
|
<!-- LANGUAGES -->
|
||||||
@@ -172,20 +182,60 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{=button(URL('update_languages/'+app), T('update all languages'))}}
|
{{=button(URL('update_languages/'+app), T('update all languages'))}}
|
||||||
</div>
|
</div>
|
||||||
{{if not languages:}}<p><strong>{{=T("There are no translators, only default language is supported")}}</strong></p>{{pass}}
|
{{if not languages:}}<p><strong>{{=T("There are no translators, only default language is supported")}}</strong></p>{{pass}}
|
||||||
<ul>
|
<table>
|
||||||
{{for file in languages:}}
|
{{for file in languages:}}
|
||||||
<li id="languages__{{=file.replace('.','__')}}">
|
{{id="languages__"+file.replace('.','__')}}
|
||||||
|
<tr id="{{=id}}">
|
||||||
|
<td>
|
||||||
<span class="filetools controls">
|
<span class="filetools controls">
|
||||||
{{=editlanguagefile('languages',file)}}
|
{{=editlanguagefile('languages',file)}}
|
||||||
{{=deletefile([app, 'languages', file])}}
|
{{=deletefile([app, 'languages', file], dict(id=id, id2='languages'))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
{{=peekfile('languages',file)}}
|
{{=peekfile('languages',file, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
(
|
||||||
|
{{=T("Plural-Forms:")}}
|
||||||
|
{{p=plural_rules[file]}}
|
||||||
|
{{if p[0] == 0:}}
|
||||||
|
<b>{{=T("rules are not defined")}}</b>,
|
||||||
|
<span class="controls comptools">
|
||||||
|
{{=button(URL('create_file', vars=dict(filename=p[2], location='rules/', sender=URL('design', args=app), id=id, app=app)), T('Create rules'))}}
|
||||||
|
</span>
|
||||||
|
{{else:}}
|
||||||
|
{{if p[0] == 1:}}
|
||||||
|
{{if p[3] == 'ok':}}
|
||||||
|
{{=B(T("are not used"))}},
|
||||||
|
{{else:}}
|
||||||
|
<span class='error'>{{=B(T("rules parsed with errors"))}}</span>,
|
||||||
|
{{pass}}
|
||||||
|
{{else:}}
|
||||||
|
{{pfile='plural-%s.py'%p[1]}}
|
||||||
|
{{if pfile in plurals:}}
|
||||||
|
<span class="filetools controls">
|
||||||
|
{{=editpluralsfile('languages',pfile,dict(nplurals=p[0]))}}
|
||||||
|
</span>
|
||||||
|
<span class="file">
|
||||||
|
{{=peekfile('languages',pfile,dict(id=id))}},
|
||||||
|
</span>
|
||||||
|
{{else:}}
|
||||||
|
<b>{{=T("are not used yet")}}</b>,
|
||||||
|
{{pass}}
|
||||||
|
{{pass}}
|
||||||
|
{{=T("rules:")}}
|
||||||
|
<span class="file{{=' error' if p[3]!='ok' else ''}}">
|
||||||
|
{{=peekfile('rules', p[2], dict(app=app, id=id), p[3] if p[3]!='ok' else None)}}
|
||||||
|
</span>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
)
|
||||||
<div class="controls formfield">{{=file_create_form('%s/languages/' % app)}}{{=T('(something like "it-it")')}}</div>
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{pass}}
|
||||||
|
</table>
|
||||||
|
<div class="controls formfield">{{=file_create_form('%s/languages/' % app, 'languages')}}{{=T('(something like "it-it")')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- STATIC -->
|
<!-- STATIC -->
|
||||||
@@ -223,10 +273,10 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
if filename:
|
if filename:
|
||||||
}}<li>
|
}}<li>
|
||||||
<span class="filetools controls">
|
<span class="filetools controls">
|
||||||
{{=editfile('static',file)}} {{=deletefile([app,'static',file])}}
|
{{=editfile('static',file, dict(id="static"))}} {{=deletefile([app,'static',file], dict(id="static",id2="static"))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
<a href="{{=URL(a=app,c='static',f=file)}}">{{=filename}}</a>
|
<a href="{{=URL(a=app,c='static',f=file)}}">{{=filename}}</a>
|
||||||
</span>
|
</span>
|
||||||
</li>{{
|
</li>{{
|
||||||
pass
|
pass
|
||||||
@@ -234,8 +284,8 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
}}
|
}}
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="controls formfield">{{=file_create_form('%s/static/' % app)}}
|
<div class="controls formfield">{{=file_create_form('%s/static/' % app, 'static')}}
|
||||||
{{=file_upload_form('%s/static/' % app)}}</div>
|
{{=file_upload_form('%s/static/' % app, 'static')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- MODULES -->
|
<!-- MODULES -->
|
||||||
@@ -250,19 +300,22 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{if not modules:}}<p><strong>{{=T("There are no modules")}}</strong></p>{{pass}}
|
{{if not modules:}}<p><strong>{{=T("There are no modules")}}</strong></p>{{pass}}
|
||||||
<ul>
|
<ul>
|
||||||
{{for m in modules:}}
|
{{for m in modules:}}
|
||||||
<li id="modules__{{=m.replace('/','__').replace('.','__')}}">
|
{{id="modules__"+m.replace('/','__').replace('.','__')}}
|
||||||
|
<li id="{{=id}}">
|
||||||
<span class="filetols controls">
|
<span class="filetols controls">
|
||||||
{{=editfile('modules',m)}}
|
{{=editfile('modules',m,dict(id=id))}}
|
||||||
{{if m!='__init__.py':}}{{=deletefile([app, 'modules', m])}}{{pass}}
|
{{if m!='__init__.py':}}
|
||||||
|
{{=deletefile([app, 'modules', m], dict(id=id, id2='modules'))}}
|
||||||
|
{{pass}}
|
||||||
</span>
|
</span>
|
||||||
<span class="file">
|
<span class="file">
|
||||||
{{=peekfile('modules',m)}}
|
{{=peekfile('modules',m, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="controls formfield">{{=file_create_form('%s/modules/' % app)}}
|
<div class="controls formfield">{{=file_create_form('%s/modules/' % app, 'modules')}}
|
||||||
{{=file_upload_form('%s/modules/' % app)}}</div>
|
{{=file_upload_form('%s/modules/' % app, 'modules')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- PLUGINS -->
|
<!-- PLUGINS -->
|
||||||
@@ -280,15 +333,16 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{if plugins:}}
|
{{if plugins:}}
|
||||||
<ul>
|
<ul>
|
||||||
{{for plugin in plugins:}}
|
{{for plugin in plugins:}}
|
||||||
<li>
|
{{id="plugins__"+plugin.replace('/','__').replace('.','__')}}
|
||||||
{{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', args=[app, plugin]))}}
|
<li id="{{=id}}">
|
||||||
|
{{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', args=[app, plugin], vars=dict(id=id, id2='plugins')))}}
|
||||||
</li>
|
</li>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
</ul>
|
</ul>
|
||||||
{{else:}}
|
{{else:}}
|
||||||
<p><strong>{{=T('There are no plugins')}}</strong></p>
|
<p><strong>{{=T('There are no plugins')}}</strong></p>
|
||||||
{{pass}}
|
{{pass}}
|
||||||
<div class="controls formfield">{{=upload_plugin_form(app)}}</div>
|
<div class="controls formfield">{{=upload_plugin_form(app, 'plugins')}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -299,11 +353,12 @@ jQuery(document).ready(function(){
|
|||||||
if(code==13 && jQuery('#search').val()){
|
if(code==13 && jQuery('#search').val()){
|
||||||
jQuery.getJSON('{{=URL('search',args=request.args)}}?keywords='+escape(jQuery('#search').val()),null,function(data, textStatus, xhr){
|
jQuery.getJSON('{{=URL('search',args=request.args)}}?keywords='+escape(jQuery('#search').val()),null,function(data, textStatus, xhr){
|
||||||
jQuery('.component_contents li, .formfield, .comptools').hide();
|
jQuery('.component_contents li, .formfield, .comptools').hide();
|
||||||
files=data['files'];
|
files=data['files'];
|
||||||
|
message=data['message'];
|
||||||
for(var i=0; i<files.length; i++)
|
for(var i=0; i<files.length; i++)
|
||||||
jQuery('li#'+files[i].replace(/\//g,'__').replace('.','__')).slideDown();
|
jQuery('li#'+files[i].replace(/\//g,'__').replace('.','__')).slideDown();
|
||||||
jQuery('.flash').html('{{=T("Searching:")}} '+files.length+' {{=T("files")}}').slideDown();
|
jQuery('.flash').html(message).slideDown();
|
||||||
});
|
});
|
||||||
} else if(code==13) {
|
} else if(code==13) {
|
||||||
jQuery('.component_contents li, .formfield, .comptools').slideDown();
|
jQuery('.component_contents li, .formfield, .comptools').slideDown();
|
||||||
jQuery('.flash').html('').hide();
|
jQuery('.flash').html('').hide();
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ jQuery(document).ready(function(){
|
|||||||
URL(c='debug', f='toggle_breakpoint')),
|
URL(c='debug', f='toggle_breakpoint')),
|
||||||
_class="button special")}}
|
_class="button special")}}
|
||||||
{{pass}}
|
{{pass}}
|
||||||
{{=button(URL('design',args=request.args[0]), T('back'))}}
|
{{=button(URL('design',args=request.vars.app if request.vars.app else request.args[0], anchor=request.vars.id), T('back'))}}
|
||||||
{{if edit_controller:}}
|
{{if edit_controller:}}
|
||||||
{{=button(edit_controller, T('edit controller'))}}
|
{{=button(edit_controller, T('edit controller'))}}
|
||||||
{{pass}}
|
{{pass}}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
<h2>{{=T("Peeking at file")}} "{{=filename}}"</h2>
|
<h2>{{=T("Peeking at file")}} "{{=filename}}"</h2>
|
||||||
|
|
||||||
<p class="controls">
|
<p class="controls">
|
||||||
{{=button(URL('design',args=request.args[0]), T('back'))}}
|
{{=button(URL('design',args=request.vars.app if request.vars.app else request.args[0], anchor=request.vars.id), T('back'))}}
|
||||||
{{=button(URL('edit',args=request.args), T('Edit'))}}
|
{{=button(URL('edit',args=request.args, vars=request.vars), T('Edit'))}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{{
|
{{
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<!-- VERSION -->
|
<!-- VERSION -->
|
||||||
{{if is_manager():}}
|
{{if is_manager():}}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3>{{="Version %s.%s.%s (%s) %s" % myversion}}</h3>
|
<h3>{{=T("Version %s.%s.%s (%s) %s", myversion)}}</h3>
|
||||||
{{if session.check_version:}}
|
{{if session.check_version:}}
|
||||||
<p id="check_version">
|
<p id="check_version">
|
||||||
{{=T('Checking for upgrades...')}}
|
{{=T('Checking for upgrades...')}}
|
||||||
|
|||||||
@@ -7,11 +7,14 @@
|
|||||||
<h4/>{{=T('How did you get here?')}}</h4>
|
<h4/>{{=T('How did you get here?')}}</h4>
|
||||||
<ol>
|
<ol>
|
||||||
<li>{{=T('You are successfully running web2py')}}</li>
|
<li>{{=T('You are successfully running web2py')}}</li>
|
||||||
<li>{{=T('You visited the url')}} {{=A(request.env.path_info,_href=request.env.path_info)}}</li>
|
<li>{{=T('You visited the url %s', A(request.env.path_info,_href=request.env.path_info))}}</li>
|
||||||
<li>{{=T('Which called the function')}} {{=A(request.function+'()',_href='#')}} {{=T('located in the file')}}
|
<li>{{=T('Which called the function %s located in the file %s',
|
||||||
{{=A('web2py/applications/%(application)s/controllers/%(controller)s.py'%request,_href=URL('admin','default','peek',args=(request.application,'controllers',request.controller+'.py')))}}</li>
|
(A(request.function+'()',_href='#'),
|
||||||
<li>{{=T('The output of the file is a dictionary that was rendered by the view')}}
|
A('web2py/applications/%(application)s/controllers/%(controller)s.py'%request,
|
||||||
{{=A('web2py/applications/%(application)s/views/%(controller)s/index.html'%request,_href=URL('admin','default','peek',args=(request.application,'views',request.controller,'index.html')))}}</li>
|
_href=URL('admin','default','peek', args=(request.application,'controllers',request.controller+'.py')))))}}</li>
|
||||||
|
<li>{{=T('The output of the file is a dictionary that was rendered by the view %s',
|
||||||
|
A('web2py/applications/%(application)s/views/%(controller)s/index.html'%request,
|
||||||
|
_href=URL('admin','default','peek',args=(request.application,'views',request.controller,'index.html'))))}}</li>
|
||||||
<li>{{=T('You can modify this application and adapt it to your needs')}}</li>
|
<li>{{=T('You can modify this application and adapt it to your needs')}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ from cfs import getcfs
|
|||||||
from thread import allocate_lock
|
from thread import allocate_lock
|
||||||
from html import XML, xmlescape
|
from html import XML, xmlescape
|
||||||
|
|
||||||
|
try:
|
||||||
|
from gluon.html import MARKMIN
|
||||||
|
except ImportError:
|
||||||
|
MARKMIN = None
|
||||||
|
|
||||||
__all__ = ['translator', 'findT', 'update_all_languages']
|
__all__ = ['translator', 'findT', 'update_all_languages']
|
||||||
|
|
||||||
is_gae = settings.global_settings.web2py_runtime_gae
|
is_gae = settings.global_settings.web2py_runtime_gae
|
||||||
|
|||||||
Reference in New Issue
Block a user