Show user's task on /attract

This commit is contained in:
2016-10-05 11:51:07 +02:00
parent 426635cc45
commit bf35b0a9b7
5 changed files with 41 additions and 31 deletions

View File

@@ -5,21 +5,12 @@
#dashboard
.row
.col-md-6
h3 My Tasks
a.pull-right
small View All
#task-list.col-list
- for (var i = 0; i < 15; ++i) {
a.col-list-item.task-list-item(
id="task-(TASK_ID)",
class="status-review task-link",
href="#")
span.status-indicator
span.name Task Name
span.type type
- }
| {% if current_user.is_authenticated %}
| {% from "attract/tasks/task_list_for_user.html" import task_list_for_user %}
| {{ task_list_for_user(tasks['_meta']['total'], tasks['_items']) }}
| {% else %}
| {% include "attract/index_anon_left_column.html" %}
| {% endif %}
.col-md-6
h3 Latest Edit
img.img-responsive(src="//placehold.it/500x250")

View File

@@ -0,0 +1,3 @@
h3 Welcome to Attract
p This is the left column. It contains left-handed things.

View File

@@ -3,21 +3,8 @@
| {% block page_title %}Tasks for you{% endblock %}
| {% block body %}
#col_main
.col_header.task-list-header
| Your tasks ({{ task_count }})
#task-list.col-list
| {% for task in tasks %}
//- NOTE: this is tightly linked to the JS in tasks.js, function task_add()
a.col-list-item.task-list-item(
class="status-{{ task.properties.status }} task-link",
title="In project '{{ task._project_info.name }}'",
href="{{ url_for('attract.tasks.perproject.view_task', project_url=task._project_info.url, task_id=task._id) }}")
span.status-indicator
span.name {{ task.name }}
span.type {{ task.properties.task_type }}
| {% endfor %}
| {% from "attract/tasks/task_list_for_user.html" import task_list_for_user %}
| {{ task_list_for_user(task_count, tasks) }}
.col-splitter
#col_right

View File

@@ -0,0 +1,19 @@
| {% macro task_list_for_user(task_count, tasks, include_shotname=True) -%}
.col_header.task-list-header
| Your tasks ({{ task_count }})
#task-list.col-list
| {% for task in tasks %}
//- NOTE: this is tightly linked to the JS in tasks.js, function task_add()
a.col-list-item.task-list-item(
class="status-{{ task.properties.status }} task-link",
title="In project '{{ task._project_info.name }}'",
href="{{ url_for('attract.tasks.perproject.view_task', project_url=task._project_info.url, task_id=task._id) }}")
span.status-indicator
span.name {{ task.name }}
| {% if include_shotname and task._parent_info %}
span.shotname {{ task._parent_info.name }}
| {% endif %}
span.type {{ task.properties.task_type }}
| {% endfor %}
| {%- endmacro %}