Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marvil07’s picture

Status: Needs review » Needs work

quoting #1002300-3: Contribution: additional voting widget - "thumbs up and down":

Thanks for uploading the new widget, but I am not including it for now.

Please do not get me wrong, let me explain why: there are some widgets in the module, and all of them try to cover different aspects of the widget api the module is exposing. So we can have lots of different widgets, but I am only conserving the ones have been there in previous releases or new widgets that expose a different widget api functionality that other widgets do not cover.

IMHO this is mainly the same as the upanddown widget, but using thumbs, that is why my original position about having a widget that do the same but with different style sheets do not worth to have it there.

But, I see that some people is interested on having a thumbs widget inside the module, and it's great that you have provided widgets for 6.x-2.x and 6.x-3.x versions :-), so instead of marking this as duplicate of the mentioned issue, I am considering adding it to 6.x-3.x.

So, what is needed to have it inside:

  • I am trying to provide svg versions of images I am using on the widgets, so it is easy to change them, so please provide an svg version of thumbs.png
  • Finish the TODO at widget.tpl.php
  • minor fix to the documentation comment at the beginning of thumbs.inc
udvranto’s picture

Gimme some time. I am using these GPLed SVG icons to create the new ones.

http://commons.wikimedia.org/wiki/File:Thumb_up_icon.svg
http://en.wikipedia.org/wiki/File:Thumb_down_icon.svg

udvranto’s picture

FileSize
14.95 KB

I created a svg using the gpl version of the thumbs. But the border is still too thick. Will this do?

http://en.wikipedia.org/wiki/File:Symbol_thumbs_down.svg
http://en.wikipedia.org/wiki/File:Symbol_thumbs_up.svg

Juan C’s picture

Subscribe

davethedruper’s picture

Subscribe +2

franzkewd’s picture

+1

mcurry’s picture

subscribe. I'd say +1 but last time I did that a maintainer nearly bit my finger off :D

mcurry’s picture

Newbie question: I'm not sure what I need to do with the files in the attached .zip archive. Do I dump the .tpl.php file into my theme directory? Or do I put all the files into the vote_up_down module dir? Or add it to the vote_up_down/widgets dir?

mcurry’s picture

Ok, after some poking around, it looks like I need to create a directory under vote_up_down/widgets, copy the appropriate files into that new dir, then follow the instructions in vote_up_down/WIDGETAPI.txt to enable it.

marvil07’s picture

Status: Needs work » Needs review

changing status, hopefully I could make the final touches to get the widget done

fyrebear’s picture

subscribe

marvil07’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Status: Needs review » Postponed

No more features for 6.x-3.x now that it is the stable branch, moving to 7.x-1.x as postponed until basic port is ready.

ezra-g’s picture

I discussed with marvil07 who clarified that with an SVG, he would accept a patch to provide a thumbs up/down widget. Leaving as postponed pending a patch ;).

ay13’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Postponed » Needs review
FileSize
22.77 KB

Thumbs up down widget patch attached.

ezra-g’s picture

marvil07’s picture

Assigned: Unassigned » marvil07
Status: Needs review » Needs work

The widget looks awesome!

There is some work to do on it yet, but that's code, not design ;-)

So, let's see what I can do now.

marvil07’s picture

So, quite a lot of changes:

  • Modify svg file to match sprite. Also, since the sprite has colours and shadows and svg does not, I have used the simple version on the SVG.
  • Rename widget from thumbs_up_down to thumbs, and all references to that name.
  • Check for reset vote permissions on the template.
  • Make several texts in the widget translatable.
  • Move some vote_sum template variable logic from template to the alter_template_vars function.
  • Remove some unnedeed images.
  • Remove static widget width on css.
  • Change drupal behaviour name to vud_widget_thumbs.
  • Let the widget api add js, instead of doing it manually on the inc file.

What's missing here(or why this is still in "needs work" status):

  • Show the up and the down points on the message separated, since original code on this issue does it in that way and IMHO that makes sense

Feel free to do that change. I will be back on this issue hopefully soon.

ezra-g’s picture

Thanks for making some enhancements!

Rename widget from thumbs_up_down to thumbs, and all references to that name.

We're planning to separately build a "thumbs up" only widget. So, naming this widget "thumbs" wouldn't distinguish to two. Perhaps we should undo this change? Or, could you explain the motivation for this change so that we can think of a solution?

Show the up and the down points on the message separated, since original code on this issue does it in that way and IMHO that makes sense

Our motivation here is to have the widget function as per the comp at http://drupal.org/files/q-a-v2.gif, which shows the net result of the points in a single, easy to understand number. I recognize that it's different from how the existing widgets display, but this seems like a benefit of additional widgets :). The change you're proposing is here is fundamental to how the widget functions. Speaking for myself and ay13, our motivation is to meet the requirements in the comp in a way that contributes back to VUD, and changing that aspect of the widget is kind of a dealbreaker for our project. Perhaps we can discuss in IRC :)?

marvil07’s picture

Status: Needs work » Reviewed & tested by the community

We're planning to separately build a "thumbs up" only widget. So, naming this widget "thumbs" wouldn't distinguish to two. Perhaps we should undo this change? Or, could you explain the motivation for this change so that we can think of a solution?

+++ b/widgets/thumbs/thumbs.inc
@@ -0,0 +1,26 @@
+    'title' => t('Thumbs up and down'),

Please notice that what I changed is only the internal code name. And the reasoning behind it is just to make it shorter the names. Hopefully that's OK for you.

About the second point, well, it will be always possible to create another widget, so let's do it in that way.

@ezra-g: I will be then pushing the last patch, but before it will be great to hear from you.

ezra-g’s picture

