Commit 9287bcbe authored by Administrator's avatar Administrator

adapting projects view/template to node: ok

parent 8e139a91
......@@ -6,6 +6,7 @@ from django.template.loader import get_template
from django.template import Context
from documents.models import Project, Corpus, Document
from node.models import Node, NodeType
from django.contrib.auth.models import User
......@@ -74,9 +75,10 @@ def projects(request):
t = get_template('projects.html')
user = request.user
project = NodeType.objects.get(name='Project')
date = datetime.datetime.now()
projects = Project.objects.all().filter(user=request.user.pk).order_by("-date")
projects = Node.objects.filter(user=user, type_id = project.id).order_by("-date")
number = len(projects)
html = t.render(Context({\
......
......@@ -16,7 +16,7 @@
<div class="container theme-showcase" role="main">
<div class="jumbotron">
{% if project %}
<h1>{{ project.title }}</h1>
<h1>{{ project.name }}</h1>
<h2> {{ project.subtitle }}</h2>
<h3> {{number}} corpora </h3>
<p>
......
......@@ -25,7 +25,7 @@
{% for project in projects %}
<!--<div class="col-md-offset-7 col-md-4 content" style="background-color:grey">!-->
<div class="col-md-3 content">
<h3><a href="/project/{{ project.id }}">{{ project.title }}</a></h3>
<h3><a href="/project/{{ project.id }}">{{ project.name }}</a></h3>
<h4>{{ project.subtitle }}<h4>
<h5>Completed:</h5>
<div class="chart" barColor="#fffff" data-percent="75">75%</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment