summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html7
-rw-r--r--templates/index.html22
-rw-r--r--templates/task/browse.html7
-rw-r--r--templates/task/create.html2
-rw-r--r--templates/task/view.html28
5 files changed, 66 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..7ed337f
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,7 @@
+<html>
+<head>
+ <title>{% block title %}PyTasks{% endblock %}</title>
+</head>
+<body>
+<h2><a href="/">PyTasks</a></h2><br />{% block content %}This is the default content{% endblock %}</body>
+</html>
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..3154221
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,22 @@
+{% extends 'base.html' %}
+{% block content %}
+ {% if is_guest %}
+ Welcome Guest<br>
+ <a href="/accounts/register/">Register</a>
+ <a href="/accounts/login/">Login</a><br /><br />
+ Recent Tasks:<br />
+ {% for task in task_list %}
+ <a href="/task/view/tid={{ task.id }}">{{ task.title }}</a><br />
+ {% endfor %}
+ {% else %}
+ Welcome {{ user.username }} <br />
+ <a href="/accounts/logout/">logout</a><br />
+ <br />
+ <a href="/task/browse/">Tasks</a><br />
+ <a href="/user/browse/">Users</a><br />
+ <a href="/user/view/uid={{user.id}}">My Profile</a><br />
+ {% endif %}
+ {% if can_create_task %}
+ <a href="/task/create/">Create a task</a><br />
+ {% endif %}
+{% endblock %}
diff --git a/templates/task/browse.html b/templates/task/browse.html
new file mode 100644
index 0000000..cd0103d
--- /dev/null
+++ b/templates/task/browse.html
@@ -0,0 +1,7 @@
+{% extends 'base.html' %}
+{% block content %}
+ List of all the tasks:<br />
+ {% for task in task_list %}
+ <a href="/task/view/tid={{ task.id }}">{{ task.title }}</a><br />
+ {% endfor %}
+{% endblock %}
diff --git a/templates/task/create.html b/templates/task/create.html
new file mode 100644
index 0000000..5fddb17
--- /dev/null
+++ b/templates/task/create.html
@@ -0,0 +1,2 @@
+{% extends 'base.html' %}
+{% endblock %}
diff --git a/templates/task/view.html b/templates/task/view.html
new file mode 100644
index 0000000..62393dd
--- /dev/null
+++ b/templates/task/view.html
@@ -0,0 +1,28 @@
+{% extends 'base.html' %}
+{% block title %}
+ {{task.title}}
+{% endblock %}
+{% block content %}
+ <a href="/task/browse/pg=1">Browse tasks</a>
+ <h3>{{ task.title }}</h3><br />
+ <!-- we have to write our own datetime.strftime filter and use in the next line -->
+ created by <a href="/user/view/uid={{ task.created_by.id }}">{{ task.created_by.username }}</a> on {{ task.creation_datetime.ctime }}<br />
+ <br />Description:<br />
+ <br />{{ task.desc }}<br />
+ {% if comments %}
+ <br/>comments:<br />
+ {% for comment in comments %}
+ <br /><a href="/user/view/uid={{comment.created_by.id}}">{{ comment.created_by.username }}</a> at {{ comment.creation_datetime.ctime }} wrote:<br />
+ {{ comment.data }}<br />
+ {% endfor %}
+ {% endif %}
+
+ {% if not is_guest %}
+ <br />Add comment:<br />
+ <form action="" method="post">
+ <!-- we might even want to use forms here -->
+ <textarea name="data"></textarea><br />
+ <input type="submit" value="Submit">
+ </form>
+ {% endif %}
+{% endblock %}