Index: src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java
===================================================================
--- src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -29,5 +29,5 @@
         http.csrf().disable()
                 .authorizeRequests()
-                .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**", "/js/**").permitAll()
+                .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**","/img/**", "/js/**").permitAll()
                 .anyRequest()
                 .authenticated()
Index: src/main/java/com/wediscussmovies/project/model/Genre.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Genre.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/model/Genre.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -22,4 +22,9 @@
     }
 
+    public Genre(int genreId, String genreType) {
+        this.genreId = genreId;
+        this.genreType = genreType;
+    }
+
     public Genre(String genreType) {
         this.genreType = genreType;
Index: src/main/java/com/wediscussmovies/project/model/Movie.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/model/Movie.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -66,4 +66,17 @@
     }
 
+    public Movie(int movieId, String title, Double imdbRating, String imageUrl) {
+        this.movieId = movieId;
+        this.title = title;
+        this.imdbRating = imdbRating;
+        this.imageUrl = imageUrl;
+    }
+
+    public String getDateFormatted(){
+        String dob = airingDate.toString();
+        String [] parts = dob.split("-");
+        return parts[2]+"/"+parts[1]+"/"+parts[0];
+    }
+
     @Override
     public boolean equals(Object o) {
Index: src/main/java/com/wediscussmovies/project/model/Person.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Person.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/model/Person.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -6,5 +6,8 @@
 
 import javax.persistence.*;
+import javax.swing.text.DateFormatter;
 import java.sql.Date;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.Collection;
 
@@ -73,4 +76,10 @@
 
 
+    public String getDateFormatted(){
+        String dob = dateOfBirth.toString();
+        String [] parts = dob.split("-");
+        return parts[2]+"/"+parts[1]+"/"+parts[0];
+    }
+
 
     public Person(String name, String surname, Character type, Date dateOfBirth, String imageUrl, String description) {
Index: src/main/java/com/wediscussmovies/project/model/primarykeys/DiscussionLikesPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/primarykeys/DiscussionLikesPK.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
+++ src/main/java/com/wediscussmovies/project/model/primarykeys/DiscussionLikesPK.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -0,0 +1,40 @@
+package com.wediscussmovies.project.model.primarykeys;
+
+
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+import java.util.Objects;
+
+@Embeddable
+@Data
+public class DiscussionLikesPK implements Serializable {
+    @Column(name = "discussion_id")
+    private int discussionId;
+
+    @Column(name = "user_id")
+    private int userId;
+
+    public DiscussionLikesPK(int discussionId, int userId) {
+        this.discussionId = discussionId;
+        this.userId = userId;
+    }
+
+    public DiscussionLikesPK() {
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        DiscussionLikesPK that = (DiscussionLikesPK) o;
+        return discussionId == that.discussionId && userId == that.userId;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(discussionId, userId);
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/relation/DiscussionLikes.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/relation/DiscussionLikes.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
+++ src/main/java/com/wediscussmovies/project/model/relation/DiscussionLikes.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -0,0 +1,39 @@
+package com.wediscussmovies.project.model.relation;
+
+
+import com.wediscussmovies.project.model.Discussion;
+import com.wediscussmovies.project.model.Movie;
+import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK;
+import com.wediscussmovies.project.model.primarykeys.MovieLikesPK;
+import lombok.Data;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "discussion_likes", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@Data
+public class DiscussionLikes {
+    @EmbeddedId
+    private DiscussionLikesPK id;
+
+    @ManyToOne
+    @MapsId("discussion_id")
+    @JoinColumn(name = "discussion_id")
+    private Discussion discussion;
+
+
+    @ManyToOne
+    @MapsId("user_id")
+    @JoinColumn(name = "user_id")
+    private User user;
+
+    public DiscussionLikes(Discussion discussion, User user) {
+        this.id = new DiscussionLikesPK(discussion.getDiscussionId(), user.getUserId());
+        this.discussion = discussion;
+        this.user = user;
+    }
+
+    public DiscussionLikes() {
+    }
+}
Index: src/main/java/com/wediscussmovies/project/querymodels/DiscussionLikes.java
===================================================================
--- src/main/java/com/wediscussmovies/project/querymodels/DiscussionLikes.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
+++ src/main/java/com/wediscussmovies/project/querymodels/DiscussionLikes.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -0,0 +1,32 @@
+package com.wediscussmovies.project.querymodels;
+
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+public class DiscussionLikes {
+    private Integer discussionId;
+    private Long likes;
+
+    public DiscussionLikes(Integer discussionId, Long likes) {
+        this.discussionId = discussionId;
+        this.likes = likes;
+    }
+
+    public DiscussionLikes() {
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        DiscussionLikes that = (DiscussionLikes) o;
+        return Objects.equals(discussionId, that.discussionId) && Objects.equals(likes, that.likes);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(discussionId, likes);
+    }
+}
Index: src/main/java/com/wediscussmovies/project/querymodels/MovieLikesQM.java
===================================================================
--- src/main/java/com/wediscussmovies/project/querymodels/MovieLikesQM.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
+++ src/main/java/com/wediscussmovies/project/querymodels/MovieLikesQM.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -0,0 +1,29 @@
+package com.wediscussmovies.project.querymodels;
+
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+public class MovieLikesQM {
+    private Integer movieId;
+    private Long likes;
+
+    public MovieLikesQM(Integer movieId, Long likes) {
+        this.movieId = movieId;
+        this.likes = likes;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        MovieLikesQM that = (MovieLikesQM) o;
+        return Objects.equals(movieId, that.movieId) && Objects.equals(likes, that.likes);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(movieId, likes);
+    }
+}
Index: src/main/java/com/wediscussmovies/project/repository/DiscussionLikesRepository.java
===================================================================
--- src/main/java/com/wediscussmovies/project/repository/DiscussionLikesRepository.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
+++ src/main/java/com/wediscussmovies/project/repository/DiscussionLikesRepository.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -0,0 +1,17 @@
+package com.wediscussmovies.project.repository;
+
+import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK;
+import com.wediscussmovies.project.model.primarykeys.UserGenresPK;
+import com.wediscussmovies.project.model.relation.DiscussionLikes;
+import com.wediscussmovies.project.model.relation.MovieLikes;
+import com.wediscussmovies.project.model.relation.UserGenres;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface DiscussionLikesRepository extends JpaRepository<DiscussionLikes, DiscussionLikesPK> {
+    List<DiscussionLikes> findAllByUser(User user);
+}
Index: src/main/java/com/wediscussmovies/project/repository/DiscussionRepository.java
===================================================================
--- src/main/java/com/wediscussmovies/project/repository/DiscussionRepository.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/repository/DiscussionRepository.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -4,7 +4,11 @@
 import com.wediscussmovies.project.model.Movie;
 import com.wediscussmovies.project.model.Person;
+import com.wediscussmovies.project.querymodels.DiscussionLikes;
+import com.wediscussmovies.project.querymodels.GenreLikes;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
 import org.springframework.stereotype.Repository;
 
+import javax.transaction.Transactional;
 import java.util.List;
 
@@ -14,3 +18,10 @@
      List<Discussion> findAllByMovie(Movie movie);
      List<Discussion> findAllByPerson (Person person);
+
+     @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikes(d.discussionId, count(dl.id.userId)) from Discussion d" +
+             " left join DiscussionLikes dl on dl.id.discussionId = d.discussionId" +
+             " group by d.discussionId" +
+             " order by count(dl.id.userId) desc")
+     @Transactional
+     List<DiscussionLikes> findAllWithLikes();
 }
Index: src/main/java/com/wediscussmovies/project/repository/GenreRepository.java
===================================================================
--- src/main/java/com/wediscussmovies/project/repository/GenreRepository.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/repository/GenreRepository.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -28,3 +28,7 @@
      @Transactional
      void insertInto(@Param("user_id")Integer userId, @Param("genre_id")Integer genreId);
+
+     @Query(value = "select new com.wediscussmovies.project.model.Genre (g.genreId, g.genreType) from Genre g" +
+     " ORDER BY g.genreType DESC")
+     List<Genre> findAllSorted();
 }
Index: src/main/java/com/wediscussmovies/project/repository/MovieRepository.java
===================================================================
--- src/main/java/com/wediscussmovies/project/repository/MovieRepository.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/repository/MovieRepository.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -3,9 +3,14 @@
 import com.wediscussmovies.project.model.Movie;
 import com.wediscussmovies.project.model.Person;
+import com.wediscussmovies.project.querymodels.GenreLikes;
+import com.wediscussmovies.project.querymodels.MovieLikesQM;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
+import javax.transaction.Transactional;
 import java.util.List;
+import java.util.Optional;
 
 @Repository
@@ -16,3 +21,24 @@
      @Query(value="select m.movieId from Movie m")
      List<Integer> findAllMovieIds();
+
+     @Query(value="select new com.wediscussmovies.project.model.Movie(m.movieId, m.title, m.imdbRating, m.imageUrl) from Movie m" +
+               " where m.movieId = :index")
+     Optional<Movie> findBasicById(@Param("index")Integer index);
+
+
+     @Query(value = "select new com.wediscussmovies.project.querymodels.MovieLikesQM(m.movieId, count(ml.id.userId)) from Movie m" +
+             " left join MovieLikes ml on ml.id.movieId = m.movieId" +
+             " group by m.movieId" +
+             " order by count(ml.id.userId) desc")
+     @Transactional
+     List<MovieLikesQM> findAllWithLikes();
+
+     @Query(value = "select new com.wediscussmovies.project.querymodels.MovieLikesQM(m.movieId, count(ml.id.userId)) from Movie m" +
+             " left join MovieLikes ml on ml.id.movieId = m.movieId" +
+             " group by m.movieId" +
+             " having m.movieId = :id")
+     @Transactional
+     List<MovieLikesQM> findLikesForMovie(@Param("id") Integer movie_id);
+
+
 }
Index: src/main/java/com/wediscussmovies/project/service/DiscussionService.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/DiscussionService.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/DiscussionService.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -3,4 +3,5 @@
 import com.wediscussmovies.project.model.Discussion;
 import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.querymodels.DiscussionLikes;
 
 import java.util.List;
@@ -16,3 +17,8 @@
     void unlikeDiscussion(Integer discussionId,Integer userId);
     List<Discussion> findAllForPersonOrMovie(Integer id,Character type);
+
+    List<Discussion> findLikedDiscussionsByUser(User user);
+
+    DiscussionLikes findLikesForDiscussionWithId(int discussionId);
+
 }
Index: src/main/java/com/wediscussmovies/project/service/MovieService.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/MovieService.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/MovieService.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -6,4 +6,5 @@
 import com.wediscussmovies.project.model.Person;
 import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.querymodels.MovieLikesQM;
 import org.springframework.data.jpa.repository.Query;
 
@@ -17,4 +18,5 @@
      List<Movie> searchByTitle(String title);
      Movie findById(Integer id);
+     Movie findBasicById(Integer id);
      List<Integer> listAllIds();
      Movie save(String title, String description, String imageUrl, Date airingDate,Double  rating,
@@ -35,3 +37,5 @@
 
      void addGradeMovie(Integer movieId, User user, Grade grade);
+
+    MovieLikesQM findLikesForMovieById(int movieId);
 }
Index: src/main/java/com/wediscussmovies/project/service/impl/DiscussionServiceImpl.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/impl/DiscussionServiceImpl.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/impl/DiscussionServiceImpl.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -5,20 +5,17 @@
 import com.wediscussmovies.project.model.exception.PersonNotExistException;
 import com.wediscussmovies.project.model.exception.UserNotExistException;
-import com.wediscussmovies.project.repository.DiscussionRepository;
+import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK;
+import com.wediscussmovies.project.model.relation.DiscussionLikes;
+import com.wediscussmovies.project.repository.*;
 import com.wediscussmovies.project.model.Discussion;
 import com.wediscussmovies.project.model.Movie;
 import com.wediscussmovies.project.model.Person;
 import com.wediscussmovies.project.model.User;
-import com.wediscussmovies.project.repository.MovieRepository;
-import com.wediscussmovies.project.repository.PersonRepository;
-import com.wediscussmovies.project.repository.UserRepository;
 import com.wediscussmovies.project.service.DiscussionService;
-import com.wediscussmovies.project.service.MovieService;
-import com.wediscussmovies.project.service.PersonService;
-import com.wediscussmovies.project.service.UserService;
 import org.springframework.stereotype.Service;
 
 import java.sql.Date;
 import java.time.LocalDate;
+import java.util.ArrayList;
 import java.util.List;
 
@@ -27,4 +24,5 @@
 
     private final DiscussionRepository discussionRepository;
+    private final DiscussionLikesRepository discussionLikesRepository;
     private final UserRepository userRepository;
 
@@ -32,7 +30,8 @@
     private final PersonRepository personRepository;
 
-    public DiscussionServiceImpl(DiscussionRepository discussionRepository, UserRepository userRepository,
+    public DiscussionServiceImpl(DiscussionRepository discussionRepository, DiscussionLikesRepository discussionLikesRepository, UserRepository userRepository,
                                  MovieRepository movieRepository, PersonRepository personRepository) {
         this.discussionRepository = discussionRepository;
+        this.discussionLikesRepository = discussionLikesRepository;
         this.userRepository = userRepository;
         this.movieRepository = movieRepository;
@@ -94,11 +93,30 @@
     @Override
     public void likeDiscussion(Integer discussionId, Integer userId) {
-        //ova fali od dijagram
+        Discussion discussion = discussionRepository.findById(discussionId).orElseThrow(() -> new DiscussionNotExistException(discussionId));
+        User user = userRepository.findById(userId).orElseThrow(() -> new UserNotExistException(userId.toString()));
+        this.discussionLikesRepository.save(new DiscussionLikes(discussion, user));
+    }
+
+    @Override
+    public List<Discussion> findLikedDiscussionsByUser(User user) {
+        List<DiscussionLikes> likes = discussionLikesRepository.findAllByUser(user);
+        List<Discussion> discussions = new ArrayList<>();
+        for(DiscussionLikes dl: likes){
+            discussions.add(dl.getDiscussion());
+        }
+        return discussions;
     }
 
     @Override
     public void unlikeDiscussion(Integer discussionId, Integer userId) {
-        // ova fali od dijagram
+        DiscussionLikesPK pk = new DiscussionLikesPK(discussionId, userId);
+        this.discussionLikesRepository.deleteById(pk);
     }
+
+    @Override
+    public com.wediscussmovies.project.querymodels.DiscussionLikes findLikesForDiscussionWithId(int discussionId) {
+        return discussionRepository.findAllWithLikes().stream().filter(d ->  d.getDiscussionId().equals(discussionId)).findFirst().get();
+    }
+
 
     @Override
Index: src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -56,5 +56,5 @@
     @Override
     public List<Genre> findAll() {
-        return this.genreRepository.findAll();
+        return this.genreRepository.findAllSorted();
     }
 
Index: src/main/java/com/wediscussmovies/project/service/impl/MovieServiceImpl.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/impl/MovieServiceImpl.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/impl/MovieServiceImpl.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -13,4 +13,5 @@
 import com.wediscussmovies.project.model.relation.MovieLikes;
 import com.wediscussmovies.project.model.relation.MovieRates;
+import com.wediscussmovies.project.querymodels.MovieLikesQM;
 import com.wediscussmovies.project.repository.*;
 import com.wediscussmovies.project.model.exception.MovieIdNotFoundException;
@@ -73,4 +74,14 @@
     public Movie findById(Integer id) {
         return this.movieRepository.findById(id).orElseThrow(() -> new MovieIdNotFoundException(id));
+    }
+
+    @Override
+    public Movie findBasicById(Integer id) {
+        return this.movieRepository.findBasicById(id).orElseThrow(() -> new MovieIdNotFoundException(id));
+    }
+
+    @Override
+    public MovieLikesQM findLikesForMovieById(int movieId) {
+        return this.movieRepository.findLikesForMovie(movieId).get(0);
     }
 
Index: src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java
===================================================================
--- src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -9,4 +9,5 @@
 import com.wediscussmovies.project.model.primarykeys.PersonRatesPK;
 import com.wediscussmovies.project.model.relation.MovieActors;
+import com.wediscussmovies.project.model.relation.MovieLikes;
 import com.wediscussmovies.project.model.relation.PersonRates;
 import com.wediscussmovies.project.repository.*;
@@ -28,5 +29,4 @@
     private final MovieActorsRepository movieActorsRepository;
     private final PersonRatesRepository personRatesRepository;
-
     public PersonServiceImpl(PersonRepository personRepository,
                              MovieRepository movieRepository, MovieActorsRepository movieActorsRepository,
@@ -152,5 +152,4 @@
 
 
-
     private void addActorForMovies(Person person, List<Integer> movieIds){
 
Index: src/main/java/com/wediscussmovies/project/web/PageFrontMovies.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/PageFrontMovies.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/web/PageFrontMovies.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -32,5 +32,8 @@
 
         for(Integer id: movieIds){
-            movies.add(movieService.findById(id));
+            //Trying to improve load times by not pulling all things from the database, excluding un-needed stuff
+            //
+            //movies.add(movieService.findById(id));
+            movies.add(movieService.findBasicById(id));
         }
         model.addAttribute("page", page);
Index: src/main/java/com/wediscussmovies/project/web/controller/DiscussionController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/DiscussionController.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/web/controller/DiscussionController.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -5,4 +5,5 @@
 import com.wediscussmovies.project.model.Reply;
 import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.model.relation.DiscussionLikes;
 import com.wediscussmovies.project.service.DiscussionService;
 import com.wediscussmovies.project.service.MovieService;
@@ -17,4 +18,5 @@
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
@@ -46,4 +48,6 @@
         model.addAttribute("contentTemplate", "discussionsList");
         model.addAttribute("user",LoggedUser.getLoggedUser());
+        this.addModelPropertiesForUser(model);
+        this.addModelPropertiesLikes(model,null, discussions);
         return "template";
     }
@@ -62,4 +66,6 @@
             model.addAttribute("user",LoggedUser.getLoggedUser());
             model.addAttribute("replies",this.replyService.findAllByDiscussion(disc));
+            addModelPropertiesLikes(model, disc, null);
+            addModelPropertiesForUser(model);
 
             return "template";
@@ -171,4 +177,21 @@
 
     }
+    private void addModelPropertiesForUser(Model model){
+        User user = LoggedUser.getLoggedUser();
+        model.addAttribute("likedDiscussions",this.discussionService.findLikedDiscussionsByUser(user));
+        model.addAttribute("user",user);
+    }
+    private void addModelPropertiesLikes(Model model, Discussion discussion, List<Discussion> discussions){
+        if(discussion==null){
+            List<com.wediscussmovies.project.querymodels.DiscussionLikes> discussionLikes = new ArrayList<>();
+            for(Discussion d: discussions){
+                discussionLikes.add(discussionService.findLikesForDiscussionWithId(d.getDiscussionId()));
+            }
+            model.addAttribute("likes", discussionLikes);
+        }
+        else{
+            model.addAttribute("likes",discussionService.findLikesForDiscussionWithId(discussion.getDiscussionId()).getLikes());
+        }
+    }
 
 
Index: src/main/java/com/wediscussmovies/project/web/controller/MovieController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/MovieController.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/web/controller/MovieController.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -5,4 +5,5 @@
 import com.wediscussmovies.project.model.Person;
 import com.wediscussmovies.project.model.User;
+import com.wediscussmovies.project.querymodels.MovieLikesQM;
 import com.wediscussmovies.project.service.GenreService;
 import com.wediscussmovies.project.service.MovieService;
@@ -23,4 +24,6 @@
 import java.time.LocalDate;
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedList;
 import java.util.List;
 
@@ -39,5 +42,5 @@
 
     @GetMapping("/old")
-    public String getMovies(@RequestParam(required = false) String titleQuery, Model model,
+    public String getMoviesOld(@RequestParam(required = false) String titleQuery, Model model,
                             @RequestParam(required = false) String error){
         List<Movie> movies;
@@ -56,4 +59,5 @@
         model.addAttribute("movie_rows", movie_rows);
         model.addAttribute("contentTemplate", "moviesList");
+        model.addAttribute("genres", genreService.findAll());
         if (error != null && !error.equals(" "))
             model.addAttribute("error",error);
@@ -63,5 +67,5 @@
 
     @GetMapping
-    public String getMoviesAlternative(@RequestParam(required = false) String titleQuery, Model model,
+    public String getMovies(@RequestParam(required = false) String titleQuery, Model model,
                             @RequestParam(required = false) String error, @RequestParam(required = false) String page){
         if (page==null){
@@ -72,6 +76,8 @@
         List<List<Movie>> movie_rows = new ArrayList<>();
         DesignFrontMovies.designMovieList(movies,movie_rows);
+        //addModelPropertiesForMoviesLikes(model, movies);
         model.addAttribute("movies", movies);
         model.addAttribute("movie_rows", movie_rows);
+        model.addAttribute("genres", genreService.findAll());
         model.addAttribute("contentTemplate", "moviesListPaged");
         if (error != null && !error.equals(" "))
@@ -84,4 +90,5 @@
         model.addAttribute("movie", movieService.findById(id));
         addModelPropertiesForUser(model);
+        model.addAttribute("likes", movieService.findLikesForMovieById(id).getLikes());
         model.addAttribute("contentTemplate", "movieShow");
         return "template";
@@ -189,4 +196,11 @@
         model.addAttribute("user",user);
     }
+    private void addModelPropertiesForMoviesLikes(Model model, List<Movie> movies){
+        HashMap<Integer,MovieLikesQM> movieLikes = new HashMap<>();
+        for(Movie m: movies){
+            movieLikes.put(m.getMovieId(),movieService.findLikesForMovieById(m.getMovieId()));
+        }
+        model.addAttribute("movieLikes", movieLikes);
+    }
 
 }
Index: src/main/java/com/wediscussmovies/project/web/controller/rest/MovieRestController.java
===================================================================
--- src/main/java/com/wediscussmovies/project/web/controller/rest/MovieRestController.java	(revision 3c0f9a97ce7897bbdf19cc016cc2edaede3e204c)
+++ src/main/java/com/wediscussmovies/project/web/controller/rest/MovieRestController.java	(revision c02189fa25621ce1d654581cba8f42042572979c)
@@ -52,4 +52,8 @@
     public ResponseEntity addGrade(@PathVariable Integer movieId, @RequestBody Grade grade){
         try {
+            if(grade.getRating() < 5)
+                grade.setRating(5);
+            else if(grade.getRating()>10)
+                grade.setRating(10);
             this.movieService.addGradeMovie(movieId, LoggedUser.getLoggedUser(),grade);
             return ResponseEntity.ok(true);
