Hi,

So loving Activity and very close to it being perfect :)

Is there any change perhaps that the comment form is rather a link which appears below with javascript or ahah (exactly as the FB-status module does)? I think it would be more aesthetically pleasing and clean.

I enclose a screenshot of where the comment form would be much nicer next to the 'delete' link ..

Or if anyone can point me in the right direction on how to do this?

Look most forward to any reply and thank you.
Lilian

Comments

Scott Reynolds’s picture

Component: Activity Contrib » User interface
Category: feature » support

Missing a screen shot.

But, I would sugguest trying something like this

function MY_MODULE_form_activity_comments_form_alter(&$form, $form_state) {
  $form['show_all']['#value'] .= ' <a href="#" class="activity-comment-show-form">' . t('Show Form') . '</a>';
}

Then with CSS you hide the form using selectors like html.js .activity-comment-form .form-item, so that way the items only get hidden when the user has javascript turned on. And finally, the missing piece is some JS to show the form when .activity-comment-show-form is clicked.

liliplanet’s picture

StatusFileSize
new8.57 KB

Oops, sorry about missing the screenshot .. now attached

Scott, this is a little above my head, but if I understand correctly:

Create a module with the above function
Hide the html.js.activity-comment-form.form-item in css?
Somehow insert JS in an 'empty text' in a view where I want the link to appear ..

I'm prepared to pay for this enhancement ... as I don't think my skills are adequate (at all), but will try :)

Most appreciate your reply.
Lilian

troyl’s picture

I am not sure this is the best way to do so, but I think it would be very easy just to add fieldset class to the activity comment form .

if you look at the code in "activity_comment.module" from line number 131 to 135

This is the original code :


// Add comment form.
 
function activity_comments_form($form_state, $aid, $limit, $direction) {
  $form['activity_form_items'] = array(
    '#access' => user_access('activity post comments'),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
  );

I think if it could be changed to something like this:

/**
 * Add comment form.
 */
function activity_comments_form($form_state, $aid, $limit, $direction) {
  $form['activity_form_items'] = array(
    '#access' => user_access('activity post comments'),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => '</div>',
    '#type' => 'fieldset',
    '#title' => t('Comment'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

This would create a simple collapsed wrapper around the activity comment form, which would be collapsed till the user decided to comment.

Also at line 137 to 143

// Change textfield to text area for better user

  $form['activity_form_items']['activity_comment'] = array(
    '#type' => 'textfield',
//    '#maxlength' => 250,
//    '#size' => 25,
    '#default_value' => t('Write a comment'),
    '#attributes' => array('class' => 'activity-comment-text'),
  );

I think it would give users a better option... and with a bit of css you can get that Facebook type look..

Attached is a patch for it

troyl’s picture

StatusFileSize
new955 bytes

oops forgot to attach the patch so here it's again

liliplanet’s picture

That is beautiful troyl, thank you so much! Looking much more clean ... most appreciated :)

troyl’s picture

StatusFileSize
new3.51 KB

you are very welcome...I have cleaned a bit more of the code and am attaching the patch to this one...check it out..

It also solves the problem of default text display on event

In this one I have also made changes to the default template activity-comment.tpl.php

liliplanet’s picture

thank you so much troyl :)

I've added the patch in #6 (manually) but now find that when you post a comment, it disappears after submission ..

patch in #4 did not have that problem ..

so appreciate your time :)

Lilian

liliplanet’s picture

this is what I see in dblog :

array_search() [<a href='function.array-search'>function.array-search</a>]: Wrong datatype for second argument in /home/public_html/sites/all/modules/activity/activity_comments/activity_comments.module on line 101

liliplanet’s picture

sorry me bad (: .. it's perfect! thank you troyl!

troyl’s picture

You are welcome !! glad I could help... If you have any issue please let me know...

you can also check this one... if you are interested in user pictures in activity comment, thanks to @gausarts

http://drupal.org/node/797840

PS ..for some reason i can't CVS to make patches will look into it..

liliplanet’s picture

StatusFileSize
new8.03 KB

Hi Troyl,

Hope you are very well.

Troyl, you were so kind to help previously to get 'comment link' to show rather than the comment box.

I'm still trying to find a way that the 'comment link' appears next to 'as time ago', 'delete' and then 'comment'

Please see attached screenshot, it's not so pretty :) and it's got this line going through the table ..

What would be ideal is the 'comment link' appears next to 'delete' and when you click, comment box appears below.

Is that perhaps possible? Looking most forward to your reply, and thank you ..
Lilian

troyl’s picture

Sorry for the long delay in responding, I have been busy. You can get it to work with views,

Create a view of your activity, and use advanced display options, you will be able to create it. You can also use the rewrite output option in views.

if you need any further help send me a mail and I shall help

liliplanet’s picture

StatusFileSize
new14.12 KB
new19.44 KB

Thank you Troy for your reply!

I've rewritten the display in views as follows:

[message] [created] [delete_activity] [comment_form], but still the comment box appears below. (see attached screenshot3)

I think it has to do with the box around the form? I've tried with css without avail. (see attached screenshot2)

Look most forward to your kind help :)

Lilian

rjbrown99’s picture

Title: Ahah comments or link instead of form » Theme: Add wrapper around activity comment form
Category: support » feature
Status: Active » Needs review

There is a patch here, changing status and adding a more descriptive issue title.

_shy’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.