Remove "create task" buttons when user has no rights to create tasks.
Has some dirty hacks to infer the permissions based on the allowed methods on shots/project.
This commit is contained in:
@@ -53,11 +53,14 @@
|
|||||||
class="status-{{ task.properties.status }} task-link",
|
class="status-{{ task.properties.status }} task-link",
|
||||||
title="Task: {{ task.name }}")
|
title="Task: {{ task.name }}")
|
||||||
| {% endfor %}
|
| {% endfor %}
|
||||||
|
//- Dirty hack, assume a user can create a task for a shot if they can edit the shot.
|
||||||
|
| {% if 'PUT' in shot.allowed_methods %}
|
||||||
a.task-add(
|
a.task-add(
|
||||||
title="Add a new '{{ task_type }}' task",
|
title="Add a new '{{ task_type }}' task",
|
||||||
class="task-add-link {% if tasks_for_shots[shot._id][task_type] %}hidden{% endif %}"
|
class="task-add-link {% if tasks_for_shots[shot._id][task_type] %}hidden{% endif %}"
|
||||||
href="javascript:task_create('{{ shot._id }}', '{{ task_type }}');")
|
href="javascript:task_create('{{ shot._id }}', '{{ task_type }}');")
|
||||||
| + Task
|
| + Task
|
||||||
|
| {% endif %}
|
||||||
| {% endfor %}
|
| {% endfor %}
|
||||||
| {% endfor %}
|
| {% endfor %}
|
||||||
|
|
||||||
|
@@ -6,9 +6,10 @@
|
|||||||
.col_header.task-list-header
|
.col_header.task-list-header
|
||||||
| Tasks
|
| Tasks
|
||||||
a.task-project(href="{{url_for('projects.view', project_url=project.url)}}") {{ project.name }}
|
a.task-project(href="{{url_for('projects.view', project_url=project.url)}}") {{ project.name }}
|
||||||
|
//- Dirty hack, assume a user can create a task if they can edit the project.
|
||||||
|
| {% if 'PUT' in project.allowed_methods %}
|
||||||
a#task-add(href="javascript:task_create(undefined, 'generic');") + Create Task
|
a#task-add(href="javascript:task_create(undefined, 'generic');") + Create Task
|
||||||
|
| {% endif %}
|
||||||
#task-list.col-list
|
#task-list.col-list
|
||||||
| {% for task in tasks %}
|
| {% for task in tasks %}
|
||||||
//- NOTE: this is tightly linked to the JS in tasks.js, function task_add()
|
//- NOTE: this is tightly linked to the JS in tasks.js, function task_add()
|
||||||
|
Reference in New Issue
Block a user