saurabhd / hk_realestate

GNU General Public License v2.0
1 stars 0 forks source link

Make icon red once a user has a favorite flagged #4

Closed arpita-addweb closed 8 years ago

arpita-addweb commented 8 years ago

Site Area : /favorites ,Priority : High

Description : The star icon on the top right (favorite icon) should indicate if the user has favorites in his list site wide. The red used should be the $primary color variable used in SASS.

darshi-shah commented 8 years ago

Hi,

Can you please explain about this in details ? As per our understanding, the favorite icon needs to be in Red if there are items marked as favorite.

Thanks

heliogabal commented 8 years ago

Hi Darshi,

I think you understood right: If a user has an item marked as favorite, the favorite icon turns red as an indicator that there is something there. If a user unflaggs all his favorites, the icon turns grey again. I hope this helps to make it clearer where the favorites are actually landing.

It is not an ideal solution to loose the ::hover-indication (which happens to be the same red - see the search icon). But we can live with that for now.

Does this clear things up?

darshi-shah commented 8 years ago

Hi Rainer,

I noticed that flagging apartment on /favorites is not reflecting on the page. The issue is with this page view cache. Change the settings to have no cache so flag and unflag is reflected on this page.

Thanks

heliogabal commented 8 years ago

Hi Darshi,

Not sure if I understand you right. I can't disable the cache for the whole site, it would be too slow and anyway I think it's hardcoded by the hosting provider, so I can't change these settings. The menu block itself is set to "no cache", I also disabled the views cache on the favorite view, shouldn't that be enough? Shouldn't a javascript solution be able to bypass the caching? Maybe you could describe what approach you took to solve this so I can understand the problem better. Thanks!

darshi-shah commented 8 years ago

Hi Rainer,

I disable views cache only to make this work. I will be working on making favorites menu color change upon flag and unflag of apartment next.

Thanks

darshi-shah commented 8 years ago

Hi Rainer,

Please follow these steps after taking pull:

1 - Change flag to have normal link, instead of javascript toggle from admin/structure/flags/manage/merken

2 - enable menu_attributes and hk_site_alter modules

3 - make sure views cache is disable here : admin/structure/views/view/merkliste/edit/page

4 - add a new filter to show only flagged content :admin/structure/views/view/merkliste/edit/page

CSS is pushed as well. Let us know any questions.

Thanks

heliogabal commented 8 years ago

Hi Darshi,

thanks for the explanation, now I got it to work. Will have to test tomorrow.

heliogabal commented 8 years ago

Hi Darhsi,

I tested it and followed the four steps you explained, we're slowly getting there. It's a bit unfortunate that we have to get rid of the javascript toggle, but we'll have to live with that if you say that it's not possible otherwise or takes much more time.

I can now add a favorite and the star turns light red, that's great, but if I remove all favorites from the list, it still stays red. Of course the star should get back to grey again. Did I miss something, or is that not working yet indeed?

Thanks for looking into it.

darshi-shah commented 8 years ago

Hi Rainer,

This happens if you have any apartment flagged as favorite in DB. Can you please make sure no apartment is flagged with your user. You can open apartment page and check this.

Let me know any questions.

Thanks

heliogabal commented 8 years ago

Hi Darshi,

I realized it might be that I have flagged some aparts before this got implemented. So you are right, there were still some flagged in the DB and on the node pages, which seems weird to me because I unflagged all apartments from the buy view, but this didn't reflect properly on some nodes? Once I unflagged those as well, its working as it should. So I would say this can get pushed to master. Would you do that and close this issue then? Or should I close it and you push it then?