diff --git a/applications/admin/static/css/web2py-codemirror.css b/applications/admin/static/css/web2py-codemirror.css index 39b5311b..642bb8a6 100644 --- a/applications/admin/static/css/web2py-codemirror.css +++ b/applications/admin/static/css/web2py-codemirror.css @@ -54,3 +54,13 @@ overflow: inherit; border-top: 1px solid #ddd; } + +#editor_main { + margin-top:40px; + margin-bottom:40px; +} + +#editform { + margin-bottom: 0px; +} + diff --git a/applications/admin/views/default/edit.html b/applications/admin/views/default/edit.html index 650752ca..4bdf032b 100644 --- a/applications/admin/views/default/edit.html +++ b/applications/admin/views/default/edit.html @@ -1,3 +1,4 @@ +{{main_id='editor_main'}} {{extend 'layout.html'}} {{ dirs=[{'name':'models', 'reg':'.*\.py$'}, @@ -30,7 +31,7 @@ def file_create_form(location, anchor=None, helptext=""): {{ def shortcut(combo, description): - return XML('
  • %s%s
  • ' % (combo, description)) + return XML('
  • %s%s
  • ' % (combo, description)) def listfiles(app, dir, regexp='.*\.py$'): files = sorted( listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp)) @@ -264,15 +265,17 @@ $(document).on('click', 'a.font_button', function (e) {
    {{=LOAD('default', 'todolist.load', vars={'app':app}, ajax=True, timeout=60000, times="infinity")}}
    +
    + {{include 'default/editor_shortcuts.html'}} +
    {{block footer}} diff --git a/applications/admin/views/default/edit_js.html b/applications/admin/views/default/edit_js.html index 571839b8..9d5aec52 100644 --- a/applications/admin/views/default/edit_js.html +++ b/applications/admin/views/default/edit_js.html @@ -21,21 +21,23 @@ {{if view_link:}} {{=button(view_link, T('try view'))}} {{pass}} -

    -{{if functions:}} - - {{=B(T('exposes:'))}} {{=XML(', '.join([A(f,_target="_blank", _href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}} - -{{if editviewlinks:}}
    - {{=B(T('edit views:'))}} - {{=XML(', '.join([v.xml() for v in editviewlinks]))}} +{{if functions or edit_controller:}} +

    + {{if functions:}} + + {{=B(T('exposes:'))}} {{=XML(', '.join([A(f,_target="_blank", _href=URL(a=app,c=controller,f=f)).xml() for f in functions]))}} + + {{if 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)}} + {{pass}} +

    {{pass}} -{{pass}} -{{if edit_controller:}} - {{=B(T('edit controller:'))}} - {{=A(request.args[2]+'.py', _class="editor_filelink", _target="_blank", _href=edit_controller)}} -{{pass}} -

    @@ -63,7 +65,6 @@ height: "350px", showTrailingSpace: true }); - editor.foldCode(CodeMirror.Pos(8, 0)); editor.on("gutterClick", function(cm, n, gutter) { if (gutter !== "breakpoints" ) return; @@ -152,29 +153,3 @@
    - -
    -
    - {{if filetype=='html':}} -

    {{=T('Key bindings for ZenCoding Plugin')}}

    - {{else:}} -

    {{=T("Key bindings")}}

    - {{pass}} - -
    -
    diff --git a/applications/admin/views/default/editor_shortcuts.html b/applications/admin/views/default/editor_shortcuts.html new file mode 100644 index 00000000..874921f9 --- /dev/null +++ b/applications/admin/views/default/editor_shortcuts.html @@ -0,0 +1,18 @@ +
    +

    {{=T("Keyboard shortcuts")}}

    + +
    + diff --git a/applications/admin/views/layout.html b/applications/admin/views/layout.html index 4f3ab932..fe6ff812 100644 --- a/applications/admin/views/layout.html +++ b/applications/admin/views/layout.html @@ -44,7 +44,7 @@ -
    +
    {{=response.flash or ''}}