Only allow commenting when user has PUT access on the node.

This commit is contained in:
2016-11-11 15:52:33 +01:00
parent d50c4f1cda
commit 97f75a04e5
5 changed files with 15 additions and 11 deletions

View File

@@ -11,7 +11,7 @@
title="Copy ID to clipboard")
| ID
| {% if 'PUT' in shot.allowed_methods %}
| {% if can_edit %}
.input-group
textarea#item-description.input-transparent(
name="description",
@@ -129,7 +129,7 @@ script.
var activities_url = "{{ url_for('.activities', project_url=project.url, shot_id=shot['_id']) }}";
loadActivities(activities_url); // from 10_tasks.js
loadComments("{{ url_for('nodes.comments_for_node', node_id=shot['_id']) }}");
loadComments("{{ url_for('nodes.comments_for_node', node_id=shot['_id'], can_comment=can_edit) }}");
$('body').on('pillar:comment-posted', function(e, comment_node_id) {
loadActivities(activities_url)
@@ -140,7 +140,7 @@ script.
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");
{% if 'PUT' in shot.allowed_methods %}
{% if can_edit %}
/* Resize textareas */
var textAreaFields = $('#item-description, #item-notes');

View File

@@ -4,7 +4,7 @@
input(type='hidden',name='_etag',value='{{ task._etag }}')
//- NOTE: if you add fields here, also add them read-only below.
.input-group
| {% if 'PUT' in task.allowed_methods %}
| {% if can_edit %}
input.item-name(
name="name",
type="text",
@@ -45,7 +45,7 @@
| Delete Task
| {% endif %}
| {% if 'PUT' in task.allowed_methods %}
| {% if can_edit %}
.input-group
textarea#item-description(
name="description",
@@ -160,7 +160,7 @@
script.
{% if 'PUT' in task.allowed_methods %}
{% if can_edit %}
$("#assignees").select2();
var picker = new Pikaday(
@@ -203,6 +203,6 @@ script.
});
loadActivities("{{ url_for('.activities', project_url=project.url, task_id=task['_id']) }}"); // from 10_tasks.js
loadComments("{{ url_for('nodes.comments_for_node', node_id=task['_id']) }}");
loadComments("{{ url_for('nodes.comments_for_node', node_id=task['_id'], can_comment=can_edit) }}");
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");