VT7 - comment on project are cut
If I add a long comment on project, then if I click on SHOW MORE button the comment it's not shown and i f I click on edit than i get the part of the comment i can see and SHOW MORE: the text is cut! IT's a big issue.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
I'm not sure, but it seems that the "show more" function is missing or does not work properly in VT7. I couldn't find it, so I wrote my own function that expands long comments by clicking the "show more" button under the comment text.
This is what i changed:
- File: /layouts/v7/modules/Vtiger/RecentComments.tpl
{if $COMMENT_CONTENT} {assign var=DISPLAYNAME value={decode_html($COMMENT_CONTENT)}} <span class="commentInfoContent" style="display: block" data-fullComment="{$COMMENT_CONTENT|escape:"html"}" data-shortComment="{$DISPLAYNAME|mb_substr:0:200|escape:"html"}..." data-more='{vtranslate('LBL_SHOW_MORE',$MODULE)}' data-less='{vtranslate('LBL_SHOW',$MODULE)} {vtranslate('LBL_LESS',$MODULE)}'> {if $DISPLAYNAME|count_characters:true gt 200} {mb_substr(trim($DISPLAYNAME),0,200)}... <br><a class="pull-right toggleComment showMore"><small>{vtranslate('LBL_SHOW_MORE',$MODULE)}</small></a> {else} {$COMMENT_CONTENT} {/if} </span> {/if}
replaced with:
{if $COMMENT_CONTENT} {assign var=DISPLAYNAME value={decode_html($COMMENT_CONTENT)}} <span class="commentInfoContent" style="display: block" data-fullComment="{$COMMENT_CONTENT|escape:"html"}" data-shortComment="{$DISPLAYNAME|mb_substr:0:200|escape:"html"}..." data-more='{vtranslate('LBL_SHOW_MORE',$MODULE)}' data-less='{vtranslate('LBL_SHOW',$MODULE)} {vtranslate('LBL_LESS',$MODULE)}'> {if $DISPLAYNAME|count_characters:true gt 200} <span class="comment-wrapper"> {mb_substr(trim($DISPLAYNAME),0,200)}... </span> <br><a class="pull-right toggleComment showMore" onClick="toggleComment(this);"><i class="fa fa-angle-down"></i> {vtranslate('LBL_SHOW_MORE',$MODULE)}</a> {else} {$COMMENT_CONTENT} {/if} </span> {/if}
(here: you could also change the '200' values to allow more characters, bevor the comment gets cut)
and added some JS code in the bottom of the file, before the {/strip} tag:
{* JS for toggle long comments *} <script> function toggleComment(comment) { var commentInfoBlock = $(comment).parent('.commentInfoContent'); var commentBlock = commentInfoBlock.find('.comment-wrapper'); if(commentBlock.hasClass('more')) { commentBlock.html(commentInfoBlock.data('shortcomment')); $(comment).html('<i class="fa fa-angle-down"></i> '+commentInfoBlock.data('more')); commentBlock.removeClass('more'); } else { commentBlock.html(commentInfoBlock.data('fullcomment')); $(comment).html('<i class="fa fa-angle-up"></i> '+commentInfoBlock.data('less')); commentBlock.addClass('more'); } } </script>
- Contributor
- Contributor
Observation with latest master:
- Comment content in the summary widget is collapsed with (show more) and its toggle works as expected on Project.
- Comment content is shown in full on the related tab - when text is big it shows in full.
Please re-open this issue with more details.
- Prasad Status changed to closed
Status changed to closed