Open apachano opened 7 years ago
So just to be clear, by stared, do you mean rated, or favorited?
both are pretty simple, just one involves a little more code.
Favorited, similar to how you would star a project on github.
We could probably just have the particular server model store an interger representing how many users have starred it. Have it incremented every time a user stars, and decremented every time a user unstars. On the user side of things, we could have the User model store a many to many which refs each of the servers they've stored, and just for efficiency if it has bearing later, an interger on the user model representing how many servers they've starred.
Yea I was thinking of linking them with the many to many field, I think there is a start in the code but I am not 100% sure. I cant remember where I got stuck so maybe I will start working on that again . . .
I need to figure out how to implement function to the star button on pages. Function should be -Toggle starred on click -Filled in if user has starred and outline otherwise (I believe this works properly) -Display number of stars