~yeliabmas/sloecode/wiki_mvp

« back to all changes in this revision

Viewing changes to sloecode/controllers/project.py

  • Committer: Sam Bailey
  • Date: 2012-06-21 01:26:04 UTC
  • Revision ID: yeliabmas@gmail.com-20120621012604-szyme5vkcvtsz0s1
Added view adapter for root resource and source files

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
                log.info("Path: " + path)
215
215
 
216
216
                #Go through the WikkidApp for static files, the favicon or when saving a file
217
 
                if (path.startswith('/static/')) or (path == '/favicon.ico') or (path.endswith('/+save')):
 
217
                if (path.startswith('/static/')) or (adapter is None) or (path.endswith('/+save')):
218
218
                    return app(environ, self.start_response)
219
219
            
220
220
                result = adapter.get_page_fragments(app, environ)
221
221
 
222
 
                return self.render('/project-wiki.html',
 
222
                #Get template location from result['template']
 
223
                return self.render('/wiki/page.html',
223
224
                       {'project': existing_project,
224
225
                        'file': result})
225
226
                    
247
248
            repo = config['bzr.factory'].get_repository_for_project(project_name)
248
249
            branch = repo.get_branch('wiki')
249
250
            if branch is not None:
250
 
                return self.render('/project-wiki-newfile.html',
 
251
                return self.render('/wiki/newfile.html',
251
252
                               {'project': existing_project,
252
253
                                'repo': repo,
253
254
                                'path': path})