diff --git a/attract/node_types/shot.py b/attract/node_types/shot.py index b8ca370..8990fa8 100644 --- a/attract/node_types/shot.py +++ b/attract/node_types/shot.py @@ -39,3 +39,5 @@ node_type_shot = { 'form_schema': {}, 'parent': ['scene'] } + +task_types = ['layout', 'animation', 'lighting', 'fx', 'rendering'] diff --git a/attract/node_types/task.py b/attract/node_types/task.py index 891776f..80da3ba 100644 --- a/attract/node_types/task.py +++ b/attract/node_types/task.py @@ -17,7 +17,9 @@ node_type_task = { 'default': 'todo', 'required': True, }, - + 'task_type': { + 'type': 'string', + }, 'assigned_to': { 'type': 'dict', 'schema': { diff --git a/attract/setup.py b/attract/setup.py index 9dcc6a6..3dc6517 100644 --- a/attract/setup.py +++ b/attract/setup.py @@ -64,7 +64,8 @@ def setup_for_attract(project_url, replace=False, svn_url=None): Returns the updated project. """ - from .node_types import NODE_TYPES + from .node_types import NODE_TYPES, shot + # Copy permissions from the project, then give everyone with PUT # access also DELETE access. @@ -116,6 +117,10 @@ def setup_for_attract(project_url, replace=False, svn_url=None): log.info('Setting SVN URL to %s', svn_url) attract_props['svn_url'] = svn_url + # Set up task types + task_types = attract_props.setdefault('task_types', {}) + task_types.setdefault(shot.node_type_shot['name'], shot.task_types) + _update_project(project) log.info('Project %s was updated for Attract.', project_url) diff --git a/attract/task_manager.py b/attract/task_manager.py index b118f13..f27bc1d 100644 --- a/attract/task_manager.py +++ b/attract/task_manager.py @@ -24,7 +24,7 @@ class TaskManager(object): self._log.info("Task '%s' logged in SVN: %s", task_id, log_entry) - def create_task(self, project): + def create_task(self, project, task_type=None): """Creates a new task, owned by the current user. :rtype: pillarsdk.Node @@ -45,6 +45,9 @@ class TaskManager(object): }, ) + if task_type: + node_props['properties']['task_type'] = task_type + task = pillarsdk.Node(node_props) task.create(api=api) return task @@ -63,6 +66,7 @@ class TaskManager(object): task.name = fields.pop('name') task.description = fields.pop('description') task.properties.status = fields.pop('status') + task.properties.task_type = fields.pop('task_type', '').strip() or None self._log.info('Saving task %s', task.to_dict()) diff --git a/src/templates/attract/tasks/view_task_embed.jade b/src/templates/attract/tasks/view_task_embed.jade index c956b37..1036ad4 100644 --- a/src/templates/attract/tasks/view_task_embed.jade +++ b/src/templates/attract/tasks/view_task_embed.jade @@ -4,6 +4,9 @@ script(src="{{ url_for('static_attract', filename='js/tasks.js') }}",async=true) .input-group span.input-group-addon#task-addon-name(title='Name') N input.form-control(name="name",autofocus=true,type=text,placeholder='Task name',aria-describedby="task-addon-name",value="{{ task.name|hide_none }}") + .input-group + span.input-group-addon#task-addon-type(title='Task type') T + input.form-control(name="task_type",type=text,placeholder='Task type',aria-describedby="task-addon-type",value="{{ task.properties.task_type|hide_none }}") .input-group span.input-group-addon#task-addon-description(title='Description') D textarea.form-control(name="description",type=text,placeholder='Task description',aria-describedby="task-addon-description") {{ task.description|hide_none }}