ucsb-cs148-s21 / 1pm-t6-ucsb-poll

Allows anyone with a UCSB email to vote on virtually anything.
MIT License
2 stars 4 forks source link

Homepage #22

Closed zhengyingl closed 3 years ago

zhengyingl commented 3 years ago

Add tow part: sort by time, sort by popularity. (detail sorting function may need add later when we have example polls)

Show 6 polls, if want to view more then click "view all".

Each poll have: image of result (link need to be added later), poll title, create time, close/open (if open, there will be a button called "go to vote").

(I think "choose categories" and "bookmarks" may need to showed up at navigation bar, just a thought. If we still need them in homepage, I can add it later)

jasunchen commented 3 years ago

Looks fine to me as a placeholder. A thing I'm not sure about is how these things will be dynamically generated since we'll have to send a request to the server for a list of polls and their details.

zhengyingl commented 3 years ago

My thought is when we use database, we have(or store): POLL: poll id, poll title, poll time, poll status, categories, count of attend people etc first step: find the polls that meet the requirement, for example: most popular( most count of attend people) one second step: link it to the function, for example: title name= thepollwefound.title Each time we refresh the page, the function will run once, so the page can always show these boxes correctly. I also don't have idea without send a request to the server. The only way I find out is refresh page, send request, do the function, and show on the page.