~yeliabmas/sloecode/sloecode-template

« back to all changes in this revision

Viewing changes to sloecode/wikkid_view_adapters.py

  • Committer: Sam Bailey
  • Date: 2012-10-30 03:41:50 UTC
  • Revision ID: yeliabmas@gmail.com-20121030034150-o554fsbpuucn7p7i
newfile button on wiki pages now creates a new file at the current directory level. Only provides template options at root directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    view = app.get_view(environ)
53
53
    #Perform any redirects if they need to happen
54
54
    view.before_render()
55
 
    newfile_url = view.canonical_url(view.context.root_resource, 'newfile')
 
55
 
 
56
    parent = view.context.parent if view.context.parent else view.context
 
57
    newfile_url = view.canonical_url(parent, 'newfile')
56
58
    fragments = {
57
59
        'newfile_url': newfile_url,
58
60
    }