Пример #1
0
def get_spec(target, path):
	spec_url = spec.get_url(path)
	log.info('spec url: %s' % spec_url)
	if spec_url:
		return spec_url
	else:
		return '%s?editor' % settings.SPEC_URL_FILE_NAME
Пример #2
0
				else:
					f += '/'
					dirs.append(get_descriptor(f))

	try:
		if tools.get_type(fullpath) == 'virtual':
			contexts = context.global_settings(fullpath).sections()
		else:
			contexts = context.get(fullpath).sections()
		log.debug(contexts)
	except Exception, e:
		log.error(e)
		contexts = []

	favicon = 'dir-index-%s.gif' % tools.get_type(fullpath)
	spec_url = spec.get_url(fullpath)
	
	return Context({
		'directory' : path + '/',
		'type'		: pagetype,
		'file_list' : files,
		'dir_list'  : dirs,
		'contexts'  : contexts,
		'favicon'   : favicon,
		'spec'		: spec_url,
		'spec_name'	: settings.SPEC_URL_FILE_NAME
	})

def get_path(request):
	if request.POST and 'path' in request.POST:
		return request.POST['path']