Ignore:
Timestamp:
02/06/22 21:38:16 (3 years ago)
Author:
GitHub <noreply@…>
Branches:
main
Children:
7f36551
Parents:
5b447b0 (diff), 2efe93e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Mato-77 <56981531+Mato-77@…> (02/06/22 21:38:16)
git-committer:
GitHub <noreply@…> (02/06/22 21:38:16)
Message:

Merge pull request #1 from partaloski/master

Fixed and added a better front end, improved clarity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/web/controller/UsersController.java

    r5b447b0 r42d565b  
    33
    44import com.wediscussmovies.project.LoggedUser;
     5import com.wediscussmovies.project.model.Movie;
    56import com.wediscussmovies.project.model.exception.InvalidArgumentsException;
    67import com.wediscussmovies.project.model.exception.PasswordsDoNotMatchException;
     
    1314import org.springframework.web.bind.annotation.RequestMapping;
    1415import org.springframework.web.bind.annotation.RequestParam;
     16
     17import java.util.ArrayList;
     18import java.util.List;
    1519
    1620@Controller
     
    5963    @GetMapping("/favoriteList")
    6064    public String getFavoriteList(Model model){
    61         model.addAttribute("movies",this.movieService.findLikedMoviesByUser(LoggedUser.getLoggedUser()));
     65        List<Movie> movieList = this.movieService.findLikedMoviesByUser(LoggedUser.getLoggedUser());
     66        List<List<Movie>> movie_rows = new ArrayList<>();
     67        for(int i=0; i<movieList.size(); i+=4){
     68            int j = i+4;
     69            if(j>movieList.size())
     70                j= movieList.size();
     71            movie_rows.add(movieList.subList(i, j));
     72        }
     73        model.addAttribute("movie_rows", movie_rows);
    6274        model.addAttribute("contentTemplate","favoriteList");
    6375        return "template";
Note: See TracChangeset for help on using the changeset viewer.