예제 #1
0
def home(request):
    """
    View for home page, introducing what the page is for non-logged in users,
    showing a demo of the software, contact info and such.
    """
    context = {}

    generate_sidepanel(context, request)

    context['headline'] = "wPlan"

    return render(request, 'wellvis/home.html', context)
예제 #2
0
파일: views.py 프로젝트: bjorbre/ww
def home(request):
    """
    View for home page, introducing what the page is for non-logged in users,
    showing a demo of the software, contact info and such.
    """
    context = {
    }

    generate_sidepanel(context, request)

    context['headline'] = "wPlan"

    return render(request, 'wellvis/home.html', context)
예제 #3
0
def home(request):
    """
    View for home page, introducing what the page is for non-logged in users,
    showing a demo of the software, contact info and such.
    """
    context = {
        # This dataformat is JSON
        'thisDataFormat': 'THIS IS wControl Panel',
        'cake': 'THIS IS wCP'
    }

    generate_sidepanel(context, request)

    context['headline'] = "wControlPanel"

    return render(request, 'wellvis/home.html', context)
예제 #4
0
파일: views.py 프로젝트: bjorbre/ww
def home(request):
    """
    View for home page, introducing what the page is for non-logged in users,
    showing a demo of the software, contact info and such.
    """
    context = {
        # This dataformat is JSON
        'thisDataFormat':'THIS IS wControl Panel',
        'cake':'THIS IS wCP'
    }
    
    generate_sidepanel(context, request)

    context['headline'] = "wControlPanel"

    return render(request, 'wellvis/home.html', context)
예제 #5
0
def edit_well(request, wellpk):
    """
    Page for editing existing well. 
    If: no project exists. Send to create project page.
    if: no path exists. Send to create path page.
    else: Send to edit page with graph
    """
    context = {'messages':[]}

    if not request.user.is_authenticated():
        context['messages'].append("403 Error: You are not authenticated")
        return render(request, 'wellvis/home.html', generate_sidepanel(context, request))
    
    well = Well.objects.filter(pk=wellpk)  # could be replaced with get_or_404
    
    if not well:
        context['messages'].append("404 Error: Well " + wellpk + " not found")
        return render(request, 'wellvis/home.html', generate_sidepanel(context, request))
    
    well = well[0]
    project = Project.objects.filter(well=well).order_by('-created_date')

    if not project:
        project = Project.objects.create( name = "Untitled", responsible = request.user, start_date = "2011-09-01T13:20:30+03:00", end_date = "2014-09-01T13:20:30+03:00", well = well )
        # context['messages'].append("404 Error: Project not found attached to well " + str(well.pk))
        # TODO: Send to create-project page
        # return render(request, 'wellvis/home.html', generate_sidepanel(context, request))
    else:
        project = project[0]
    path = WellPath.objects.filter(project=project).order_by('-date')
    if not path:
        path = WellPath.objects.create(project=project, creator=request.user, path=get_default_path())
        path.save()
    else:
        path = path[0]
    context['wellpk'] = well.pk
    #context['path'] = path.path
    context['page_title'] = "wPath"

    return render(request, 'wpath/3D_View.html', context)
예제 #6
0
def home(request):
    """
    Home page for wpath module. Should show list of recent changes, and 
    general information about the well. Restore-possibilites of previous 
    paths and links to what do next.
    """
    context = {
    }

    context['sidepanel_hidden'] = "1"
    context['page_title'] = "wPath"

    context = generate_sidepanel(context, request)
    context['path'] = "kake"

    return render(request, 'wellvis/home.html', context)