Show tasks as read-only when user has no PUT access.
Still pretty rough. Most importantly, users are shown as hashes rather than their names.
This commit is contained in:
@@ -2,14 +2,19 @@
|
||||
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
|
||||
.dropdown(style='margin-left: auto')
|
||||
button#item-dropdown.btn.btn-default.dropdown-toggle(
|
||||
type='button',
|
||||
data-toggle='dropdown',
|
||||
@@ -28,6 +33,7 @@
|
||||
| Delete Task
|
||||
| {% endif %}
|
||||
|
||||
| {% if 'PUT' in task.allowed_methods %}
|
||||
.input-transparent-group
|
||||
textarea.input-transparent(
|
||||
name="description",
|
||||
@@ -67,17 +73,28 @@
|
||||
| <option value="{{ u._id }}" {% if u._id in task.properties.assigned_to['users'] %}selected{% endif %}>{{ u.full_name }}</option>
|
||||
| {% endfor %}
|
||||
|
||||
|
||||
| {% if 'PUT' in task.allowed_methods %}
|
||||
.input-group-separator
|
||||
|
||||
.input-transparent-group
|
||||
button.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 }}
|
||||
| {% else %}
|
||||
dd not assigned
|
||||
| {% endfor %}
|
||||
| {% endif %}
|
||||
|
||||
|
||||
#item-view-feed
|
||||
| Task updated {{ task._updated | pretty_date }}
|
||||
| {% if config.DEBUG %}
|
||||
|
Reference in New Issue
Block a user