Skip to content
Snippets Groups Projects
Commit ec95a84d authored by Harum Helmy's avatar Harum Helmy Committed by Fredrik Jonsson
Browse files

final edits on the frontend to ensure a comment's visibility is shown on the...

final edits on the frontend to ensure a comment's visibility is shown on the listing when it's private but not when it's public
parent 3c0da76b
No related branches found
No related tags found
No related merge requests found
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
</p> </p>
{% endif %} {% endif %}
{% if activity.private %} <p class="feed__meta-item feed__meta-item--right" {% if not activity.private %} hidden {% endif %}>
<p class="feed__meta-item feed__meta-item--right">
<svg class="icon icon--eye"><use xlink:href="#eye"></use></svg> <svg class="icon icon--eye"><use xlink:href="#eye"></use></svg>
<span class="js-comment-visibility">{{ activity.visibility }}</span> <span class="js-comment-visibility">{{ activity.visibility }}</span>
</p> </p>
{% endif %}
</div> </div>
<p class="feed__heading"> <p class="feed__heading">
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<div id="wmd-preview-edit-comment" class="wmd-preview"></div> <div id="wmd-preview-edit-comment" class="wmd-preview"></div>
<br> <br>
<div>Visible to:</div> <div>Visible to:</div>
</div>
`; `;
const radioButtonsDiv = '<div id="edit-comment-visibility"></div>'; const radioButtonsDiv = '<div id="edit-comment-visibility"></div>';
...@@ -53,7 +54,6 @@ ...@@ -53,7 +54,6 @@
<button class="button button--primary js-submit-edit" type="submit">Update</button> <button class="button button--primary js-submit-edit" type="submit">Update</button>
<button class="button button--white js-cancel-edit">Cancel</button> <button class="button button--white js-cancel-edit">Cancel</button>
</div> </div>
</div>
`; `;
// add the comment to the editor // add the comment to the editor
...@@ -144,7 +144,14 @@ ...@@ -144,7 +144,14 @@
}; };
const updateVisibility = (el, visibility) => { const updateVisibility = (el, visibility) => {
$(el).closest(feedContent).find(commentVisibility).html(`${visibility}`); if (visibility !== 'all') {
$(el).closest(feedContent).find(commentVisibility).parent().attr('hidden', false);
$(el).closest(feedContent).find(commentVisibility).text(visibility);
}
else {
$(el).closest(feedContent).find(commentVisibility).parent().attr('hidden', true);
$(el).closest(feedContent).find(commentVisibility).html(`${visibility}`);
}
}; };
const updateLastEdited = (el, date) => { const updateLastEdited = (el, date) => {
......
...@@ -117,6 +117,10 @@ ...@@ -117,6 +117,10 @@
&--right { &--right {
margin-left: auto; margin-left: auto;
span {
font-weight: $weight--normal;
}
} }
&--progress { &--progress {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment