Extraneous Textarea in Comments Module

trumpy81

Joined: 2004-12-19
Posts: 15
Posted: Sun, 2008-11-02 18:08

GDay All,

I have a minor problem/annoyance with a certain Textarea box in the Comments Module. I don't know how many of you have encountered this problem/annoyance before but It has existed since v2.0 and I continue to see it in v2.3.

Whenever someone adds an 'Add Comment' in the 'themes/Blocks to show on photo pages' admin area you get this extraneous textarea:

[img]http://vvmc-qrc.org/ExtraTextarea.png[/img]

This textarea seems to serve no purpose at all and in my opinion should be removed.

To remove it, you'll find the offending code in gallery2/modules/comment/templates/blocks/AddComment.tpl on line 22.

If you look at the code it even appears to not be a part of the intended code.

Quote:
{*
* $Revision: 17951 $
* Read this before changing templates! http://codex.gallery2.org/Gallery2:Editing_Templates
*}
{* Set defaults *}
{if empty($item)} {assign var=item value=$theme.item} {/if}
{g->callback type="comment.AddComment" itemId=$item.id}

{if !isset($expand)}{assign var="expand" value=true}{/if}

{if !empty($block.comment.AddComment)}
<div id="AddComment_block" {if $expand}style="display: none"{/if} class="{$class}">
{include file="gallery:modules/comment/templates/AddComment.tpl"
AddComment=$block.comment.AddComment inBlock=1}
</div>

{if $expand}
<div id="AddComment_trigger" class="{$class}" onclick="AddComment_showBlock()">
<div class="gbBlock gcBackground1">
<h3> {g->text text="Add Comment"} </h3>
</div>
<textarea cols="80" rows="5"></textarea> **Note: this is the offending line.**
</div>

{literal}
<script type="text/javascript">
// <![CDATA[
function AddComment_showBlock() {
document.getElementById('AddComment_block').style.display='block';
document.getElementById('AddComment_trigger').style.display='none';
}
// ]]>
</script>
{/literal}
{/if}
{/if}

I am wondering if this can be removed from future releases?

Regards
trumpy81

 
trumpy81

Joined: 2004-12-19
Posts: 15
Posted: Sun, 2008-11-02 18:11

Regards
trumpy81

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2008-11-07 17:30

Not quite sure if I understand the issue.

First, please note that not all themes behave the same way.
You could switch to the matrix theme (or another theme) to see if you like its behavior better.

Second, on your screenshot I see a single "add comment" textarea on a photo page. isn't that exactly what you've asked for when adding the "add comment" block to the blocks to be shown on photo pages?

I guess it's all about the theme you're using. Since that theme is usually a little more refined that others, it adds icons for "exif data" and "add comment" at the top instead of cramming all on the screen. I guess you'd expect the theme not to show the textarea by default and just show a "add comment" icon. is that correct?

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
trumpy81

Joined: 2004-12-19
Posts: 15
Posted: Fri, 2008-11-07 22:37

GDay All,

valiant, the point is, if you click on the textarea that is displayed directly below the 'Add Comment' link the page will expand into a new form for entering ones comments and the textarea box that was displayed is replaced by a new textarea (different ID) for typing in the message.

The textarea that is displayed directly below the 'Add Comment' link does absolutely nothing, it does not display comments or anything else, in other words it's not supposed to be there.

And because this error is in a module it displays no matter what theme you use.

Fire up Gallery2 and on the theme config, admin page, add an 'Add Comment' block to a photo page, then goto to a photo page and play with it, you'll see exactly what I mean.

This reminds me also, that the 'Add Comment' link does not change the cursor correctly. You get the text bar, instead of a hand cursor. Not a biggie, but for computer illiterate's, which most of my viewers are, it makes it difficult for them to determine the link.

Regards
trumpy81