# Create your views here.
from django.shortcuts import render_to_response, get_object_or_404
from models import *
import json
from ox.django.shortcuts import render_to_json_response


def home(request):
    return render_to_response("home.html", {})

def profile(request):
    return render_to_response("profile.html", {})

def projects(request):
    return render_to_response("projects.html", {
        'projects': Project.objects.all()
    })

def project_json(request):
    project_id = request.GET.get("id", "0")
    project = get_object_or_404(Project, pk=project_id)
    data = project.get_info()
    return render_to_json_response(data)

def jobs(request):
    return render_to_response("jobs.html", {})

def contact(request):
    return render_to_response("contact.html", {})

def links(request):
    return render_to_response("links.html", {
        'links': Link.objects.all()
    })

def noteworthy(request):
    return render_to_response("noteworthy.html", {
        'noteworthy': Noteworthy.objects.all()
    })
