Files
attract/src/templates/attract/tasks/view_task_embed.jade

132 lines
4.4 KiB
Plaintext

.attract-box.task.with-status(
class="status-{{ task.properties.status }}")
form#task_form(onsubmit="return task_save('{{task._id}}', '{{ url_for('attract.tasks.perproject.save', project_url=project['url'], task_id=task._id) }}')")
input(type='hidden',name='_etag',value='{{ task._etag }}')
//- NOTE: if you add fields here, also add them read-only below.
.input-transparent-group
| {% if 'PUT' in task.allowed_methods %}
input.input-transparent.item-name(
name="name",
type="text",
placeholder='Name',
value="{{ task.name | hide_none }}")
| {% else %}
h2 {{ task.name | hide_none }}
| {% endif %}
.dropdown(style='margin-left: auto')
button#item-dropdown.btn.btn-default.dropdown-toggle(
type='button',
data-toggle='dropdown',
aria-haspopup='true', aria-expanded='true')
i.pi-more-vertical
ul.dropdown-menu(aria-labelledby='item-dropdown')
li.copy-to-clipboard(data-clipboard-text="{{ task._id }}")
a(href="javascript:void(0)")
i.pi-clipboard-copy
| Copy ID to Clipboard
| {% if attract_context != 'shot' and task.parent %}
li
a(href="{{ url_for('attract.shots.perproject.with_task', project_url=project['url'], task_id=task['_id']) }}")
i.pi-film-thick
| View in shot context
| {% endif %}
| {% if 'DELETE' in task.allowed_methods %}
li.divider(role='separator')
li.item-delete
a(href="javascript:task_delete('{{ task._id }}', '{{ task._etag }}', '{{ url_for('attract.tasks.delete', task_id=task._id, _method='DELETE') }}')")
i.pi-trash
| Delete Task
| {% endif %}
| {% if 'PUT' in task.allowed_methods %}
.input-transparent-group
textarea#task-description.input-transparent(
name="description",
type="text",
placeholder='Description') {{ task.description | hide_none }}
.input-group-flex
.input-transparent-group.field-type
label#task-task_type Type:
select.input-transparent(name="task_type",aria-describedby="task-task_type")
| {% for task_type in attract_props.task_types.attract_shot %}
| <option value="{{ task_type }}" {% if task_type == task.properties.task_type %}selected{% endif %}>{{ task_type | undertitle }}</option>
| {% endfor %}
| {% if task.properties.task_type not in attract_props.task_types.attract_shot %}
option(value="{{ task.properties.task_type }}",selected).invalid_task {{ task.properties.task_type | undertitle }}
| {% endif %}
.input-transparent-group
label#task-status Status:
select.input-transparent(
name="status",
aria-describedby="task-status")
| {% for status in task_node_type.dyn_schema.status.allowed %}
| <option value="{{ status }}" {% if status == task.properties.status %}selected{% endif %}>{{ status | undertitle }}</option>
| {% endfor %}
.input-group-separator
.input-transparent-group.select_multiple
label Assignees:
select#assignees.input-transparent(
name="users",
multiple,
placeholder="Assigned to"
aria-describedby="task-addon-users")
| {% for u in project.users %}
| <option value="{{ u._id }}" {% if task.properties.assigned_to.users and u._id in task.properties.assigned_to.users %}selected{% endif %}>{{ u.full_name }}</option>
| {% endfor %}
.input-group-separator
.input-transparent-group
button#item-save.btn.btn-default.btn-block(type='submit')
i.pi-check
| Save Task
| {% else %}
//- NOTE: read-only versions of the fields above.
p {{ task.description | hide_none }}
dl.dl-horizontal.item-properties
dt Type:
dd {{ task.properties.task_type | undertitle }}
dt Status:
dd {{ task.properties.status | undertitle }}
dt Assignees:
| {% for u in task.properties.assigned_to['users'] %}
dd {{ u.full_name }}
| {% else %}
dd not assigned
| {% endfor %}
| {% endif %}
#item-view-feed
#activities
| {% if config.DEBUG %}
pre.
{{ task.to_dict() | pprint }}
| {% endif %}
script.
$("#assignees").select2();
if (ProjectUtils.context() == 'shot'){
$('.field-type').hide();
}
new Clipboard('.copy-to-clipboard');
var url = "{{ url_for('.activities', project_url=project.url, task_id=task['_id']) }}";
load_activities(url); // from 10_tasks.js
{% if 'PUT' in task.allowed_methods %}
/* Resize textarea */
var text = $('#task-description').val(),
matches = text.match(/\n/g),
breaks = matches ? matches.length : 2;
$('#task-description').attr('rows',breaks + 4);
{% endif %}