예제 #1
0
def toc(request):
    identifier = request.matchdict["id"]
    client = Client(identifier)
    tools_dicts = get_tools(request, client, value=True)
    resources_url = route_url('resources', request, **request.matchdict)
    toc_url = route_url('toc', request, **request.matchdict)
    return {'project': 'mobileyutzu',
            'title': client.entity()["title"],
            'toc': toc_url,
            'resources': resources_url,
            'tools': tools_dicts}
예제 #2
0
def entity(request):
    identifier = request.matchdict["id"]
    resources_url = route_url('resources', request, **request.matchdict)
    toc_url = route_url('toc', request, **request.matchdict)
    client = Client(identifier)
    entity = client.entity()
    if entity:
        tools_dicts = get_tools(request, client)
        title = entity["title"]
        document = entity["description"]
        subtitle = entity["id"]
        return {'project': 'mobileyutzu',
                'resources': resources_url,
                'toc': toc_url,
                'title': title,
                'subtitle': subtitle,
                'tools': tools_dicts,
                'document': document}
    else:
        raise HTTPFound(location='/')