Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
Hi all.
I have come accross a problem when using ratings.
You are ( or client) are able to select either 1 to 5 stars. but if you change your mind there is no way to set it back to 0 again. Does someone have a solution to this - perhaps when 5 stars are selected (or 1 star for example) and you select 5 stars again (or one star again) it changes them to zero?
Any help much appreciated
Offline
as far as I can tell, after you've clicked "Save" there's no way to get the star rating back to zero. Otherwise you can just click cancel and start over with feedback for that particular image.
Looks like the feedback dialog could use a "clear ratings" link like Ben came up with for selecting all or none in the gallery as a whole.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
I think that it may be possible to address it by altering the template_index.php and effectively adding a zero option and the style-component.css but not certain. I think that this may look a bit messy though.
Has anyone already got a solution to this?
Offline
Has anyone already got a solution to this?
Not that I know of.
Give Matt and Ben a chance to look it over. They're the ones who will come up with a solution.
I don't think that css file is the place to change things since the feedback form is generated with jQuery and css only styles what's there, it's not adding content.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
This is something that would need changes to the CRG JavaScript and a button to clear the ratings.
Offline
Hi I would like to see the stars working as they do in lightroom where if it has the value of 1 star and you click the one star it becomes no stars.
I have tried to understand the javascript but my coding isn't that good. I can see in the jquery.ttgcrg-ce4.js script it has a section // Star Ratings Widget - from line from line 548 to 588. In this I can see how, when hovered, it removes the styling of those to the right and adds the yellow styling to those before and the one you are hovering over. there is also a section on when clicked it sets the styling to black for those below and itself and then removes styling of those above.
What I can't find is how to find the current value of the star rating. You could then check to see if the current selection is the same and then remove styling from all.
Any help much appreciated.
Offline
I'd sit tight and see what Ben comes up with.
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
That's a good way of doing it. Changing lines 574 to 577, from this:
var rating = $(star).data('score');
$(widget).find('.star_' + rating).prevAll().andSelf().addClass('ratings_vote');
$(widget).find('.star_' + rating).nextAll().removeClass('ratings_vote');
to this:
var rating = $(star).data('score');
if (rating == ttgCrg.responses[ttgCrg.active_photo_id].rating) {
rating = 0;
$(widget).find('.ratings_stars').removeClass('ratings_vote');
} else {
$(widget).find('.star_' + rating).prevAll().andSelf().addClass('ratings_vote');
$(widget).find('.star_' + rating).nextAll().removeClass('ratings_vote');
}
should do the job. Let us know how that goes and we'll add it into CRG.
Offline
Works like a charm Ben!
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Ben you guru!
I have been playing with this alot today I had managed to get the hover to work but not the rest and it is so simple. Thank you so much. I think this is how it should be set up for everyone. Has Matt seen this?
Offline
Yes. I have already merged that code into the CRG code base.
The trick with that change was that the usual blanking of stars doesn't work with a starting index of 0.
Offline
I'm glad to have that in. Thanks for the suggestion!
Offline
Hi Mike, well-spotted. A bit of a quirk. The rating isn't actually saved unless you click 'Save'. So the issue is that the displayed value is held, despite clicking 'Cancel'.
Offline
When selecting/ unselected the option boxes and then cancel they return to their previous value. The ratings currently don't work in the same way. I've had a quick look at the code but no joy yet in finding the solution.
Mike
Offline
Just a bit more of an update.
scenario:
step1 : A client selects an image and clicks five stars and option one.
step 2: They then log out.
step 3:They log back in
step 4: Go to image and change the image rating to one star and option two but click cancel.
step 5 : They then go back into image and it shows one star (Quirk) and option one.
step6: If they log out at this point and
step 7: log back in
step 8: Go back to image it shows 5 stars and option 1.
So it is very confusing at the moment and needs a solution. Step 5 should show five stars
I hope this makes it clearer to what is happening.
Last edited by mikeelbon (2015-10-01 18:57:15)
Offline
Thanks Mike.
I can see what's going on, and have a strategy to fix it, but the code isn't working: fixing one aspect of it breaks another, and vice versa. I'll keep working on it.
Offline
We've released CRG 6.1.1a, which addresses this. The only changed file is: ttg-be/crg/lib/js/jquery.ttgcrg-ce4.js
Offline
Pages: 1