Please notice that what I changed is only the internal code name. And the reasoning behind it is just to make it shorter the names. Hopefully that's OK for you.

Understood - Let me rephrase my question: We're about to start working on a patch for another thumbs widget that only allows voting up. If we assign the machine name 'thumbs' to the present widget, what would be an appropriate name for the new one?

ezra-g’s picture

Status: Reviewed & tested by the community » Needs work

Also, it seems like you changed these from being red and green to being grey and black. Was this intentional?

scthomps312’s picture

Subscribe

bdone’s picture

"subscribe" comments on Drupal.org issues are no longer needed.
please see: http://drupal.org/node/1306444

marvil07’s picture

Status: Needs work » Needs review

Understood - Let me rephrase my question: We're about to start working on a patch for another thumbs widget that only allows voting up. If we assign the machine name 'thumbs' to the present widget, what would be an appropriate name for the new one?

Not sure about including another widget for thumbs up in vud. The idea about widgets included here is not about filling all possible widgets, but instead about showing what it could be done with the ctools widget api.

I guess that this will be easier if I move ctools plugin implementation to OOP plugins, so a thumbs_up widget can inherit most functionality from thumbs widget, but sadly that's not possible right now, and I would say that should go only on 7.x

Also, it seems like you changed these from being red and green to being grey and black. Was this intentional?

Yes, as mentioned on comment 17:

Modify svg file to match sprite. Also, since the sprite has colours and shadows and svg does not, I have used the simple version on the SVG.

This is also because IMHO using grayscale will help a little more to avoid implementing a custom widget for changing colours(to match their themes). IMHO grayscale is more neutral.

ezra-g’s picture

This is also because IMHO using grayscale will help a little more to avoid implementing a custom widget for changing colours(to match their themes). IMHO grayscale is more neutral.

We chose red and green because these are standard UI colors to indicate positive and negative and therefore seems unlikely to need re-implementation on a per-theme basis. http://drupal.org/node/871284 shows that VUD already ships with a red and green widget, so I'm not clear on why the presently proposed widget needs this change.

As stated earlier the thread, this widget is a dependency for a new feature in the Commons distribution #1392768: question and answers (Q&A) feature & Origins theme tweaks. Our options for implementing the widget were to do so within the Commons distribution or as a patch to VUD - We chose a patch because that would have broader benefit for folks who might not be running Commons. Making significant UI change to the widget means it no longer meets our goals for Commons.

Given that and

Not sure about including another widget for thumbs up in vud.

, perhaps the best way to make these widgets broadly available would be for us to create a contributed VUD_Extra module - Let me know if that seems like a preferable solution and we'll create a new contrib :).

marvil07’s picture

We chose red and green because these are standard UI colors to indicate positive and negative and therefore seems unlikely to need re-implementation on a per-theme basis. http://drupal.org/node/871284 shows that VUD already ships with a red and green widget, so I'm not clear on why the presently proposed widget needs this change.

Oh, I did not change that image yet, ggrrhh
That image was taken from 6.x-2.x widgets.

The long explanation is on #816776: better colours for plain, alternate and upanddown widgets, and it's about accessibility.

As stated earlier the thread, this widget is a dependency for a new feature in the Commons distribution #1392768: question and answers (Q&A) feature & Origins theme tweaks. Our options for implementing the widget were to do so within the Commons distribution or as a patch to VUD - We chose a patch because that would have broader benefit for folks who might not be running Commons. Making significant UI change to the widget means it no longer meets our goals for Commons.

Hopefully you also agree on the colour now you know the real reason which I just failed to mention before.

, perhaps the best way to make these widgets broadly available would be for us to create a contributed VUD_Extra module - Let me know if that seems like a preferable solution and we'll create a new contrib :).

Now that we are so close I would really like to add this widget on vud, but another thumbs_up widget IMHO is more than needed. Actually IIRC I have said no to other widgets because of the same reason, so if someone is willing to maintain/add those widgets and change all them accordingly to the api changes I made it would be great to have one place to point people wanting to add more widgets.

ezra-g’s picture

Title: Thumbs up down widget based on vote up down » Create contrib project for thumbs widgets
Project: Vote Up/Down » Drupal Commons
Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Needs review » Needs work

Following discussion with marvil07 in IRC, I'm moving this to the Commons queue to create a standalone contrib module that provides the widgets for #1392768: question and answers (Q&A) feature & Origins theme tweaks and #1392756: Create ideation feature (designs attached).

marvil07’s picture

I will be pushing the patch on comment 17 into 6.x-3.x and 7.x-1.x so the vud colours thumbs widget there can also live somewhere.

I have also created #1426398: Convert vud widgets into D8 plugins for 7.x as the long term solution for inheritance between widgets.

marvil07’s picture

Just to mention that after porting to D7 I have just pushed the patches attached here(I've added a minor change, see interdiff) on 6.x-3.x and 7.x-1.x.

lightsurge’s picture

@marvil07

Your local path seems to have snuck through here:

+   sodipodi:docname="thumbs_up_down.svg"
+   inkscape:export-filename="/home/marvil/local-sites/drupal6/sites/all/modules/vote_up_down/widgets/thumbs_up_down/thumbs-sprite.png"
+   inkscape:export-xdpi="90"
ezra-g’s picture

Title: Create contrib project for thumbs widgets » Refactor Q+A Voting widget
Status: Needs work » Needs review
FileSize
2.12 KB

It looks like going to prioritize upcoming work on updating Commons to Drupal 7, and as a result we're going to hold off on implementing the Ideation feature.

As a result, it seems reasonable to simply alter the image used in the thumbs widget via css to get our red/green colors.

The attached patch implements this.

Thanks to ay13 for providing some CSS tips about the background-image property.

ezra-g’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.