Merge pull request #134 from niphlod/issue/admin_refactor

first step to a nicer code style of admin
This commit is contained in:
mdipierro
2013-07-14 12:37:02 -07:00
11 changed files with 816 additions and 1344 deletions
+141 -141
View File
@@ -10,9 +10,9 @@
return files
def editfile(path,file,vars={}):
args=(path,file) if 'app' in vars else (app,path,file)
url = URL('edit', args=args, vars=vars)
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
args=(path,file) if 'app' in vars else (app,path,file)
url = URL('edit', args=args, vars=vars)
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
}}
{{cm=URL('static','codemirror')}}
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
@@ -38,123 +38,123 @@
<link rel="stylesheet" href="{{=cm}}/addon/dialog/dialog.css">
<script src="{{=cm}}/addon/selection/active-line.js"></script>
<script src="{{=cm}}/emmet.min.js"></script>
<script language="Javascript" type="text/javascript" src="{{=URL('static','js/ajax_editor.js')}}"></script>
<script src="{{=URL('static','js/ajax_editor.js')}}"></script>
<link rel="stylesheet" href="{{=URL('static/css','typeahead.js-bootstrap.css')}}">
<link rel="stylesheet" href="{{=URL('static/css','web2py-codemirror.css')}}">
<script language="Javascript" type="text/javascript">
<script type="text/javascript">
var current_theme = "web2py"; //Default theme
var current_font_incr = 0; // Default font-size, 0 means don't set
var current_font_incr = 0; // Default font-size, 0 means don't set
jQuery(document).on('shown click', 'a[data-toggle="tab"]', function (e) {
var tab_id = jQuery(this).attr('href');
var editor = jQuery(tab_id + " textarea").data('editor');
if (editor) {
editor.setSize(jQuery(tab_id).width(), jQuery(tab_id).height());
editor.refresh();
}
//jQuery(function(){jQuery('.CodeMirror-scroll').css("height","auto").css("overflow-x","auto");});
var tab_id = jQuery(this).attr('href');
var editor = jQuery(tab_id + " textarea").data('editor');
if (editor) {
editor.setSize(jQuery(tab_id).width(), jQuery(tab_id).height());
editor.refresh();
}
//jQuery(function(){jQuery('.CodeMirror-scroll').css("height","auto").css("overflow-x","auto");});
});
// Close the selected tab
jQuery(document).on('click', '#filesTab button[class="close"]', function (e) {
var tab_body = jQuery(jQuery(this).parent().attr("href")); // it should be a div
var tab_header = jQuery(this).parent().parent(); // it should be a li
var saved = jQuery(tab_body.find('textarea').data('editor')).data('saved');
var close = true;
if (saved === false) {
close = confirm("You are closing an unsaved file")
}
if (close) {
if (tab_header.hasClass('active') === true) { //Set active an other tab
jQuery(tab_header).prev().children('a[data-toggle="tab"]').tab('show'); // Select first tab
}
tab_header.remove(); //remove li of tab
tab_body.remove(); //remove li of tab
}
var tab_body = jQuery(jQuery(this).parent().attr("href")); // it should be a div
var tab_header = jQuery(this).parent().parent(); // it should be a li
var saved = jQuery(tab_body.find('textarea').data('editor')).data('saved');
var close = true;
if (saved === false) {
close = confirm("You are closing an unsaved file")
}
if (close) {
if (tab_header.hasClass('active') === true) { //Set active an other tab
jQuery(tab_header).prev().children('a[data-toggle="tab"]').tab('show'); // Select first tab
}
tab_header.remove(); //remove li of tab
tab_body.remove(); //remove li of tab
}
});
// Revert current file
jQuery(document).on('click', '#revert', function (e) {
e.preventDefault();
load_file(jQuery(this).attr("href"));
e.preventDefault();
load_file(jQuery(this).attr("href"));
});
// Restore current file
jQuery(document).on('click', '#restore', function (e) {
e.preventDefault();
load_file(jQuery(this).attr("href"));
e.preventDefault();
load_file(jQuery(this).attr("href"));
});
// open the selected file
jQuery(document).on('click', 'a.editor_filelink', function (e) {
e.preventDefault();
var url = jQuery(this).attr("href");
load_file(url);
e.preventDefault();
var url = jQuery(this).attr("href");
load_file(url);
});
// change the codemirror theme
jQuery(document).on('click', '#themes a', function (e) {
e.preventDefault();
var href = jQuery(this).attr('href');
var name = jQuery(this).text().replace('.css', '');
var link = jQuery("<link>");
link.attr({
type: 'text/css',
rel: 'stylesheet',
href: href
});
jQuery("head").append( link );
jQuery('textarea[name="data"]') .each(function(id, ta) {
editor = jQuery(ta).data('editor');
editor.setOption("theme", name);
});
jQuery('#themeName').html(name);
current_theme = name;
e.preventDefault();
var href = jQuery(this).attr('href');
var name = jQuery(this).text().replace('.css', '');
var link = jQuery("<link>");
link.attr({
type: 'text/css',
rel: 'stylesheet',
href: href
});
jQuery("head").append( link );
jQuery('textarea[name="data"]') .each(function(id, ta) {
editor = jQuery(ta).data('editor');
editor.setOption("theme", name);
});
jQuery('#themeName').html(name);
current_theme = name;
//#TODO save on session
});
// incr/decr editor font-size
jQuery(document).on('click', 'a.font_button', function (e) {
e.preventDefault();
var id = jQuery(this).attr('id');
var new_font_incr;
switch (id) {
case 'incr': new_incr = 2; break;
case 'decr': new_incr = -2; break;
case 'default': new_incr = 0; break;
}
jQuery('textarea[name="data"]') .each(function(id, ta) {
editor = jQuery(ta).data('editor');
set_font(editor, new_incr);
});
current_font_incr = (new_incr !== 0) ? current_font_incr + new_incr : 0;
e.preventDefault();
var id = jQuery(this).attr('id');
var new_font_incr;
switch (id) {
case 'incr': new_incr = 2; break;
case 'decr': new_incr = -2; break;
case 'default': new_incr = 0; break;
}
jQuery('textarea[name="data"]') .each(function(id, ta) {
editor = jQuery(ta).data('editor');
set_font(editor, new_incr);
});
current_font_incr = (new_incr !== 0) ? current_font_incr + new_incr : 0;
});
function isFullScreen(instance) {
return /\bCodeMirror-fullscreen\b/.test(instance.getWrapperElement().className);
}
function winHeight() {
return window.innerHeight || (document.documentElement || document.body).clientHeight;
}
function setFullScreen(instance, full) {
var wrap = instance.getWrapperElement()
if (full) {
wrap.className += " CodeMirror-fullscreen";
wrap.style.height = winHeight() + "px";
document.documentElement.style.overflow = "hidden";
} else {
wrap.className = wrap.className.replace(" CodeMirror-fullscreen", "");
wrap.style.height = "";
document.documentElement.style.overflow = "";
}
instance.refresh();
}
CodeMirror.on(window, "resize", function() {
var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0];
if (!showing) return;
showing.CodeMirror.getWrappererElement().style.height = winHeight() + "px";
});
function isFullScreen(instance) {
return /\bCodeMirror-fullscreen\b/.test(instance.getWrapperElement().className);
}
function winHeight() {
return window.innerHeight || (document.documentElement || document.body).clientHeight;
}
function setFullScreen(instance, full) {
var wrap = instance.getWrapperElement()
if (full) {
wrap.className += " CodeMirror-fullscreen";
wrap.style.height = winHeight() + "px";
document.documentElement.style.overflow = "hidden";
} else {
wrap.className = wrap.className.replace(" CodeMirror-fullscreen", "");
wrap.style.height = "";
document.documentElement.style.overflow = "";
}
instance.refresh();
}
CodeMirror.on(window, "resize", function() {
var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0];
if (!showing) return;
showing.CodeMirror.getWrappererElement().style.height = winHeight() + "px";
});
{{if len(request.args) > 1:}}
load_file('{{=URL(f='edit', args=request.args, vars=request.get_vars)}}');
{{pass}}
{{if len(request.args) > 1:}}
load_file('{{=URL(f='edit', args=request.args, vars=request.get_vars)}}');
{{pass}}
</script>
@@ -167,17 +167,17 @@ jQuery(document).on('click', 'a.font_button', function (e) {
<a class="button btn" onclick="jQuery('#files').toggle(); return false" href="#">Files toggle</a>
</div>
<div class="dropdown btn-group pull-left">
<a class="dropdown-toggle button btn" data-target="themes" data-toggle="dropdown" href="#" >Theme: <span id="themeName" style="color: #E8953C">Web2py</span> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" id="themes">
{{for f in listfiles('admin', "static/codemirror/theme", regexp='.*\.css$' ):}}
<li class=""><a href="{{=URL('static/codemirror/theme', f, host=True)}}">{{=f[:-4]}}</a></li>
{{pass}}
</ul>
<a class="dropdown-toggle button btn" data-target="themes" data-toggle="dropdown" href="#" >Theme: <span id="themeName" style="color: #E8953C">Web2py</span> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" id="themes">
{{for f in listfiles('admin', "static/codemirror/theme", regexp='.*\.css$' ):}}
<li class=""><a href="{{=URL('static/codemirror/theme', f, host=True)}}">{{=f[:-4]}}</a></li>
{{pass}}
</ul>
</div>
<div class="btn-group">
<a id="decr" class="button btn font_button">-</a>
<a id="default" class="button btn font_button" >A</a>
<a id="incr" class="button btn font_button">+</a>
<a id="decr" class="button btn font_button">-</a>
<a id="default" class="button btn font_button" >A</a>
<a id="incr" class="button btn font_button">+</a>
</div>
<div class="btn-group">
{{=button(URL('design',args=request.vars.app if request.vars.app else request.args[0], anchor=request.vars.id), T('back'))}}
@@ -190,52 +190,52 @@ jQuery(document).on('click', 'a.font_button', function (e) {
</div>
<div id="editor_area" class="row-fluid">
<div id="files">
<ul class="nav nav-list span2 well" rel="pagebookmark" id="filelist">
<li><input type="text" placeholder="{{=T('Rapid Search')}}" class="input-block-level typeahead-tw search-query"></li>
{{dirs=[{'name':'models', 'reg':'.*\.py$'},
{'name':'controllers', 'reg':'.*\.py$'},
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
{'name':'modules', 'reg':'.*\.py$'},
{'name':'private', 'reg': '[^\.#].*'}]}}
{{auto_complete_list=[]}}
{{for dir in dirs:}}
<li class="nav-header component" onclick="collapse('{{="%s_files" % dir['name']}}');">{{=dir['name']}}</li>
<li id="{{="%s_files" % dir['name']}}">
<ul class="nav nav-list small-font">
{{for f in listfiles(app, dir['name'], regexp=dir['reg'] ):}}
{{id="%s__" % dir['name'] + f.replace('.','__')}}
{{current_file = request.args(len(request.args) - 1)}}
<li class="{{#='active' if current_file==f else ''}}" style="overflow:hidden">
{{a_tag=editfile(dir['name'], f, dict(id=id))}}
{{=a_tag}}
{{auto_complete_list.append({'value':f, 'tokens':f.split('/'), 'a_tag':a_tag})}}
</li>
{{pass}}
</ul>
</li>
{{pass}}
</ul>
</div>
<div class="span10" id="edit_placeholder">
<ul class="nav nav-tabs " id="filesTab">
</ul>
<div id="myTabContent" class="tab-content">
</div>
</div>
<ul class="nav nav-list span2 well" rel="pagebookmark" id="filelist">
<li><input type="text" placeholder="{{=T('Rapid Search')}}" class="input-block-level typeahead-tw search-query"></li>
{{dirs=[{'name':'models', 'reg':'.*\.py$'},
{'name':'controllers', 'reg':'.*\.py$'},
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
{'name':'modules', 'reg':'.*\.py$'},
{'name':'private', 'reg': '[^\.#].*'}]}}
{{auto_complete_list=[]}}
{{for dir in dirs:}}
<li class="nav-header component" onclick="collapse('{{="%s_files" % dir['name']}}');">{{=dir['name']}}</li>
<li id="{{="%s_files" % dir['name']}}">
<ul class="nav nav-list small-font">
{{for f in listfiles(app, dir['name'], regexp=dir['reg'] ):}}
{{id="%s__" % dir['name'] + f.replace('.','__')}}
{{current_file = request.args(len(request.args) - 1)}}
<li class="{{#='active' if current_file==f else ''}}" style="overflow:hidden">
{{a_tag=editfile(dir['name'], f, dict(id=id))}}
{{=a_tag}}
{{auto_complete_list.append({'value':f, 'tokens':f.split('/'), 'a_tag':a_tag})}}
</li>
{{pass}}
</ul>
</li>
{{pass}}
</ul>
</div>
<div class="span10" id="edit_placeholder">
<ul class="nav nav-tabs " id="filesTab">
</ul>
<div id="myTabContent" class="tab-content">
</div>
</div>
</div>
<!-- Typeahead scripts here so the page load faster -->
<script src="{{=URL('static/js', 'typeahead.min.js')}}"></script>
<script src="{{=URL('static/js', 'hogan-2.0.0.js')}}"></script>
<script>
jQuery('.typeahead-tw').typeahead({
name: 'files',
local:{{from gluon.serializers import json}}{{=XML(json(auto_complete_list))}},
template: template_js,
engine: Hogan,
});
jQuery(document).on("typeahead:selected", '.typeahead', function(e, datum) {
load_file(datum.link);
jQuery(this).val('');
});
jQuery('.typeahead-tw').typeahead({
name: 'files',
local:{{from gluon.serializers import json}}{{=XML(json(auto_complete_list))}},
template: template_js,
engine: Hogan,
});
jQuery(document).on("typeahead:selected", '.typeahead', function(e, datum) {
load_file(datum.link);
jQuery(this).val('');
});
</script>
<!-- end "edit" block -->
+137 -137
View File
@@ -4,168 +4,168 @@
<form action="{{=URL('edit', args=filename)}}" method="post" name="editform" id="editform" class="form-inline row-fluid">
<div class="span12 well well-small">
<label class="">{{=T('Save file:')}}</label>
<a value="save" title="{{=T('Save file: %s', filename)}}" href="#" name="save" onclick="return doClickSave();" class="icon saveicon" style="background-image: -webkit-linear-gradient(top,white,#E6E6E6);">{{=IMG(_src=URL('static', 'images/save_icon.png'), _alt=T('Save'))}}</a>
<label class="">{{=T('Saved file hash:')}}</label>
<input type="input" name="file_hash" value="{{=file_hash}}" class="input-long uneditable-input" readonly="readonly"/>
<label>{{=T('Last saved on:')}}</label>
<input type="input" name="saved_on" value="{{=saved_on}}" class="input-normal uneditable-input" readonly="readonly"/>
<label class="">{{=T('Save file:')}}</label>
<a value="save" title="{{=T('Save file: %s', filename)}}" href="#" name="save" onclick="return doClickSave();" class="icon saveicon" style="background-image: -webkit-linear-gradient(top,white,#E6E6E6);">{{=IMG(_src=URL('static', 'images/save_icon.png'), _alt=T('Save'))}}</a>
<label class="">{{=T('Saved file hash:')}}</label>
<input type="input" name="file_hash" value="{{=file_hash}}" class="input-long uneditable-input" readonly="readonly"/>
<label>{{=T('Last saved on:')}}</label>
<input type="input" name="saved_on" value="{{=saved_on}}" class="input-normal uneditable-input" readonly="readonly"/>
{{if filetype=='python':}}
{{=A(SPAN(T('toggle breakpoint')),
_value="breakpoint", _name="breakpoint",
_onclick="return doToggleBreakpoint('%s','%s://%s%s',null);" % (filename,
_onclick="return doToggleBreakpoint('%s','%s://%s%s',null);" % (filename,
request.env['wsgi_url_scheme'], request.env['http_host'],
URL(c='debug', f='toggle_breakpoint')),
_class="button special btn btn-inverse")}}
{{pass}}
{{pass}}
{{if view_link:}}
{{=button(view_link, T('try view'))}}
{{=button(view_link, T('try view'))}}
{{pass}}
<p class="formfield">
{{if functions:}}
<span style="text-align:left;" class="exposed">
{{=B(T('exposes:'))}} {{=XML(', '.join([A(f,_target="_blank", _href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}}
</span>
<span style="text-align:left;" class="exposed">
{{=B(T('exposes:'))}} {{=XML(', '.join([A(f,_target="_blank", _href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}}
</span>
{{if editviewlinks:}}<br/>
{{=B(T('edit views:'))}}
{{=XML(', '.join([v.xml() for v in editviewlinks]))}}
{{=B(T('edit views:'))}}
{{=XML(', '.join([v.xml() for v in editviewlinks]))}}
{{pass}}
{{pass}}
{{if edit_controller:}}
{{=B(T('edit controller:'))}}
{{=A(request.args[2]+'.py', _class="editor_filelink", _target="_blank", _href=edit_controller)}}
{{=B(T('edit controller:'))}}
{{=A(request.args[2]+'.py', _class="editor_filelink", _target="_blank", _href=edit_controller)}}
{{pass}}
</p>
</div>
<textarea style=" height:100%; direction:ltr;" id="textarea_{{=id}}" class="input-block-level" name="data" >{{=data}}</textarea>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("textarea_{{=id}}"),{
{{if filetype=='html':}}
mode : "text/html",
profile: 'xhtml',
{{else:}}
mode: { name: '{{=filetype}}'{{if filetype=='python':}},version: 2,singleLineStringErrors: false, {{pass}} },
{{pass}}
lineNumbers: true,
indentUnit: 4,
styleActiveLine: true,
autoCloseTags: true,
theme: current_theme,
tabMode: "shift",
lineWrapping: true,
gutters: ["CodeMirror-linenumbers", "breakpoints"],
{{if TEXT_EDITOR_KEYBINDING == 'emacs':}}keyMap: "emacs",{{pass}}
{{if TEXT_EDITOR_KEYBINDING == 'vi':}}keyMap: "vim",{{pass}}
matchBrackets: true,
autofocus: false,
height: "350px",
showTrailingSpace: true
});
editor.on("gutterClick", function(cm, n) {
var info = cm.lineInfo(n);
cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
sel = {start: n, end: n, data: ''};
doToggleBreakpoint({{=XML("'%s','%s://%s%s'" % (filename,
request.env['wsgi_url_scheme'], request.env['http_host'],
URL(c='debug', f='toggle_breakpoint')))}}, sel);
});
function makeMarker() {
var marker = document.createElement("div");
marker.style.color = "#822";
marker.innerHTML = "●";
marker.className = "breakpoint";
return marker;
}
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("textarea_{{=id}}"),{
{{if filetype=='html':}}
mode : "text/html",
profile: 'xhtml',
{{else:}}
mode: { name: '{{=filetype}}'{{if filetype=='python':}},version: 2,singleLineStringErrors: false, {{pass}} },
{{pass}}
lineNumbers: true,
indentUnit: 4,
styleActiveLine: true,
autoCloseTags: true,
theme: current_theme,
tabMode: "shift",
lineWrapping: true,
gutters: ["CodeMirror-linenumbers", "breakpoints"],
{{if TEXT_EDITOR_KEYBINDING == 'emacs':}}keyMap: "emacs",{{pass}}
{{if TEXT_EDITOR_KEYBINDING == 'vi':}}keyMap: "vim",{{pass}}
matchBrackets: true,
autofocus: false,
height: "350px",
showTrailingSpace: true
});
{{if filetype=='html':}}
// must be here or break emmet/zencoding for html
CodeMirror.defaults.extraKeys["Ctrl-S"] =
function(instance) {
doClickSave();};
CodeMirror.defaults.extraKeys["Ctrl-F11"]=
function(instance) {
setFullScreen(instance, !isFullScreen(instance));};
CodeMirror.defaults.extraKeys["Tab"] = "indentMore";
CodeMirror.defaults.extraKeys["Esc"]=
function(instance) {
if (isFullScreen(instance)) {
setFullScreen(instance, false);};}
{{pass}}
{{if filetype=='python':}}
// must be here or break emmet/zencoding for python
CodeMirror.defaults.extraKeys["Ctrl-S"] =
function(instance) {
doClickSave();};
CodeMirror.defaults.extraKeys["Ctrl-Space"] =
"autocomplete";
CodeMirror.defaults.extraKeys["Ctrl-F11"]=
function(instance) {
setFullScreen(instance, !isFullScreen(instance));};
CodeMirror.defaults.extraKeys["Tab"] = "indentMore";
CodeMirror.defaults.extraKeys["Esc"]=
function(instance) {
if (isFullScreen(instance)) {
setFullScreen(instance, false);};}
//for autocomplete
CodeMirror.commands.autocomplete = function(cm) {
editor.on("gutterClick", function(cm, n) {
var info = cm.lineInfo(n);
cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
sel = {start: n, end: n, data: ''};
doToggleBreakpoint({{=XML("'%s','%s://%s%s'" % (filename,
request.env['wsgi_url_scheme'], request.env['http_host'],
URL(c='debug', f='toggle_breakpoint')))}}, sel);
});
function makeMarker() {
var marker = document.createElement("div");
marker.style.color = "#822";
marker.innerHTML = "●";
marker.className = "breakpoint";
return marker;
}
{{if filetype=='html':}}
// must be here or break emmet/zencoding for html
CodeMirror.defaults.extraKeys["Ctrl-S"] =
function(instance) {
doClickSave();};
CodeMirror.defaults.extraKeys["Ctrl-F11"]=
function(instance) {
setFullScreen(instance, !isFullScreen(instance));};
CodeMirror.defaults.extraKeys["Tab"] = "indentMore";
CodeMirror.defaults.extraKeys["Esc"]=
function(instance) {
if (isFullScreen(instance)) {
setFullScreen(instance, false);};}
{{pass}}
{{if filetype=='python':}}
// must be here or break emmet/zencoding for python
CodeMirror.defaults.extraKeys["Ctrl-S"] =
function(instance) {
doClickSave();};
CodeMirror.defaults.extraKeys["Ctrl-Space"] =
"autocomplete";
CodeMirror.defaults.extraKeys["Ctrl-F11"]=
function(instance) {
setFullScreen(instance, !isFullScreen(instance));};
CodeMirror.defaults.extraKeys["Tab"] = "indentMore";
CodeMirror.defaults.extraKeys["Esc"]=
function(instance) {
if (isFullScreen(instance)) {
setFullScreen(instance, false);};}
//for autocomplete
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.pythonHint);
}
{{pass}}
store_changes_function = function(instance, changeObj) {
jQuery(instance).data('saved', false);
instance.off("change", store_changes_function);
}
editor.on("change", store_changes_function);
// save the editor as textarea data attribute
jQuery("#{{=id}} textarea").data('editor', editor);
var hlLine = editor.addLineClass(0, "background", "activeline");
window.mirror = editor; //backward compatibility
set_font(editor, current_font_incr);
doListBreakpoints({{=XML("'%s','%s://%s%s'" % (filename,
request.env['wsgi_url_scheme'], request.env['http_host'],
URL(c='debug', f='list_breakpoints')))}}, editor);
{{pass}}
store_changes_function = function(instance, changeObj) {
jQuery(instance).data('saved', false);
instance.off("change", store_changes_function);
}
editor.on("change", store_changes_function);
// save the editor as textarea data attribute
jQuery("#{{=id}} textarea").data('editor', editor);
var hlLine = editor.addLineClass(0, "background", "activeline");
window.mirror = editor; //backward compatibility
set_font(editor, current_font_incr);
doListBreakpoints({{=XML("'%s','%s://%s%s'" % (filename,
request.env['wsgi_url_scheme'], request.env['http_host'],
URL(c='debug', f='list_breakpoints')))}}, editor);
</script>
<div class="editor-bar-bottom" style="margin-top:9px;">
<a class="editbutton btn" href="{{=URL('edit', args=request.args, vars={'restore':True})}}" id="restore">{{=T('restore')}}</a>
{{=T('currently saved or')}}
<a class="editbutton btn" href="{{=URL('edit', args=request.args, vars={'revert':True})}}" id="revert">{{=T('revert')}}</a>
{{=T('to previous version.')}}
</div>
</script>
<div class="editor-bar-bottom" style="margin-top:9px;">
<a class="editbutton btn" href="{{=URL('edit', args=request.args, vars={'restore':True})}}" id="restore">{{=T('restore')}}</a>
{{=T('currently saved or')}}
<a class="editbutton btn" href="{{=URL('edit', args=request.args, vars={'revert':True})}}" id="revert">{{=T('revert')}}</a>
{{=T('to previous version.')}}
</div>
<br/>
</form>
<div class="row-fluid">
<div class="help alert alert-block alert-info">
{{if TEXT_EDITOR == 'codemirror' and filetype=='html':}}
<h3>{{=T('Key bindings for ZenCoding Plugin')}}</h3>
<ul class="keybindings unstyled">
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
{{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}}
{{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}}
{{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}}
{{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}}
{{=shortcut('Shift-Ctrl-F / Cmd-Option-F', T('Replace'))}}
{{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}}
{{=shortcut('Tab', T('Expand Abbreviation'))}}
</ul>
{{elif TEXT_EDITOR == 'codemirror':}}
<h3>{{=T("Key bindings")}}</h3>
<ul class="keybindings unstyled">
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
{{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}}
{{if filetype=='python':}}
{{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}}
{{pass}}
{{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}}
{{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}}
{{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}}
{{=shortcut('Shift-Ctrl-F / Cmd-Option-F', T('Replace'))}}
{{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}}
</ul>
{{pass}}
</div>
<div class="help alert alert-block alert-info">
{{if TEXT_EDITOR == 'codemirror' and filetype=='html':}}
<h3>{{=T('Key bindings for ZenCoding Plugin')}}</h3>
<ul class="keybindings unstyled">
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
{{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}}
{{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}}
{{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}}
{{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}}
{{=shortcut('Shift-Ctrl-F / Cmd-Option-F', T('Replace'))}}
{{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}}
{{=shortcut('Tab', T('Expand Abbreviation'))}}
</ul>
{{elif TEXT_EDITOR == 'codemirror':}}
<h3>{{=T("Key bindings")}}</h3>
<ul class="keybindings unstyled">
{{=shortcut('Ctrl+S', T('Save via Ajax'))}}
{{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}}
{{if filetype=='python':}}
{{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}}
{{pass}}
{{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}}
{{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}}
{{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}}
{{=shortcut('Shift-Ctrl-F / Cmd-Option-F', T('Replace'))}}
{{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}}
</ul>
{{pass}}
</div>
</div>
@@ -7,7 +7,7 @@ function delkey(id) {
return false;
}
function hideShowTranslated(){
jQuery(".translated").closest("div.row-fluid").toggle();
jQuery(".translated").closest("div.row-fluid").toggle();
}
</script>
+112 -112
View File
@@ -3,122 +3,122 @@
{{block sectionclass}}errors{{end}}
<!-- begin "errors" block -->
{{if db_ready['status'] == False:
switchbutton = A(SPAN("switch to : db"), _href=db_ready['errlink'], _class="button unavailable btn btn-danger", _title="%s" % (db_ready['errmessage']))
switchbutton = A(SPAN("switch to : db"), _href=db_ready['errlink'], _class="button unavailable btn btn-danger", _title="%s" % (db_ready['errmessage']))
else:
switchbutton = A(SPAN("switch to : db"), _href=URL(args=[app, 'dbnew']), _class="button btn")
switchbutton = A(SPAN("switch to : db"), _href=URL(args=[app, 'dbnew']), _class="button btn")
pass}}
<h2>{{=T('Error logs for "%(app)s"',dict(app=app))}}</h2>
<div class="errorform">
<form name="myform" method="post">
{{ if 'new' in method: }}
{{base_url = 'db' in method and 'ticketdb' or 'ticket' }}
<p class="controls row-fluid">
<div class="controls controls-row">
{{if 'db' in method:}}
<span class="uneditable-input">source : db</span>
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>switch to : filesystem</span></a>
<a class="button btn" href="{{=URL(args=[app, 'dbold'])}}"><span>lists by ticket</span></a>
{{else:}}
<span class="uneditable-input">source : filesystem</span>
{{=switchbutton}}
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>lists by ticket</span></a>
{{pass}}
</div>
</p>
<div class="tablebar">
<input value="{{=T('delete all checked')}}" type="submit" class="btn"/>
<span class="help label label-info">{{=T('Click row to expand traceback')}}</span>
</div>
<div class="row-fluid">
<div class="span6">
<table id="trck_errors" class="sortable table table-hover table-condensed">
<thead>
<tr>
<th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th>
<th class="column2">{{=T("Count")}}</th>
<th class="column3">{{=T("File")}}</th>
<th>{{=T("Error")}}</th>
<th class="columnN"></th>
</tr>
</thead>
<tbody>
{{for e in errors:}}
<tr class="error_ticket">
<td class="cbcentered"><input type="checkbox" name="delete_{{=e['hash']}}" /></td>
<td>{{=e['count']}}</td>
<td>{{=e['causer']}}</td>
<td>{{=A(e['last_line'],_href="#",_onclick="collapse('%s');return false;"%e['hash'])}}</td>
<td>+&nbsp;{{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}</td>
</tr>
<tr id="{{=e['hash']}}" class="traceback">
<td colspan="5">
<div class="ticket_code">
{{=CODE(e['pickel']['traceback'])}}
</div>
</td>
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
{{ else: }}
<p class="controls row-fluid">
<div class="controls controls-row">
{{if 'db' in method:}}
<span class="uneditable-input">source : db</span>
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>switch to : filesystem</span></a>
<a class="button btn" href="{{=URL(args=[app, 'dbnew'])}}"><span>lists by exception</span></a>
{{else:}}
<span class="uneditable-input">source : filesystem</span>
{{=switchbutton}}
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>lists by exception</span></a>
{{pass}}
</div>
</p>
<div class="tablebar">
<input value="{{=T('delete all checked')}}" type="submit" class="btn"/>
<span class="help label label-info">{{=T('Click row to expand traceback')}}</span>
</div>
<div class="row-fluid">
<div class="span6">
<table id="trck_errors" class="sortable table table-hover table-condensed">
<thead>
<tr>
<th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th>
<th>{{=T("Ticket")}}</th>
<th class="columnN1">{{=T("Date and Time")}}</th>
</tr>
</thead>
<tbody>
{{for ticket in tickets:}}
<tr>
<td class="cbcentered"><input type="checkbox" name="delete_{{=ticket}}"/></td>
{{if 'db' in method:}}
<td><a href="{{=URL('ticketdb',args=[app,ticket])}}">{{=ticket}}</a></td>
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}</td>
{{else:}}
<td><a href="{{=URL('ticket',args=[app,ticket])}}">{{=ticket}}</a></td>
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(os.stat(os.path.join(request.folder,'../%s/errors/%s' % (app,ticket)))[stat.ST_CTIME]))}}</td>
{{pass}}
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
{{ pass }}
</form><!-- /errorform -->
<form name="myform" method="post">
{{ if 'new' in method: }}
{{base_url = 'db' in method and 'ticketdb' or 'ticket' }}
<p class="controls row-fluid">
<div class="controls controls-row">
{{if 'db' in method:}}
<span class="uneditable-input">source : db</span>
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>switch to : filesystem</span></a>
<a class="button btn" href="{{=URL(args=[app, 'dbold'])}}"><span>lists by ticket</span></a>
{{else:}}
<span class="uneditable-input">source : filesystem</span>
{{=switchbutton}}
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>lists by ticket</span></a>
{{pass}}
</div>
</p>
<div class="tablebar">
<input value="{{=T('delete all checked')}}" type="submit" class="btn"/>
<span class="help label label-info">{{=T('Click row to expand traceback')}}</span>
</div>
<div class="row-fluid">
<div class="span6">
<table id="trck_errors" class="sortable table table-hover table-condensed">
<thead>
<tr>
<th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th>
<th class="column2">{{=T("Count")}}</th>
<th class="column3">{{=T("File")}}</th>
<th>{{=T("Error")}}</th>
<th class="columnN"></th>
</tr>
</thead>
<tbody>
{{for e in errors:}}
<tr class="error_ticket">
<td class="cbcentered"><input type="checkbox" name="delete_{{=e['hash']}}" /></td>
<td>{{=e['count']}}</td>
<td>{{=e['causer']}}</td>
<td>{{=A(e['last_line'],_href="#",_onclick="collapse('%s');return false;"%e['hash'])}}</td>
<td>+&nbsp;{{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}</td>
</tr>
<tr id="{{=e['hash']}}" class="traceback">
<td colspan="5">
<div class="ticket_code">
{{=CODE(e['pickel']['traceback'])}}
</div>
</td>
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
{{ else: }}
<p class="controls row-fluid">
<div class="controls controls-row">
{{if 'db' in method:}}
<span class="uneditable-input">source : db</span>
<a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>switch to : filesystem</span></a>
<a class="button btn" href="{{=URL(args=[app, 'dbnew'])}}"><span>lists by exception</span></a>
{{else:}}
<span class="uneditable-input">source : filesystem</span>
{{=switchbutton}}
<a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>lists by exception</span></a>
{{pass}}
</div>
</p>
<div class="tablebar">
<input value="{{=T('delete all checked')}}" type="submit" class="btn"/>
<span class="help label label-info">{{=T('Click row to expand traceback')}}</span>
</div>
<div class="row-fluid">
<div class="span6">
<table id="trck_errors" class="sortable table table-hover table-condensed">
<thead>
<tr>
<th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th>
<th>{{=T("Ticket")}}</th>
<th class="columnN1">{{=T("Date and Time")}}</th>
</tr>
</thead>
<tbody>
{{for ticket in tickets:}}
<tr>
<td class="cbcentered"><input type="checkbox" name="delete_{{=ticket}}"/></td>
{{if 'db' in method:}}
<td><a href="{{=URL('ticketdb',args=[app,ticket])}}">{{=ticket}}</a></td>
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}</td>
{{else:}}
<td><a href="{{=URL('ticket',args=[app,ticket])}}">{{=ticket}}</a></td>
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(os.stat(os.path.join(request.folder,'../%s/errors/%s' % (app,ticket)))[stat.ST_CTIME]))}}</td>
{{pass}}
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
{{ pass }}
</form><!-- /errorform -->
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('.traceback').hide();
jQuery("#trck_errors thead tr th:first input[type=checkbox]").click(function() {
var checkedStatus = this.checked;
jQuery("#trck_errors tbody tr td:first-child input[type=checkbox]").each(function() {
this.checked = checkedStatus;
});
});
});
jQuery(document).ready(function() {
jQuery('.traceback').hide();
jQuery("#trck_errors thead tr th:first input[type=checkbox]").click(function() {
var checkedStatus = this.checked;
jQuery("#trck_errors tbody tr td:first-child input[type=checkbox]").each(function() {
this.checked = checkedStatus;
});
});
});
</script>
<!-- end "errors" block -->
<!-- end "errors" block -->
@@ -9,18 +9,18 @@
<ul class="collapsible">
{{for file in files[path]['files']:}}
<li style="list-style-type: none;">
{{p = os.path.relpath(os.path.join(path,file),base)}}
<input type="checkbox" value="{{=p}}" name="file" checked="checked"/>
{{=file}}
{{p = os.path.relpath(os.path.join(path,file),base)}}
<input type="checkbox" value="{{=p}}" name="file" checked="checked"/>
{{=file}}
</li>
{{pass}}
{{for dir in files[path]['folders']:}}
<li style="list-style-type: none;">
{{tree(os.path.join(path,dir))}}
{{tree(os.path.join(path,dir))}}
</li>
{{pass}}
</ul>
{{return}}
</ul>
{{return}}
<form action="{{=URL(args=request.args)}}" method="POST">
<h2>{{=T('Select Files to Package')}}</h2>
+107 -108
View File
@@ -7,57 +7,57 @@
<div class="applist_inner">
<h2>{{=T("Installed applications")}}</h2>
<table width="100%" class="table">
{{for a in apps:}}
<tr>{{buttons = []}}
<td>
{{if a==request.application:}}
<h4 class="currentapp">{{=a}} ({{=T('currently running')}})</h4>
{{else:}}
<h4 class="editableapp">{{=A(a,_href=URL(a,'default','index'))}}</h4>
{{if MULTI_USER_MODE and db.app(name=a):}}(created by {{="%(first_name)s %(last_name)s" % db.auth_user[db.app(name=a).owner]}}){{pass}}
{{if not os.path.exists('applications/%s/compiled' % a):}}
{{buttons.append((URL('design',args=a), T("Edit")))}}
{{else:}}
{{buttons.append((URL(a,'appadmin','index'), T("appadmin")))}}
{{pass}}
{{buttons.append((URL('about',args=a), T("About")))}}
{{pass}}
{{buttons.append((URL('errors',args=a), T("Errors")))}}
{{buttons.append((URL('cleanup',args=a), T("Clean")))}}
{{buttons.append((URL('pack',args=a), T("Pack all")))}}
{{buttons.append((URL('pack_custom',args=a), T("Pack custom")))}}
{{if not os.path.exists('applications/%s/compiled' % a):}}
{{for a in apps:}}
<tr>{{buttons = []}}
<td>
{{if a==request.application:}}
<h4 class="currentapp">{{=a}} ({{=T('currently running')}})</h4>
{{else:}}
<h4 class="editableapp">{{=A(a,_href=URL(a,'default','index'))}}</h4>
{{if MULTI_USER_MODE and db.app(name=a):}}(created by {{="%(first_name)s %(last_name)s" % db.auth_user[db.app(name=a).owner]}}){{pass}}
{{if not os.path.exists('applications/%s/compiled' % a):}}
{{buttons.append((URL('design',args=a), T("Edit")))}}
{{else:}}
{{buttons.append((URL(a,'appadmin','index'), T("appadmin")))}}
{{pass}}
{{buttons.append((URL('about',args=a), T("About")))}}
{{pass}}
{{buttons.append((URL('errors',args=a), T("Errors")))}}
{{buttons.append((URL('cleanup',args=a), T("Clean")))}}
{{buttons.append((URL('pack',args=a), T("Pack all")))}}
{{buttons.append((URL('pack_custom',args=a), T("Pack custom")))}}
{{if not os.path.exists('applications/%s/compiled' % a):}}
{{buttons.append((URL('compile_app',args=a), T("Compile")))}}
{{else:}}
{{buttons.append((URL('pack',args=(a, 'compiled')), T("Pack compiled")))}}
{{if glob.glob('applications/%s/controllers/*.py' % a):}}
{{buttons.append((URL('remove_compiled_app',args=a), T("Remove compiled")))}}
{{pass}}
{{pass}}
{{if os.path.exists(os.path.join(apath(r=request),a,'.git')): }}
{{buttons.append((URL('git_pull',args=a), T("Git Pull")))}}
{{buttons.append((URL('git_push',args=a), T("Git Push")))}}
{{pass}}
{{if a!=request.application:}}
{{buttons.append((URL('uninstall',args=a), T("Uninstall")))}}
{{pass}}
</td>
<td>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
{{=T('Manage')}}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{{for link,name in buttons:}}
{{=LI(A(name,_href=link))}}
{{pass}}
</ul>
</div>
{{=button_enable(URL('enable',args=a), a)}}
</td>
</tr>
{{pass}}
{{else:}}
{{buttons.append((URL('pack',args=(a, 'compiled')), T("Pack compiled")))}}
{{if glob.glob('applications/%s/controllers/*.py' % a):}}
{{buttons.append((URL('remove_compiled_app',args=a), T("Remove compiled")))}}
{{pass}}
{{pass}}
{{if os.path.exists(os.path.join(apath(r=request),a,'.git')): }}
{{buttons.append((URL('git_pull',args=a), T("Git Pull")))}}
{{buttons.append((URL('git_push',args=a), T("Git Push")))}}
{{pass}}
{{if a!=request.application:}}
{{buttons.append((URL('uninstall',args=a), T("Uninstall")))}}
{{pass}}
</td>
<td>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
{{=T('Manage')}}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{{for link,name in buttons:}}
{{=LI(A(name,_href=link))}}
{{pass}}
</ul>
</div>
{{=button_enable(URL('enable',args=a), a)}}
</td>
</tr>
{{pass}}
</table>
</div>
</div> <!-- /applist -->
@@ -65,85 +65,85 @@
<div class="sidebar_inner controls well well-small">
<!-- CHANGE ADMIN PWD -->
<div class="pwdchange pull-right">
{{if MULTI_USER_MODE:}}
{{=auth.navbar()}}
{{else:}}
{{=sp_button(URL('change_password'), T('Change admin password'))}}
{{=button(URL('default','reload_routes'), T('Reload routes'))}}
{{pass}}
{{if MULTI_USER_MODE:}}
{{=auth.navbar()}}
{{else:}}
{{=sp_button(URL('change_password'), T('Change admin password'))}}
{{=button(URL('default','reload_routes'), T('Reload routes'))}}
{{pass}}
</div> <!-- /CHANGE ADMIN PWD -->
{{if is_manager():}}
<!-- VERSION -->
<div class="box">
<h4>{{=T("Version")}}</h4>
<p>
<tt>{{=myversion}}</tt><br/>
({{=T("Running on %s", request.env.server_software)}})
</p>
<p id="check_version" class="row-buttons">
{{if session.check_version:}}
{{=T('Checking for upgrades...')}}
<script>ajax('{{=URL('check_version')}}',[],'check_version');</script>
{{session.check_version=False}}
{{else:}}
{{=button("javascript:ajax('"+URL('check_version')+"',[],'check_version')", T('Check for upgrades'))}}
{{pass}}
</p>
{{if session.is_mobile=='auto':}}
<p>{{=A(T('Try the mobile interface'),_href=URL('plugin_jqmobile','about'))}}</p>
{{pass}}
<h4>{{=T("Version")}}</h4>
<p>
<tt>{{=myversion}}</tt><br/>
({{=T("Running on %s", request.env.server_software)}})
</p>
<p id="check_version" class="row-buttons">
{{if session.check_version:}}
{{=T('Checking for upgrades...')}}
<script>ajax('{{=URL('check_version')}}',[],'check_version');</script>
{{session.check_version=False}}
{{else:}}
{{=button("javascript:ajax('"+URL('check_version')+"',[],'check_version')", T('Check for upgrades'))}}
{{pass}}
</p>
{{if session.is_mobile=='auto':}}
<p>{{=A(T('Try the mobile interface'),_href=URL('plugin_jqmobile','about'))}}</p>
{{pass}}
</div> <!-- /VERSION -->
{{pass}}
{{if MULTI_USER_MODE and is_manager():}}
<!-- MULTI_USER_INTERFACE -->
<div class="box">
<h4>{{=T("Multi User Mode")}}</h4>
<p class="row-buttons">
{{=button(URL('bulk_register'),T('Bulk Register'))}}
{{=button(URL('manage_students',vars={'order':'auth_user.id'}),T('Manage Students'))}}
</p>
<h4>{{=T("Multi User Mode")}}</h4>
<p class="row-buttons">
{{=button(URL('bulk_register'),T('Bulk Register'))}}
{{=button(URL('manage_students',vars={'order':'auth_user.id'}),T('Manage Students'))}}
</p>
</div> <!-- /MULTI_USER_INTERFACE -->
{{pass}}
<!-- SCAFFOLD APP -->
<div class="box">
<h4>{{=T("New simple application")}}</h4>
{{=form_create.custom.begin}}
{{=LABEL(T("Application name:"))}}
{{=form_create.custom.widget.name}}
<div class="controls"><button type="submit" class="btn">{{=T('Create')}}</button></div>
{{=form_create.custom.end}}
<h4>{{=T("New simple application")}}</h4>
{{=form_create.custom.begin}}
{{=LABEL(T("Application name:"))}}
{{=form_create.custom.widget.name}}
<div class="controls"><button type="submit" class="btn">{{=T('Create')}}</button></div>
{{=form_create.custom.end}}
</div> <!-- /SCAFFOLD APP -->
<!-- UPLOAD PACKAGE -->
<div class="box">
<h4>{{=T("Upload and install packed application")}}</h4>
{{=form_update.custom.begin}}
<label for="appupdate_name">{{=T("Application name:")}}</label>
{{=form_update.custom.widget.name}}
<label for="appupdate_file">{{=T("Upload a package:")}}</label>
{{=form_update.custom.widget.file}}
<label for="appupdate_url">{{=T("Or Get from URL:")}}</label>
{{=form_update.custom.widget.url}}<small class="help-block">({{=T('can be a git repo')}})</small>
<div class="controls">
<label class="checkbox">
{{=form_update.custom.widget.overwrite}} {{=T("Overwrite installed app")}}
</label>
<button type="submit" class='btn'>{{=T('Install')}}</button>
</div>
{{=form_update.custom.end}}
<h4>{{=T("Upload and install packed application")}}</h4>
{{=form_update.custom.begin}}
<label for="appupdate_name">{{=T("Application name:")}}</label>
{{=form_update.custom.widget.name}}
<label for="appupdate_file">{{=T("Upload a package:")}}</label>
{{=form_update.custom.widget.file}}
<label for="appupdate_url">{{=T("Or Get from URL:")}}</label>
{{=form_update.custom.widget.url}}<small class="help-block">({{=T('can be a git repo')}})</small>
<div class="controls">
<label class="checkbox">
{{=form_update.custom.widget.overwrite}} {{=T("Overwrite installed app")}}
</label>
<button type="submit" class='btn'>{{=T('Install')}}</button>
</div>
{{=form_update.custom.end}}
</div> <!-- /UPLOAD PACKAGE -->
<!-- DEPLOY ON GAE -->
<div class="box">
<h4>{{=T("Deploy")}}</h4>
<p class="row-buttons">
{{=button(URL('gae','deploy'), T('Deploy on Google App Engine'))}}
{{=button(URL('openshift','deploy'),T('Deploy to OpenShift'))}}
</p>
<h4>{{=T("Deploy")}}</h4>
<p class="row-buttons">
{{=button(URL('gae','deploy'), T('Deploy on Google App Engine'))}}
{{=button(URL('openshift','deploy'),T('Deploy to OpenShift'))}}
</p>
</div> <!-- /DEPLOY ON GAE -->
<!-- APP WIZARD -->
<div class="box">
<h4>{{=T("New application wizard")}}</h4>
<p>{{=button(URL('wizard','index'), T('Start wizard'))}}<br/>
{{=T("(requires internet access, experimental)")}}</p>
<h4>{{=T("New application wizard")}}</h4>
<p>{{=button(URL('wizard','index'), T('Start wizard'))}}<br/>
{{=T("(requires internet access, experimental)")}}</p>
</div> <!-- /APP WIZARD -->
<a class="twitter-timeline" href="https://twitter.com/web2py" data-widget-id="340456915207327745">Tweets by @web2py</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@@ -151,4 +151,3 @@
</div> <!-- /sidebar -->
</div> <!-- /row-fluid
<!-- end "site" block -->
+39 -39
View File
@@ -16,7 +16,7 @@
<tr>
<th>Python</th>
<td>{{=snapshot.get('pyver','')}}</td>
</tr>
</tr>
{{pass}}
</tbody>
</table>
@@ -45,14 +45,14 @@
<div class="inspect">
<h4>{{=T("Exception instance attributes")}}</h4>
<table>
<tbody>
{{for k,v in snapshot['exception'].items():}}
<tr>
<th>{{=k}}</th>
<td>{{=v}}</td>
</tr>
{{pass}}
</tbody>
<tbody>
{{for k,v in snapshot['exception'].items():}}
<tr>
<th>{{=k}}</th>
<td>{{=v}}</td>
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
@@ -65,36 +65,36 @@
<li>
{{is_hidden = (i != len(snapshot['frames'])-1 and 'hide' or 'inspect')}}
<div class="framefile inspect controls">
<p>
<strong>File {{="%s in %s at line %s" % (frame['file'], frame['func'], frame['lnum'])}}</strong>
<a class="button tbbutton btn" onclick="collapse('{{='%s_code_inner' % i}}');"><span>{{=T("code")}}</span></a>
<a class="button tbbutton btn" onclick="collapse('{{='%s_args_inner' % i}}');"><span>{{=T("arguments")}}</span></a>
<a class="button tbbutton btn" onclick="collapse('{{='%s_vars_inner' % i}}');"><span>{{=T("variables")}}</span></a>
</p>
<div id="{{='%s_args_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Function argument list</h5>
<p>{{=frame['call']}}</p>
</div>
<div id="{{='%s_code_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Code listing</h5>
{{if frame['lines']:}}
<pre>{{=CODE('\n'.join([x[1] for x in sorted(frame['lines'].items(),key=lambda x: x[0])]),
language='python', link=None, counter=min(frame['lines'].keys()), highlight_line=frame['lnum'])}}</pre>
{{pass}}
</div>
<div id="{{='%s_vars_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Variables</h5>
<table>
<tbody>
{{for k,v in frame['dump'].items():}}
<tr>
<th>{{=k}}</th>
<td>{{=v}}</td>
</tr>
{{pass}}
</tbody>
</table>
</div>
<p>
<strong>File {{="%s in %s at line %s" % (frame['file'], frame['func'], frame['lnum'])}}</strong>
<a class="button tbbutton btn" onclick="collapse('{{='%s_code_inner' % i}}');"><span>{{=T("code")}}</span></a>
<a class="button tbbutton btn" onclick="collapse('{{='%s_args_inner' % i}}');"><span>{{=T("arguments")}}</span></a>
<a class="button tbbutton btn" onclick="collapse('{{='%s_vars_inner' % i}}');"><span>{{=T("variables")}}</span></a>
</p>
<div id="{{='%s_args_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Function argument list</h5>
<p>{{=frame['call']}}</p>
</div>
<div id="{{='%s_code_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Code listing</h5>
{{if frame['lines']:}}
<pre>{{=CODE('\n'.join([x[1] for x in sorted(frame['lines'].items(),key=lambda x: x[0])]),
language='python', link=None, counter=min(frame['lines'].keys()), highlight_line=frame['lnum'])}}</pre>
{{pass}}
</div>
<div id="{{='%s_vars_inner' % i}}" class="{{=is_hidden}}" style="width:100%;overflow:auto">
<h5>Variables</h5>
<table>
<tbody>
{{for k,v in frame['dump'].items():}}
<tr>
<th>{{=k}}</th>
<td>{{=v}}</td>
</tr>
{{pass}}
</tbody>
</table>
</div>
</div>
</li>
{{pass}}