Changes in / [0226942:ad4243e] in Git
- Files:
-
- 12 deleted
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java
r0226942 rad4243e 29 29 http.csrf().disable() 30 30 .authorizeRequests() 31 .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**", "/img/**","/js/**").permitAll()31 .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**", "/js/**").permitAll() 32 32 .anyRequest() 33 33 .authenticated() -
src/main/java/com/wediscussmovies/project/model/Genre.java
r0226942 rad4243e 22 22 } 23 23 24 public Genre(int genreId, String genreType) {25 this.genreId = genreId;26 this.genreType = genreType;27 }28 29 24 public Genre(String genreType) { 30 25 this.genreType = genreType; -
src/main/java/com/wediscussmovies/project/model/Movie.java
r0226942 rad4243e 66 66 } 67 67 68 public Movie(int movieId, String title, Double imdbRating, String imageUrl) {69 this.movieId = movieId;70 this.title = title;71 this.imdbRating = imdbRating;72 this.imageUrl = imageUrl;73 }74 75 public String getDateFormatted(){76 String dob = airingDate.toString();77 String [] parts = dob.split("-");78 return parts[2]+"/"+parts[1]+"/"+parts[0];79 }80 81 68 @Override 82 69 public boolean equals(Object o) { -
src/main/java/com/wediscussmovies/project/model/Person.java
r0226942 rad4243e 6 6 7 7 import javax.persistence.*; 8 import javax.swing.text.DateFormatter;9 8 import java.sql.Date; 10 import java.time.LocalDate;11 import java.time.format.DateTimeFormatter;12 9 import java.util.Collection; 13 10 … … 76 73 77 74 78 public String getDateFormatted(){79 String dob = dateOfBirth.toString();80 String [] parts = dob.split("-");81 return parts[2]+"/"+parts[1]+"/"+parts[0];82 }83 84 75 85 76 public Person(String name, String surname, Character type, Date dateOfBirth, String imageUrl, String description) { -
src/main/java/com/wediscussmovies/project/repository/DiscussionRepository.java
r0226942 rad4243e 4 4 import com.wediscussmovies.project.model.Movie; 5 5 import com.wediscussmovies.project.model.Person; 6 import com.wediscussmovies.project.querymodels.DiscussionLikes;7 import com.wediscussmovies.project.querymodels.GenreLikes;8 6 import org.springframework.data.jpa.repository.JpaRepository; 9 import org.springframework.data.jpa.repository.Query;10 7 import org.springframework.stereotype.Repository; 11 8 12 import javax.transaction.Transactional;13 9 import java.util.List; 14 10 … … 18 14 List<Discussion> findAllByMovie(Movie movie); 19 15 List<Discussion> findAllByPerson (Person person); 20 21 @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikes(d.discussionId, count(dl.id.userId)) from Discussion d" +22 " left join DiscussionLikes dl on dl.id.discussionId = d.discussionId" +23 " group by d.discussionId" +24 " order by count(dl.id.userId) desc")25 @Transactional26 List<DiscussionLikes> findAllWithLikes();27 16 } -
src/main/java/com/wediscussmovies/project/repository/GenreRepository.java
r0226942 rad4243e 28 28 @Transactional 29 29 void insertInto(@Param("user_id")Integer userId, @Param("genre_id")Integer genreId); 30 31 @Query(value = "select new com.wediscussmovies.project.model.Genre (g.genreId, g.genreType) from Genre g" +32 " ORDER BY g.genreType DESC")33 List<Genre> findAllSorted();34 30 } -
src/main/java/com/wediscussmovies/project/repository/MovieRepository.java
r0226942 rad4243e 3 3 import com.wediscussmovies.project.model.Movie; 4 4 import com.wediscussmovies.project.model.Person; 5 import com.wediscussmovies.project.querymodels.GenreLikes;6 import com.wediscussmovies.project.querymodels.MovieLikesQM;7 5 import org.springframework.data.jpa.repository.JpaRepository; 8 6 import org.springframework.data.jpa.repository.Query; 9 import org.springframework.data.repository.query.Param;10 7 import org.springframework.stereotype.Repository; 11 8 12 import javax.transaction.Transactional;13 9 import java.util.List; 14 import java.util.Optional;15 10 16 11 @Repository … … 21 16 @Query(value="select m.movieId from Movie m") 22 17 List<Integer> findAllMovieIds(); 23 24 @Query(value="select new com.wediscussmovies.project.model.Movie(m.movieId, m.title, m.imdbRating, m.imageUrl) from Movie m" +25 " where m.movieId = :index")26 Optional<Movie> findBasicById(@Param("index")Integer index);27 28 29 @Query(value = "select new com.wediscussmovies.project.querymodels.MovieLikesQM(m.movieId, count(ml.id.userId)) from Movie m" +30 " left join MovieLikes ml on ml.id.movieId = m.movieId" +31 " group by m.movieId" +32 " order by count(ml.id.userId) desc")33 @Transactional34 List<MovieLikesQM> findAllWithLikes();35 36 @Query(value = "select new com.wediscussmovies.project.querymodels.MovieLikesQM(m.movieId, count(ml.id.userId)) from Movie m" +37 " left join MovieLikes ml on ml.id.movieId = m.movieId" +38 " group by m.movieId" +39 " having m.movieId = :id")40 @Transactional41 List<MovieLikesQM> findLikesForMovie(@Param("id") Integer movie_id);42 43 44 18 } -
src/main/java/com/wediscussmovies/project/service/DiscussionService.java
r0226942 rad4243e 3 3 import com.wediscussmovies.project.model.Discussion; 4 4 import com.wediscussmovies.project.model.User; 5 import com.wediscussmovies.project.querymodels.DiscussionLikes;6 5 7 6 import java.util.List; … … 17 16 void unlikeDiscussion(Integer discussionId,Integer userId); 18 17 List<Discussion> findAllForPersonOrMovie(Integer id,Character type); 19 20 List<Discussion> findLikedDiscussionsByUser(User user);21 22 DiscussionLikes findLikesForDiscussionWithId(int discussionId);23 24 18 } -
src/main/java/com/wediscussmovies/project/service/MovieService.java
r0226942 rad4243e 6 6 import com.wediscussmovies.project.model.Person; 7 7 import com.wediscussmovies.project.model.User; 8 import com.wediscussmovies.project.querymodels.MovieLikesQM;9 8 import org.springframework.data.jpa.repository.Query; 10 9 … … 18 17 List<Movie> searchByTitle(String title); 19 18 Movie findById(Integer id); 20 Movie findBasicById(Integer id);21 19 List<Integer> listAllIds(); 22 20 Movie save(String title, String description, String imageUrl, Date airingDate,Double rating, … … 37 35 38 36 void addGradeMovie(Integer movieId, User user, Grade grade); 39 40 MovieLikesQM findLikesForMovieById(int movieId);41 37 } -
src/main/java/com/wediscussmovies/project/service/impl/DiscussionServiceImpl.java
r0226942 rad4243e 5 5 import com.wediscussmovies.project.model.exception.PersonNotExistException; 6 6 import com.wediscussmovies.project.model.exception.UserNotExistException; 7 import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK; 8 import com.wediscussmovies.project.model.relation.DiscussionLikes; 9 import com.wediscussmovies.project.repository.*; 7 import com.wediscussmovies.project.repository.DiscussionRepository; 10 8 import com.wediscussmovies.project.model.Discussion; 11 9 import com.wediscussmovies.project.model.Movie; 12 10 import com.wediscussmovies.project.model.Person; 13 11 import com.wediscussmovies.project.model.User; 12 import com.wediscussmovies.project.repository.MovieRepository; 13 import com.wediscussmovies.project.repository.PersonRepository; 14 import com.wediscussmovies.project.repository.UserRepository; 14 15 import com.wediscussmovies.project.service.DiscussionService; 16 import com.wediscussmovies.project.service.MovieService; 17 import com.wediscussmovies.project.service.PersonService; 18 import com.wediscussmovies.project.service.UserService; 15 19 import org.springframework.stereotype.Service; 16 20 17 21 import java.sql.Date; 18 22 import java.time.LocalDate; 19 import java.util.ArrayList;20 23 import java.util.List; 21 24 … … 24 27 25 28 private final DiscussionRepository discussionRepository; 26 private final DiscussionLikesRepository discussionLikesRepository;27 29 private final UserRepository userRepository; 28 30 … … 30 32 private final PersonRepository personRepository; 31 33 32 public DiscussionServiceImpl(DiscussionRepository discussionRepository, DiscussionLikesRepository discussionLikesRepository,UserRepository userRepository,34 public DiscussionServiceImpl(DiscussionRepository discussionRepository, UserRepository userRepository, 33 35 MovieRepository movieRepository, PersonRepository personRepository) { 34 36 this.discussionRepository = discussionRepository; 35 this.discussionLikesRepository = discussionLikesRepository;36 37 this.userRepository = userRepository; 37 38 this.movieRepository = movieRepository; … … 93 94 @Override 94 95 public void likeDiscussion(Integer discussionId, Integer userId) { 95 Discussion discussion = discussionRepository.findById(discussionId).orElseThrow(() -> new DiscussionNotExistException(discussionId)); 96 User user = userRepository.findById(userId).orElseThrow(() -> new UserNotExistException(userId.toString())); 97 this.discussionLikesRepository.save(new DiscussionLikes(discussion, user)); 98 } 99 100 @Override 101 public List<Discussion> findLikedDiscussionsByUser(User user) { 102 List<DiscussionLikes> likes = discussionLikesRepository.findAllByUser(user); 103 List<Discussion> discussions = new ArrayList<>(); 104 for(DiscussionLikes dl: likes){ 105 discussions.add(dl.getDiscussion()); 106 } 107 return discussions; 96 //ova fali od dijagram 108 97 } 109 98 110 99 @Override 111 100 public void unlikeDiscussion(Integer discussionId, Integer userId) { 112 DiscussionLikesPK pk = new DiscussionLikesPK(discussionId, userId); 113 this.discussionLikesRepository.deleteById(pk); 101 // ova fali od dijagram 114 102 } 115 116 @Override117 public com.wediscussmovies.project.querymodels.DiscussionLikes findLikesForDiscussionWithId(int discussionId) {118 return discussionRepository.findAllWithLikes().stream().filter(d -> d.getDiscussionId().equals(discussionId)).findFirst().get();119 }120 121 103 122 104 @Override -
src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java
r0226942 rad4243e 56 56 @Override 57 57 public List<Genre> findAll() { 58 return this.genreRepository.findAll Sorted();58 return this.genreRepository.findAll(); 59 59 } 60 60 -
src/main/java/com/wediscussmovies/project/service/impl/MovieServiceImpl.java
r0226942 rad4243e 13 13 import com.wediscussmovies.project.model.relation.MovieLikes; 14 14 import com.wediscussmovies.project.model.relation.MovieRates; 15 import com.wediscussmovies.project.querymodels.MovieLikesQM;16 15 import com.wediscussmovies.project.repository.*; 17 16 import com.wediscussmovies.project.model.exception.MovieIdNotFoundException; … … 74 73 public Movie findById(Integer id) { 75 74 return this.movieRepository.findById(id).orElseThrow(() -> new MovieIdNotFoundException(id)); 76 }77 78 @Override79 public Movie findBasicById(Integer id) {80 return this.movieRepository.findBasicById(id).orElseThrow(() -> new MovieIdNotFoundException(id));81 }82 83 @Override84 public MovieLikesQM findLikesForMovieById(int movieId) {85 return this.movieRepository.findLikesForMovie(movieId).get(0);86 75 } 87 76 -
src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java
r0226942 rad4243e 9 9 import com.wediscussmovies.project.model.primarykeys.PersonRatesPK; 10 10 import com.wediscussmovies.project.model.relation.MovieActors; 11 import com.wediscussmovies.project.model.relation.MovieLikes;12 11 import com.wediscussmovies.project.model.relation.PersonRates; 13 12 import com.wediscussmovies.project.repository.*; … … 29 28 private final MovieActorsRepository movieActorsRepository; 30 29 private final PersonRatesRepository personRatesRepository; 30 31 31 public PersonServiceImpl(PersonRepository personRepository, 32 32 MovieRepository movieRepository, MovieActorsRepository movieActorsRepository, … … 152 152 153 153 154 154 155 private void addActorForMovies(Person person, List<Integer> movieIds){ 155 156 -
src/main/java/com/wediscussmovies/project/web/PageFrontMovies.java
r0226942 rad4243e 32 32 33 33 for(Integer id: movieIds){ 34 //Trying to improve load times by not pulling all things from the database, excluding un-needed stuff 35 // 36 //movies.add(movieService.findById(id)); 37 movies.add(movieService.findBasicById(id)); 34 movies.add(movieService.findById(id)); 38 35 } 39 36 model.addAttribute("page", page); -
src/main/java/com/wediscussmovies/project/web/controller/DiscussionController.java
r0226942 rad4243e 5 5 import com.wediscussmovies.project.model.Reply; 6 6 import com.wediscussmovies.project.model.User; 7 import com.wediscussmovies.project.model.relation.DiscussionLikes;8 7 import com.wediscussmovies.project.service.DiscussionService; 9 8 import com.wediscussmovies.project.service.MovieService; … … 18 17 import org.springframework.web.bind.annotation.*; 19 18 20 import java.util.ArrayList;21 19 import java.util.List; 22 20 … … 48 46 model.addAttribute("contentTemplate", "discussionsList"); 49 47 model.addAttribute("user",LoggedUser.getLoggedUser()); 50 this.addModelPropertiesForUser(model);51 this.addModelPropertiesLikes(model,null, discussions);52 48 return "template"; 53 49 } … … 66 62 model.addAttribute("user",LoggedUser.getLoggedUser()); 67 63 model.addAttribute("replies",this.replyService.findAllByDiscussion(disc)); 68 addModelPropertiesLikes(model, disc, null);69 addModelPropertiesForUser(model);70 64 71 65 return "template"; … … 177 171 178 172 } 179 private void addModelPropertiesForUser(Model model){180 User user = LoggedUser.getLoggedUser();181 model.addAttribute("likedDiscussions",this.discussionService.findLikedDiscussionsByUser(user));182 model.addAttribute("user",user);183 }184 private void addModelPropertiesLikes(Model model, Discussion discussion, List<Discussion> discussions){185 if(discussion==null){186 List<com.wediscussmovies.project.querymodels.DiscussionLikes> discussionLikes = new ArrayList<>();187 for(Discussion d: discussions){188 discussionLikes.add(discussionService.findLikesForDiscussionWithId(d.getDiscussionId()));189 }190 model.addAttribute("likes", discussionLikes);191 }192 else{193 model.addAttribute("likes",discussionService.findLikesForDiscussionWithId(discussion.getDiscussionId()).getLikes());194 }195 }196 173 197 174 -
src/main/java/com/wediscussmovies/project/web/controller/MovieController.java
r0226942 rad4243e 5 5 import com.wediscussmovies.project.model.Person; 6 6 import com.wediscussmovies.project.model.User; 7 import com.wediscussmovies.project.querymodels.MovieLikesQM;8 7 import com.wediscussmovies.project.service.GenreService; 9 8 import com.wediscussmovies.project.service.MovieService; … … 24 23 import java.time.LocalDate; 25 24 import java.util.ArrayList; 26 import java.util.HashMap;27 import java.util.LinkedList;28 25 import java.util.List; 29 26 … … 42 39 43 40 @GetMapping("/old") 44 public String getMovies Old(@RequestParam(required = false) String titleQuery, Model model,41 public String getMovies(@RequestParam(required = false) String titleQuery, Model model, 45 42 @RequestParam(required = false) String error){ 46 43 List<Movie> movies; … … 59 56 model.addAttribute("movie_rows", movie_rows); 60 57 model.addAttribute("contentTemplate", "moviesList"); 61 model.addAttribute("genres", genreService.findAll());62 58 if (error != null && !error.equals(" ")) 63 59 model.addAttribute("error",error); … … 67 63 68 64 @GetMapping 69 public String getMovies (@RequestParam(required = false) String titleQuery, Model model,65 public String getMoviesAlternative(@RequestParam(required = false) String titleQuery, Model model, 70 66 @RequestParam(required = false) String error, @RequestParam(required = false) String page){ 71 67 if (page==null){ … … 76 72 List<List<Movie>> movie_rows = new ArrayList<>(); 77 73 DesignFrontMovies.designMovieList(movies,movie_rows); 78 //addModelPropertiesForMoviesLikes(model, movies);79 74 model.addAttribute("movies", movies); 80 75 model.addAttribute("movie_rows", movie_rows); 81 model.addAttribute("genres", genreService.findAll());82 76 model.addAttribute("contentTemplate", "moviesListPaged"); 83 77 if (error != null && !error.equals(" ")) … … 90 84 model.addAttribute("movie", movieService.findById(id)); 91 85 addModelPropertiesForUser(model); 92 model.addAttribute("likes", movieService.findLikesForMovieById(id).getLikes());93 86 model.addAttribute("contentTemplate", "movieShow"); 94 87 return "template"; … … 196 189 model.addAttribute("user",user); 197 190 } 198 private void addModelPropertiesForMoviesLikes(Model model, List<Movie> movies){199 HashMap<Integer,MovieLikesQM> movieLikes = new HashMap<>();200 for(Movie m: movies){201 movieLikes.put(m.getMovieId(),movieService.findLikesForMovieById(m.getMovieId()));202 }203 model.addAttribute("movieLikes", movieLikes);204 }205 191 206 192 } -
src/main/java/com/wediscussmovies/project/web/controller/rest/MovieRestController.java
r0226942 rad4243e 52 52 public ResponseEntity addGrade(@PathVariable Integer movieId, @RequestBody Grade grade){ 53 53 try { 54 if(grade.getRating() < 5)55 grade.setRating(5);56 else if(grade.getRating()>10)57 grade.setRating(10);58 54 this.movieService.addGradeMovie(movieId, LoggedUser.getLoggedUser(),grade); 59 55 return ResponseEntity.ok(true); -
src/main/resources/static/css/shared.css
r0226942 rad4243e 52 52 .bottom{ 53 53 position: absolute; 54 top: 75%;54 top: 80%; 55 55 margin:auto; 56 56 width: 100%; … … 60 60 background-color: rgba(0,0,0,0.25); 61 61 } 62 .bottom h3, .bottom span{63 margin-bottom: 0px;64 margin-top: 0px;65 }66 .bottom span{67 font-size: 75%;68 margin-top: 5px;69 }70 62 71 63 72 . elements .card .btn{64 .bottom-heart{ 73 65 top: 60%; 74 66 left: auto; … … 113 105 opacity: 0; 114 106 } 115 116 .person-movies-list{117 margin: auto;118 margin-top: 20px;119 padding: 10px;120 width: 80%;121 background-color: rgba(52, 58, 64, 0.7);122 border-radius: 10px;123 transition: 200ms;124 color: white;125 }126 127 .person-movies-list:hover{128 background-color: rgba(52, 58, 64, 1);129 }130 131 .person-movies-list ul{132 list-style-type: none;133 }134 135 .person-movies-list ul li{136 color:black;137 background-color: rgba(255,255,255,0.7);138 padding: 12px;139 font-size: 120%;140 width: 80%;141 text-align: center;142 margin: auto;143 transition: 200ms;144 border-radius: 10px;145 margin-bottom: 5px;146 text-decoration: underline;147 }148 149 .person-movies-list hr{150 color: white;151 background-color: white;152 border-color: white;153 }154 155 .person-movies-list ul li:hover{156 background-color: rgba(255,255,255,1);157 text-decoration-color: blue;158 }159 160 .genres-listing ul li:hover{161 background-color: rgba(222,128,128,1);162 }163 164 .genres-listing ul li{165 background-color: rgba(192,128,128,0.7);166 text-decoration: none !important;167 }168 169 .person-movies-list ul li a{170 color: black;171 transition: 250ms;172 text-decoration: underline;173 text-decoration-color: black;174 }175 176 .person-movies-list ul li a:hover{177 color:blue;178 }179 180 181 #admin-buttons a{182 display: inline-block;183 width: 95%;184 margin: auto;185 margin-top: 10px;186 font-size: 125%;187 clear: both;188 }189 190 #image-movie-section{191 height: fit-content;192 min-height: fit-content;193 }194 195 #likes-showcase{196 background-color: rgba(192,128,128,0.7);197 border-radius: 10px;198 padding:10px;199 width: 60%;200 margin: auto;201 transition: 200ms;202 margin-top: 2%;203 }204 205 #likes-showcase strong{206 font-size: 150%;207 }208 209 #likes-showcase:hover{210 background-color: rgba(222,128,128,1);211 }212 213 .invisible-search{214 display: none;215 } -
src/main/resources/static/js/sharedScript.js
r0226942 rad4243e 4 4 var elements = $(".elements") 5 5 var elementGrade; 6 var first_time = true; 6 7 7 8 8 $("#button-add").on("click", function (){ … … 56 56 $(".button-add-grade-movie").on("click",function (){ 57 57 elementGrade = $(this) 58 urlRating =" /api/movies/grade/"+$(this).attr("movie-id")58 urlRating ="api/movies/grade/"+$(this).attr("movie-id") 59 59 $("#dialog-rating").dialog("open") 60 60 }) 61 61 $(".button-add-grade-person").on("click",function (){ 62 62 elementGrade = $(this) 63 urlRating =" /api/persons/grade/"+$(this).attr("person-id")63 urlRating ="api/persons/grade/"+$(this).attr("person-id") 64 64 $("#dialog-rating").dialog("open") 65 65 }) … … 81 81 })*/ 82 82 83 $("#button_toggle_filters").on("click", function (){84 if(first_time){85 $("#filters_div").removeClass("invisible-search")86 first_time=false87 }88 else89 $("#filters_div").fadeToggle();90 })91 83 92 84 $(".search-button").on("click",function () { 93 elements = $(".elements") 94 let filter = $("#searchGenre").val() 95 console.log('\''+filter+'\'') 96 console.log(elements) 97 if(filter.length==0){ 98 console.log("HERE") 99 for (let item of elements) { 100 $(item).removeClass("visibility") 101 } 102 } 85 let filter = $("#searchGenre").val() 103 86 for (let item of elements) { 104 $(item).removeClass("visibility") 105 let genre = $(item).children(".card-genre") 87 let genre = $(item).find(".card-genre") 106 88 let visible = false; 107 console.log(genre.length) 89 108 90 for (let g of genre) { 109 if (( $(g).text().toLowerCase() === filter.toLowerCase())){ 110 console.log(item.text + ' ' + $(g).text())91 92 if (( $(g).text().toLowerCase() === filter.toLowerCase() && !$(g).hasClass("visibility") && filter.trim().length != 0)) { 111 93 visible = true 112 94 $(item).removeClass("visibility") … … 114 96 } 115 97 } 116 if (!visible){98 if (!visible && filter.trim().length != 0) 117 99 $(item).addClass("visibility") 118 } 100 else 101 $(item).removeClass("visibility") 119 102 120 103 } … … 123 106 $(".button-delete-movie").on("click",function (){ 124 107 let button = $(this) 125 let url = " /api/movies/delete/" + $(button).attr("movie-id")108 let url = "api/movies/delete/" + $(button).attr("movie-id") 126 109 ajaxCallDelete(url,button) 127 110 }) 128 111 $(".button-delete-actor").on("click",function (){ 129 112 let button = $(this) 130 let url = " /api/persons/delete/" + $(button).attr("person-id")113 let url = "api/persons/delete/" + $(button).attr("person-id") 131 114 ajaxCallDelete(url,button) 132 115 }) 133 116 $(".button-delete-discussion").on("click",function (){ 134 117 let button = $(this) 135 let url = " /api/discussions/delete/" + $(button).attr("discussion-id")118 let url = "api/discussions/delete/" + $(button).attr("discussion-id") 136 119 ajaxCallDelete(url,button) 137 120 }) … … 156 139 $(document.body).on("click",".button-add-favourite-list",function (){ 157 140 let button = $(this) 158 let url = " /api/movies/like/"+ $(this).attr("movie-id") + "?userId="+ $(this).attr("user-id")141 let url = "api/movies/like/"+ $(this).attr("movie-id") + "?userId="+ $(this).attr("user-id") 159 142 ajaxCallLike(url,button,'like','Веќе е филмот допаднат!') 160 143 }) 161 144 $(document.body).on("click",".button-remove-favourite-list",function (){ 162 145 let button = $(this) 163 let url = " /api/movies/unlike/"+ $(this).attr("movie-id")+"?userId="+ $(this).attr("user-id")146 let url = "api/movies/unlike/"+ $(this).attr("movie-id")+"?userId="+ $(this).attr("user-id") 164 147 ajaxCallLike(url,button,'unlike','Немате оставено допаѓање на филмот!') 165 148 }) 166 149 $(document.body).on("click",".button-add-genre-liked-list",function (){ 167 150 let button = $(this) 168 let url = " /api/genres/like/"+ $(this).attr("genre-id") + "?userId="+ $(this).attr("user-id")151 let url = "api/genres/like/"+ $(this).attr("genre-id") + "?userId="+ $(this).attr("user-id") 169 152 ajaxCallLikeGenre(url,button,'like','Веќе ви се допаѓа жанрот!') 170 153 }) 171 154 $(document.body).on("click",".button-remove-genre-liked-list",function (){ 172 155 let button = $(this) 173 let url = " /api/genres/unlike/"+ $(this).attr("genre-id")+"?userId="+ $(this).attr("user-id")156 let url = "api/genres/unlike/"+ $(this).attr("genre-id")+"?userId="+ $(this).attr("user-id") 174 157 ajaxCallLikeGenre(url,button,'unlike','Немате оставено допаѓање на жанрот!') 175 })176 $(document.body).on("click",".button-like-discussion",function (){177 let button = $(this)178 let url = "/api/discussions/like/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")179 ajaxCallLikeDiscussion(url,button,'like','Веќе имате оставено допаѓање на дискусијата!')180 })181 $(document.body).on("click",".button-unlike-discussion",function (){182 let button = $(this)183 let url = "/api/discussions/unlike/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")184 ajaxCallLikeDiscussion(url,button,'unlike','Немате оставено допаѓање на дискусијата!')185 })186 $(document.body).on("click",".button-like-discussion-alt",function (){187 let button = $(this)188 let url = "/api/discussions/like/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")189 ajaxCallLikeDiscussionAlternative(url,button,'like','Веќе имате оставено допаѓање на дискусијата!')190 })191 $(document.body).on("click",".button-unlike-discussion-alt",function (){192 let button = $(this)193 let url = "/api/discussions/unlike/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")194 ajaxCallLikeDiscussionAlternative(url,button,'unlike','Немате оставено допаѓање на дискусијата!')195 158 }) 196 159 $(".discussion-type").change(function (){ … … 226 189 let movieId=$(button).attr("movie-id") 227 190 if (type==='like') { 228 $(button).parent().append("<a class='b tn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>")191 $(button).parent().append("<a class='bottom-heart btn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>") 229 192 console.log("da") 230 193 } 231 194 else{ 232 $(button).parent().append("<a class='btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>") 233 } 234 likes_count = $("#movie_likes_count") 235 count = Number($(likes_count).text()) 236 if(type==="like") 237 count++ 238 else 239 count-- 240 likes_count.text(count) 195 $(button).parent().append("<a class='bottom-heart btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>") 196 197 } 241 198 $(button).remove() 242 199 } … … 306 263 307 264 308 309 310 function ajaxCallLikeDiscussion(url,button,type,message){311 $.ajax({312 url:url,313 success:function (data){314 if (data){315 let el = $(button).parent().siblings().eq(3)316 console.log(el)317 if (type=="like") {318 $(el).html(parseInt($(el).text()) + 1)319 console.log("da")320 }321 else322 $(el).html(parseInt($(el).text()) - 1)323 $(button).css("display","none")324 let userId = $(button).attr("user-id")325 let discussionId=$(button).attr("discussion-id")326 if (type==='like') {327 $(button).parent().append("<a class='btn btn-danger button-unlike-discussion' discussion-id=" + discussionId + " user-id=" + userId + ">💔</a>")328 console.log("da")329 }330 else{331 $(button).parent().append("<a class='btn btn-success button-like-discussion' discussion-id=" + discussionId + " user-id=" + userId + ">❤</a>")332 }333 var likes_count = $("#likes_count")334 var count = Number($(likes_count).text())335 if(type==='like')336 count += 1337 else338 count -= 1339 $(likes_count).text(count);340 $(button).remove()341 }342 else {343 $(button).parent().append("<div>" + message +" <button class='button-confirm'>Ок</button></div>")344 }345 }346 })347 }348 349 350 351 function ajaxCallLikeDiscussionAlternative(url,button,type,message){352 $.ajax({353 url:url,354 success:function (data){355 if (data){356 let el = $(button).parent().siblings().eq(3)357 console.log(el)358 if (type=="like") {359 $(el).html(parseInt($(el).text()) + 1)360 console.log("da")361 }362 else363 $(el).html(parseInt($(el).text()) - 1)364 $(button).css("display","none")365 let userId = $(button).attr("user-id")366 let discussionId=$(button).attr("discussion-id")367 if (type==='like') {368 $(button).parent().append("<a class='btn btn-danger button-unlike-discussion-alt' discussion-id=" + discussionId + " user-id=" + userId + ">💔</a>")369 console.log("da")370 }371 else{372 $(button).parent().append("<a class='btn btn-success button-like-discussion-alt' discussion-id=" + discussionId + " user-id=" + userId + ">❤</a>")373 }374 var likes_count = $(button).parent().siblings(".likes_count").first()375 var count = Number(likes_count.text())376 if(type==='like')377 count += 1378 else379 count -= 1380 $(likes_count).text(count);381 $(button).remove()382 }383 else {384 $(button).parent().append("<div>" + message +" <button class='button-confirm'>Ок</button></div>")385 }386 }387 })388 }389 390 391 265 function ajaxCallRating(url,button,type){ 392 266 model = { -
src/main/resources/templates/discussion.html
r0226942 rad4243e 1 1 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"> 2 2 <div style="width: 85%; text-align: justify; margin: auto; clear: both"> 3 <div style="background-color: rgba(128,128,128, 0.2); border-radius: 20px; padding: 20px">4 <h1 th:text="${disc.getTitle()}" style="width: 80%; display: inline; height: fit-content; clear: both"></h1>3 <div> 4 <h1 th:text="${disc.getTitle()}" style="width: 80%; float: left"></h1> 5 5 </div> 6 <hr> 6 <hr><br><br> 7 7 <div> 8 8 <h5 th:text="${disc.getText()}" style="width: 90%; margin: auto; background-color: lightblue; border-radius: 4px; padding: 20px"></h5> 9 9 </div> 10 <br> 11 <h4> 12 <span th:if="${!disc.getUser().equals(user)}" sec:authorize="isAuthenticated()"> 13 <a class='btn btn-success button-like-discussion' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a> 14 <a class='btn btn-danger button-unlike-discussion' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a> 15 </span> 16 <span>Број на допаѓања:</span> 17 <span th:text="${likes}" id="likes_count"></span> 18 </h4> 19 <br> 10 <br><br><br> 20 11 <h6 style="width: 60%; float:left;"> 21 12 <span th:text="${'Поставено од: '+disc.getUser().getUsername()}"></span> … … 26 17 </h6> 27 18 <div style="float: right" sec:authorize="isAuthenticated()"> 28 <a th:if="${disc.getUser().equals(user)}" class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> 29 <a th:if="${disc.getUser().equals(user)}" class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> 30 <a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> 31 32 </div><br> 19 <a th:if="${disc.getUser().equals(user)}" class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> 20 <a th:if="${disc.getUser().equals(user)}" class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> 21 <a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> 22 </div> 33 23 </div> 34 24 <table class="table table-striped" style="width: 70%; margin: auto;"> -
src/main/resources/templates/discussionsList.html
r0226942 rad4243e 4 4 </div> 5 5 <div class="container mb-4"> 6 <div class="row"> 6 7 <div class="col-12" th:if="${discussions.size() > 0}"> 7 8 <div class="table-responsive"> … … 9 10 <thead> 10 11 <tr> 11 <th scope="col">За</th>12 12 <th scope="col">Наслов</th> 13 <th scope="col"> Допаѓања</th>13 <th scope="col">Опис</th> 14 14 <th scope="col">Датум</th> 15 15 <th scope="col">Корисник</th> … … 27 27 <tbody> 28 28 <tr th:each="disc : ${discussions}" class="movie"> 29 <td th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' +disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>29 <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td> 30 30 <td> 31 31 <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a> 32 32 </td> 33 <td th:each="like : ${likes}" th:if="${like.getDiscussionId().equals(disc.getDiscussionId())}" th:text="${like.getLikes()}" class="likes_count"> 34 </td> 33 <td th:text="${disc.getText()}"></td> 35 34 <td th:text="${disc.getDate()}"></td> 36 35 <td th:text="${disc.getUser().getUsername()}"></td> … … 41 40 <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td> 42 41 <td th:if="${!disc.getUser().equals(user)}"> 43 <a class= 'btn btn-success button-like-discussion-alt' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a>44 <a class= 'btn btn-danger button-unlike-discussion-alt' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a>42 <a class="btn btn-success">👍 </a> 43 <a class="btn btn-danger">👎</a> 45 44 </td> 46 45 </th:block> 46 47 47 48 48 </tr> … … 51 51 </div> 52 52 </div> 53 </div> 53 54 </div> 54 55 -
src/main/resources/templates/fragments/header.html
r0226942 rad4243e 2 2 <nav class="navbar navbar-expand-md navbar-dark bg-dark"> 3 3 <div class="container"> 4 <a class="navbar-brand" href="/movies">Форум за филмови</a> 4 5 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" 5 6 aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> … … 27 28 </li> 28 29 </ul> 29 <form class="form-inline my-2 my-lg-0 hidden">30 <form class="form-inline my-2 my-lg-0"> 30 31 <div class="input-group input-group-sm"> 31 32 <input type="text" class="form-control" aria-label="Small" -
src/main/resources/templates/fragments/searchBarGenre.html
r0226942 rad4243e 1 <div xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" style="width:60%; margin: auto; margin-bottom: 10px"> 2 <select th:if="${genres!=null}" id="searchGenre" class="form-control" style="float: left; display: block; width: 50%"> 3 <option value="" selected>Сите</option> 4 <option th:each="genre: ${genres}" th:value="${genre.getGenreType()}" th:text="${genre.getGenreType()}"></option> 5 </select> 6 <div class="input-group-append" style="width: 40%"> 7 <button class="btn btn-secondary search-button" style="width: 100%">Филтрирај по жанр</button> 8 </div> 1 <div> 2 <label for="searchGenre" style="width: 150px;">Пребарај по жанр</label> 3 <input id="searchGenre" type="text" placeholder="жанр"> 4 <button class="search-button">Пребарај</button> 9 5 </div> -
src/main/resources/templates/fragments/searchBarName.html
r0226942 rad4243e 1 <div style="width:60%; margin: auto;"> 2 <input id="searchTitle" class="form-control" style="float: left; display: block; width: 50%" type="text" placeholder="..."> 3 4 <div class="input-group-append" style="width: 40%"> 5 <button class="btn btn-secondary search-button-title" style="width: 100%">Филтрирај по Наслов</button> 6 </div> 7 1 <div> 2 <label for="searchTitle" style="width: 150px;">Прабарај по име</label> 3 <input id="searchTitle" type="text" placeholder="име"> 4 <button class="search-button-title">Пребарај</button> 8 5 </div> -
src/main/resources/templates/movieShow.html
r0226942 rad4243e 13 13 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 80%; margin: auto"> 14 14 <div> 15 <div style="width: 30%; margin-right: 10px; padding:20px; border-right: 3px solid black; border-radius: 10px; float:left" id="image-movie-section"> 16 <img th:src="${movie.getImageUrl()}" style="width: 90%; height: auto; clear: both; margin-bottom: 20px"> 17 <div id="admin-buttons"> 18 <a class="btn btn-primary" th:href="@{'/discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a> 19 <th:block sec:authorize="isAuthenticated()" > 20 <div> 21 <a class="btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">❤</a> 22 <a class="btn btn-danger button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">💔</a> 23 </div> 24 <a class="btn btn-secondary button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a> 25 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a> 26 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a> 27 </th:block> 28 </div> 15 <div style="width: 30%; margin-right: 10px; padding:20px; border-right: 3px solid black; border-radius: 10px; float:left"> 16 <img th:src="${movie.getImageUrl()}" style="width: 90%; height: auto"> 29 17 </div> 30 18 … … 38 26 </h3> 39 27 <h3 th:text="${'IMDB оцена: ' + movie.getImdbRating()}"></h3> 40 <h3 th:text="${'Прикажан на: ' + movie.get DateFormatted()}"></h3>28 <h3 th:text="${'Прикажан на: ' + movie.getAiringDate()}"></h3> 41 29 42 30 <div style="background-color: rgba(200,200,200,0.5); border-radius: 10px; padding:15px; "> … … 45 33 </div> 46 34 47 <div id="likes-showcase"> 48 <h4 style="text-align: center"> 49 <span>Филмот му се допаднал на </span> 50 <strong th:text="${likes}" id="movie_likes_count"></strong> 51 <span> корисници</span> 52 </h4> 53 </div> 54 55 <div class="person-movies-list genres-listing"> 35 <div> 56 36 <h3>Жанрови:</h3> 57 37 <ul> … … 59 39 </ul> 60 40 </div> 61 <div class="person-movies-list">41 <div> 62 42 <h3>Актери:</h3> 63 43 <ul> … … 68 48 </div> 69 49 </div> 70 50 <div id="admin-buttons"> 51 <a class="btn btn-primary" th:href="@{'/discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a> 52 <th:block sec:authorize="isAuthenticated()" > 53 <a class="btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">Додади во омилена листа</a> 54 <a class="btn btn-warning button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">Избриши од омилена листа</a> 55 <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a> 56 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a> 57 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a> 58 </th:block> 59 </div> 71 60 <hr> 72 61 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> … … 81 70 </div> 82 71 <div style="width: 30%; float:right; background-color: darkorange; border-radius: 10px 30px; color: whitesmoke; padding: 10px;"> 83 <h2 style="text-align: center"> Оценет:</h2>84 <p th:text="${rating.getStarsRated() + ' од 10'}" style="text-align: center"></p>72 <h2 style="text-align: center">Rated:</h2> 73 <p th:text="${rating.getStarsRated() + ' out of 10 stars'}" style="text-align: center"></p> 85 74 </div> 86 75 </div> … … 88 77 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 89 78 <h2> 90 <span>Лајковите кои филмот ги добил:</span> 79 <span>Бројот на лајкови кои филмот ги добил:</span> 80 <span th:text="${movie.getLikes().size()}"></span> 91 81 </h2> 92 82 <hr> -
src/main/resources/templates/moviesList.html
r0226942 rad4243e 2 2 3 3 <div style="width: 70%; margin: auto"> 4 <div th:replace="fragments/searchBarName"></div> <br>4 <div th:replace="fragments/searchBarName"></div> 5 5 <div th:replace="fragments/searchBarGenre"></div> 6 6 </div> -
src/main/resources/templates/moviesListPaged.html
r0226942 rad4243e 1 1 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"> 2 <div style="margin:auto; width: 60%"> 3 <div style="width: 30%; margin: auto; height: 100%; margin-bottom: 10px"> 4 <a class="btn btn-outline-dark" style="height: 100%; width: 100%; font-size: 125%" id="button_toggle_filters">Прикажи филтрирање</a> 5 </div> 6 <div style="width: 100%; margin: auto; transition: 200ms" id="filters_div" class="invisible-search"> 7 <div th:replace="fragments/searchBarName"></div><br> 8 <div th:replace="fragments/searchBarGenre"></div> 9 </div> 2 3 <div style="width: 70%; margin: auto"> 4 <div th:replace="fragments/searchBarName"></div> 5 <div th:replace="fragments/searchBarGenre"></div> 6 10 7 </div> 8 11 9 <div id="paging-section"> 12 10 <div id="inner-paging" class="input-group"> … … 27 25 </div> 28 26 </div> 29 </div><br> 27 </div><br><br><br> 30 28 31 29 <div class="container mb-4"> … … 36 34 <div class="row" th:each="row: ${movie_rows}" > 37 35 <div class="col-md-3 elements" th:each="movie: ${row}" > 38 <span th:each="genre: ${movie.getGenres()}" th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span>39 36 <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'"> 40 37 <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" > 41 38 <h3 class="card-title title" th:text="${movie.getTitle()}"></h3> 42 39 <span th:each="genre: ${movie.getGenres()}" th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span> 40 43 41 </a> 44 <span class="card-text bottom"> 45 <h3 th:text="${'Оценет '+movie.getImdbRating() + '/10'}"></h3> 46 </span> 42 <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3> 47 43 <th:block sec:authorize="isAuthenticated()"> 48 44 <a class="bottom-heart btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">❤</a> -
src/main/resources/templates/personShow.html
r0226942 rad4243e 1 1 2 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 70%; margin: auto"> 3 <div style="clear: both; margin-bottom: 10px; display: inline-block"> 2 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 80%; margin: auto"> 3 <div> 4 4 5 <div style="width: 60%; margin-left: 10px; padding:20px; float:left"> 5 6 <h1 th:text="${person.getName() + ' ' + person.getSurname()}" style="text-align: center; padding:10px; background-color: rgba(64,64,64,0.5); color:white; border-radius: 10px 0px"></h1> 6 7 <hr> 7 <h3 th:text="${' Роден на: ' + person.getDateFormatted()}"></h3>8 <h3 th:text="${'Born on: ' + person.getDateOfBirth()}"></h3> 8 9 <div style="background-color: rgba(200,200,200,0.5); border-radius: 10px; padding:15px; "> 9 <h3> Краток Опис:</h3>10 <h3>Description:</h3> 10 11 <p th:text="${person.getDescription()}" style="text-align: justify"></p> 11 12 </div> 12 13 13 <div th:if="${person.getType().toString().contains('D')}" class="person-movies-list"> 14 <h3 >Режисирани филмови:</h3> 15 <hr> 14 <div th:if="${person.getType() == 'D'}"> 15 <h3 >Directed movies:</h3> 16 16 <ul> 17 <li th:each="movie: ${ person.getMovies()}"><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" ></a></li>17 <li th:each="movie: ${actor.getMovies()}"><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" ></a></li> 18 18 </ul> 19 19 </div> 20 <div th:if="${person.getType().toString().contains('A')}" class="person-movies-list"> 21 <h3 >Се појавува во филмовите:</h3> 22 <hr> 20 <div th:if="${person.getType() == 'A'}"> 21 <h3 >Acted in movies:</h3> 23 22 <ul> 24 <li th:each="movie: ${ person.getMovieActors()}" ><a th:text="${movie.getMovie().getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovie().getMovieId()})}" ></a></li>23 <li th:each="movie: ${actor.getMovieActors()}" ><a th:text="${movie.getMovie().getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovie().getMovieId()})}" ></a></li> 25 24 </ul> 26 25 </div> 26 27 27 </div> 28 <div style="width: 30%; margin-left: 10px; padding:20px; border-left: 3px solid black; border-radius: 10px; float: right">28 <div style="width: 30%; margin-left: 10px; padding:20px; border-left: 3px solid black; border-radius: 10px; float:left"> 29 29 <img th:src="${person.getImageUrl()}" style="width: 90%; height: auto"> 30 30 </div> 31 31 </div> 32 <br> 33 <div style="clear:both; display: inline-block; width: 100%; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 32 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 34 33 <h2> 35 <span>Бројот на оцени кои личноста ги има добиено:</span>36 <span th:text="${ person.getPersonRates().size()}"></span>34 <span>Бројот на оцени кои филмот ги добил:</span> 35 <span th:text="${movie.getRates().size()}"></span> 37 36 </h2> 38 37 <hr> 39 <div th:each="rating: ${ person.getPersonRates()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 130px;">38 <div th:each="rating: ${movie.getRates()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 130px;"> 40 39 <div style="width: 60%; float:left;"> 41 40 <p th:text="${rating.getReason()}" style="text-align: justify"></p> 42 41 </div> 43 42 <div style="width: 30%; float:right; background-color: darkorange; border-radius: 10px 30px; color: whitesmoke; padding: 10px;"> 44 <h2 style="text-align: center"> Оценет со:</h2>45 <p th:text="${rating.getStarsRated() + ' од 10'}" style="text-align: center"></p>43 <h2 style="text-align: center">Rated:</h2> 44 <p th:text="${rating.getStarsRated() + ' out of 10 stars'}" style="text-align: center"></p> 46 45 </div> 47 46 </div> 48 47 </div> 49 48 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 49 <h2> 50 <span>Бројот на лајкови кои филмот ги добил:</span> 51 <span th:text="${movie.getLikes().size()}"></span> 52 </h2> 53 <hr> 54 <div th:each="liked: ${movie.getLikes()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 60px;"> 55 <div style="width: 100%; float:left;"> 56 <h3 style="text-align: center"> 57 <span th:text="${liked.getUser().getName() + ' ' + liked.getUser().getSurname()}"></span> 58 <span style="color: green; font-size: 100%" >✔</span> 59 </h3> 60 </div> 61 </div> 62 </div> 50 63 </div> -
src/main/resources/templates/personsList.html
r0226942 rad4243e 5 5 </div> 6 6 <div class="container mb-4"> 7 <div class="row"> 7 8 <div class="col-12" th:if="${persons.size() > 0}"> 8 9 <div class="table-responsive"> … … 46 47 <th:block sec:authorize="isAuthenticated()"> 47 48 <td> 48 <a class="btn btn- secondary button-add-grade-person" th:person-id="${person.getPersonId()}">Остави оценка</a>49 <a class="btn btn-primary button-add-grade-person" th:person-id="${person.getPersonId()}">Остави оценка</a> 49 50 50 51 </td> 51 52 <td> 52 <a class="btn btn- warning" th:href="@{'persons/edit/{personId}' (personId = ${person.getPersonId()})}">Промени</a>53 <a class="btn btn-primary" th:href="@{'persons/edit/{personId}' (personId = ${person.getPersonId()})}">Промени</a> 53 54 </td> 54 55 <td> 55 <a class="btn btn- dangerbutton-delete-actor" th:person-id="${person.getPersonId()}">Избриши</a>56 <a class="btn btn-primary button-delete-actor" th:person-id="${person.getPersonId()}">Избриши</a> 56 57 57 58 </td> 59 60 <a class="bottom-heart btn btn-success button-add-favourite-list" 61 th:movie-id="${person.getMovieId()}" 62 th:user-id="${user.getUserId()}" 63 th:if="${!likedPersons.contains(movie)}">❤</a> 64 65 <a class="bottom-heart btn btn-danger button-remove-favourite-list" 66 th:movie-id="${person.getMovieId()}" th:user-id="${user.getUserId()}" 67 th:if="${likedPersons.contains(movie)}">💔</a> 58 68 59 69 … … 65 75 </div> 66 76 </div> 77 </div> 67 78 </div> 68 79 -
src/main/resources/templates/template.html
r0226942 rad4243e 16 16 </head> 17 17 <body> 18 <section class="jumbotron text-center" style="background: url('/img/cover.jpg') center; background-repeat: no-repeat; background-size: 100% auto; height: 280px; margin-bottom: 0px "> 19 <div class="container" > 20 <h1 class="jumbotron-heading" style="z-index: -1"></h1> 18 <section class="jumbotron text-center"> 19 <div class="container"> 20 <!--<img th:src="@{/img/logo.png}" style="opacity: 0.3; z-index: 5; position: absolute; margin: auto; height: 225px; width: auto; left: 42%; top: 2%">--> 21 <h1 class="jumbotron-heading" style="z-index: -1">weDiscussMovies</h1> 21 22 </div> 22 23 </section> -
target/classes/static/css/shared.css
r0226942 rad4243e 52 52 .bottom{ 53 53 position: absolute; 54 top: 75%;54 top: 80%; 55 55 margin:auto; 56 56 width: 100%; … … 60 60 background-color: rgba(0,0,0,0.25); 61 61 } 62 .bottom h3, .bottom span{63 margin-bottom: 0px;64 margin-top: 0px;65 }66 .bottom span{67 font-size: 75%;68 margin-top: 5px;69 }70 62 71 63 72 . elements .card .btn{64 .bottom-heart{ 73 65 top: 60%; 74 66 left: auto; … … 113 105 opacity: 0; 114 106 } 115 116 .person-movies-list{117 margin: auto;118 margin-top: 20px;119 padding: 10px;120 width: 80%;121 background-color: rgba(52, 58, 64, 0.7);122 border-radius: 10px;123 transition: 200ms;124 color: white;125 }126 127 .person-movies-list:hover{128 background-color: rgba(52, 58, 64, 1);129 }130 131 .person-movies-list ul{132 list-style-type: none;133 }134 135 .person-movies-list ul li{136 color:black;137 background-color: rgba(255,255,255,0.7);138 padding: 12px;139 font-size: 120%;140 width: 80%;141 text-align: center;142 margin: auto;143 transition: 200ms;144 border-radius: 10px;145 margin-bottom: 5px;146 text-decoration: underline;147 }148 149 .person-movies-list hr{150 color: white;151 background-color: white;152 border-color: white;153 }154 155 .person-movies-list ul li:hover{156 background-color: rgba(255,255,255,1);157 text-decoration-color: blue;158 }159 160 .genres-listing ul li:hover{161 background-color: rgba(222,128,128,1);162 }163 164 .genres-listing ul li{165 background-color: rgba(192,128,128,0.7);166 text-decoration: none !important;167 }168 169 .person-movies-list ul li a{170 color: black;171 transition: 250ms;172 text-decoration: underline;173 text-decoration-color: black;174 }175 176 .person-movies-list ul li a:hover{177 color:blue;178 }179 180 181 #admin-buttons a{182 display: inline-block;183 width: 95%;184 margin: auto;185 margin-top: 10px;186 font-size: 125%;187 clear: both;188 }189 190 #image-movie-section{191 height: fit-content;192 min-height: fit-content;193 }194 195 #likes-showcase{196 background-color: rgba(192,128,128,0.7);197 border-radius: 10px;198 padding:10px;199 width: 60%;200 margin: auto;201 transition: 200ms;202 margin-top: 2%;203 }204 205 #likes-showcase strong{206 font-size: 150%;207 }208 209 #likes-showcase:hover{210 background-color: rgba(222,128,128,1);211 }212 213 .invisible-search{214 display: none;215 } -
target/classes/static/js/sharedScript.js
r0226942 rad4243e 4 4 var elements = $(".elements") 5 5 var elementGrade; 6 var first_time = true; 6 7 7 8 8 $("#button-add").on("click", function (){ … … 56 56 $(".button-add-grade-movie").on("click",function (){ 57 57 elementGrade = $(this) 58 urlRating =" /api/movies/grade/"+$(this).attr("movie-id")58 urlRating ="api/movies/grade/"+$(this).attr("movie-id") 59 59 $("#dialog-rating").dialog("open") 60 60 }) 61 61 $(".button-add-grade-person").on("click",function (){ 62 62 elementGrade = $(this) 63 urlRating =" /api/persons/grade/"+$(this).attr("person-id")63 urlRating ="api/persons/grade/"+$(this).attr("person-id") 64 64 $("#dialog-rating").dialog("open") 65 65 }) … … 81 81 })*/ 82 82 83 $("#button_toggle_filters").on("click", function (){84 if(first_time){85 $("#filters_div").removeClass("invisible-search")86 first_time=false87 }88 else89 $("#filters_div").fadeToggle();90 })91 83 92 84 $(".search-button").on("click",function () { 93 elements = $(".elements") 94 let filter = $("#searchGenre").val() 95 console.log('\''+filter+'\'') 96 console.log(elements) 97 if(filter.length==0){ 98 console.log("HERE") 99 for (let item of elements) { 100 $(item).removeClass("visibility") 101 } 102 } 85 let filter = $("#searchGenre").val() 103 86 for (let item of elements) { 104 $(item).removeClass("visibility") 105 let genre = $(item).children(".card-genre") 87 let genre = $(item).find(".card-genre") 106 88 let visible = false; 107 console.log(genre.length) 89 108 90 for (let g of genre) { 109 if (( $(g).text().toLowerCase() === filter.toLowerCase())){ 110 console.log(item.text + ' ' + $(g).text())91 92 if (( $(g).text().toLowerCase() === filter.toLowerCase() && !$(g).hasClass("visibility") && filter.trim().length != 0)) { 111 93 visible = true 112 94 $(item).removeClass("visibility") … … 114 96 } 115 97 } 116 if (!visible){98 if (!visible && filter.trim().length != 0) 117 99 $(item).addClass("visibility") 118 } 100 else 101 $(item).removeClass("visibility") 119 102 120 103 } … … 123 106 $(".button-delete-movie").on("click",function (){ 124 107 let button = $(this) 125 let url = " /api/movies/delete/" + $(button).attr("movie-id")108 let url = "api/movies/delete/" + $(button).attr("movie-id") 126 109 ajaxCallDelete(url,button) 127 110 }) 128 111 $(".button-delete-actor").on("click",function (){ 129 112 let button = $(this) 130 let url = " /api/persons/delete/" + $(button).attr("person-id")113 let url = "api/persons/delete/" + $(button).attr("person-id") 131 114 ajaxCallDelete(url,button) 132 115 }) 133 116 $(".button-delete-discussion").on("click",function (){ 134 117 let button = $(this) 135 let url = " /api/discussions/delete/" + $(button).attr("discussion-id")118 let url = "api/discussions/delete/" + $(button).attr("discussion-id") 136 119 ajaxCallDelete(url,button) 137 120 }) … … 156 139 $(document.body).on("click",".button-add-favourite-list",function (){ 157 140 let button = $(this) 158 let url = " /api/movies/like/"+ $(this).attr("movie-id") + "?userId="+ $(this).attr("user-id")141 let url = "api/movies/like/"+ $(this).attr("movie-id") + "?userId="+ $(this).attr("user-id") 159 142 ajaxCallLike(url,button,'like','Веќе е филмот допаднат!') 160 143 }) 161 144 $(document.body).on("click",".button-remove-favourite-list",function (){ 162 145 let button = $(this) 163 let url = " /api/movies/unlike/"+ $(this).attr("movie-id")+"?userId="+ $(this).attr("user-id")146 let url = "api/movies/unlike/"+ $(this).attr("movie-id")+"?userId="+ $(this).attr("user-id") 164 147 ajaxCallLike(url,button,'unlike','Немате оставено допаѓање на филмот!') 165 148 }) 166 149 $(document.body).on("click",".button-add-genre-liked-list",function (){ 167 150 let button = $(this) 168 let url = " /api/genres/like/"+ $(this).attr("genre-id") + "?userId="+ $(this).attr("user-id")151 let url = "api/genres/like/"+ $(this).attr("genre-id") + "?userId="+ $(this).attr("user-id") 169 152 ajaxCallLikeGenre(url,button,'like','Веќе ви се допаѓа жанрот!') 170 153 }) 171 154 $(document.body).on("click",".button-remove-genre-liked-list",function (){ 172 155 let button = $(this) 173 let url = " /api/genres/unlike/"+ $(this).attr("genre-id")+"?userId="+ $(this).attr("user-id")156 let url = "api/genres/unlike/"+ $(this).attr("genre-id")+"?userId="+ $(this).attr("user-id") 174 157 ajaxCallLikeGenre(url,button,'unlike','Немате оставено допаѓање на жанрот!') 175 })176 $(document.body).on("click",".button-like-discussion",function (){177 let button = $(this)178 let url = "/api/discussions/like/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")179 ajaxCallLikeDiscussion(url,button,'like','Веќе имате оставено допаѓање на дискусијата!')180 })181 $(document.body).on("click",".button-unlike-discussion",function (){182 let button = $(this)183 let url = "/api/discussions/unlike/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")184 ajaxCallLikeDiscussion(url,button,'unlike','Немате оставено допаѓање на дискусијата!')185 })186 $(document.body).on("click",".button-like-discussion-alt",function (){187 let button = $(this)188 let url = "/api/discussions/like/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")189 ajaxCallLikeDiscussionAlternative(url,button,'like','Веќе имате оставено допаѓање на дискусијата!')190 })191 $(document.body).on("click",".button-unlike-discussion-alt",function (){192 let button = $(this)193 let url = "/api/discussions/unlike/"+ $(this).attr("discussion-id")+"?userId="+ $(this).attr("user-id")194 ajaxCallLikeDiscussionAlternative(url,button,'unlike','Немате оставено допаѓање на дискусијата!')195 158 }) 196 159 $(".discussion-type").change(function (){ … … 226 189 let movieId=$(button).attr("movie-id") 227 190 if (type==='like') { 228 $(button).parent().append("<a class='b tn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>")191 $(button).parent().append("<a class='bottom-heart btn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>") 229 192 console.log("da") 230 193 } 231 194 else{ 232 $(button).parent().append("<a class='btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>") 233 } 234 likes_count = $("#movie_likes_count") 235 count = Number($(likes_count).text()) 236 if(type==="like") 237 count++ 238 else 239 count-- 240 likes_count.text(count) 195 $(button).parent().append("<a class='bottom-heart btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>") 196 197 } 241 198 $(button).remove() 242 199 } … … 306 263 307 264 308 309 310 function ajaxCallLikeDiscussion(url,button,type,message){311 $.ajax({312 url:url,313 success:function (data){314 if (data){315 let el = $(button).parent().siblings().eq(3)316 console.log(el)317 if (type=="like") {318 $(el).html(parseInt($(el).text()) + 1)319 console.log("da")320 }321 else322 $(el).html(parseInt($(el).text()) - 1)323 $(button).css("display","none")324 let userId = $(button).attr("user-id")325 let discussionId=$(button).attr("discussion-id")326 if (type==='like') {327 $(button).parent().append("<a class='btn btn-danger button-unlike-discussion' discussion-id=" + discussionId + " user-id=" + userId + ">💔</a>")328 console.log("da")329 }330 else{331 $(button).parent().append("<a class='btn btn-success button-like-discussion' discussion-id=" + discussionId + " user-id=" + userId + ">❤</a>")332 }333 var likes_count = $("#likes_count")334 var count = Number($(likes_count).text())335 if(type==='like')336 count += 1337 else338 count -= 1339 $(likes_count).text(count);340 $(button).remove()341 }342 else {343 $(button).parent().append("<div>" + message +" <button class='button-confirm'>Ок</button></div>")344 }345 }346 })347 }348 349 350 351 function ajaxCallLikeDiscussionAlternative(url,button,type,message){352 $.ajax({353 url:url,354 success:function (data){355 if (data){356 let el = $(button).parent().siblings().eq(3)357 console.log(el)358 if (type=="like") {359 $(el).html(parseInt($(el).text()) + 1)360 console.log("da")361 }362 else363 $(el).html(parseInt($(el).text()) - 1)364 $(button).css("display","none")365 let userId = $(button).attr("user-id")366 let discussionId=$(button).attr("discussion-id")367 if (type==='like') {368 $(button).parent().append("<a class='btn btn-danger button-unlike-discussion-alt' discussion-id=" + discussionId + " user-id=" + userId + ">💔</a>")369 console.log("da")370 }371 else{372 $(button).parent().append("<a class='btn btn-success button-like-discussion-alt' discussion-id=" + discussionId + " user-id=" + userId + ">❤</a>")373 }374 var likes_count = $(button).parent().siblings(".likes_count").first()375 var count = Number(likes_count.text())376 if(type==='like')377 count += 1378 else379 count -= 1380 $(likes_count).text(count);381 $(button).remove()382 }383 else {384 $(button).parent().append("<div>" + message +" <button class='button-confirm'>Ок</button></div>")385 }386 }387 })388 }389 390 391 265 function ajaxCallRating(url,button,type){ 392 266 model = { -
target/classes/templates/discussion.html
r0226942 rad4243e 1 1 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"> 2 2 <div style="width: 85%; text-align: justify; margin: auto; clear: both"> 3 <div style="background-color: rgba(128,128,128, 0.2); border-radius: 20px; padding: 20px">4 <h1 th:text="${disc.getTitle()}" style="width: 80%; display: inline; height: fit-content; clear: both"></h1>3 <div> 4 <h1 th:text="${disc.getTitle()}" style="width: 80%; float: left"></h1> 5 5 </div> 6 <hr> 6 <hr><br><br> 7 7 <div> 8 8 <h5 th:text="${disc.getText()}" style="width: 90%; margin: auto; background-color: lightblue; border-radius: 4px; padding: 20px"></h5> 9 9 </div> 10 <br> 11 <h4> 12 <span th:if="${!disc.getUser().equals(user)}" sec:authorize="isAuthenticated()"> 13 <a class='btn btn-success button-like-discussion' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a> 14 <a class='btn btn-danger button-unlike-discussion' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a> 15 </span> 16 <span>Број на допаѓања:</span> 17 <span th:text="${likes}" id="likes_count"></span> 18 </h4> 19 <br> 10 <br><br><br> 20 11 <h6 style="width: 60%; float:left;"> 21 12 <span th:text="${'Поставено од: '+disc.getUser().getUsername()}"></span> … … 26 17 </h6> 27 18 <div style="float: right" sec:authorize="isAuthenticated()"> 28 <a th:if="${disc.getUser().equals(user)}" class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> 29 <a th:if="${disc.getUser().equals(user)}" class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> 30 <a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> 31 32 </div><br> 19 <a th:if="${disc.getUser().equals(user)}" class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> 20 <a th:if="${disc.getUser().equals(user)}" class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> 21 <a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> 22 </div> 33 23 </div> 34 24 <table class="table table-striped" style="width: 70%; margin: auto;"> -
target/classes/templates/discussionsList.html
r0226942 rad4243e 4 4 </div> 5 5 <div class="container mb-4"> 6 <div class="row"> 6 7 <div class="col-12" th:if="${discussions.size() > 0}"> 7 8 <div class="table-responsive"> … … 9 10 <thead> 10 11 <tr> 11 <th scope="col">За</th>12 12 <th scope="col">Наслов</th> 13 <th scope="col"> Допаѓања</th>13 <th scope="col">Опис</th> 14 14 <th scope="col">Датум</th> 15 15 <th scope="col">Корисник</th> … … 27 27 <tbody> 28 28 <tr th:each="disc : ${discussions}" class="movie"> 29 <td th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' +disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>29 <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td> 30 30 <td> 31 31 <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a> 32 32 </td> 33 <td th:each="like : ${likes}" th:if="${like.getDiscussionId().equals(disc.getDiscussionId())}" th:text="${like.getLikes()}" class="likes_count"> 34 </td> 33 <td th:text="${disc.getText()}"></td> 35 34 <td th:text="${disc.getDate()}"></td> 36 35 <td th:text="${disc.getUser().getUsername()}"></td> … … 41 40 <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td> 42 41 <td th:if="${!disc.getUser().equals(user)}"> 43 <a class= 'btn btn-success button-like-discussion-alt' th:if="${!likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >❤</a>44 <a class= 'btn btn-danger button-unlike-discussion-alt' th:if="${likedDiscussions.contains(disc)}" th:discussion-id="${disc.getDiscussionId()}" th:user-id="${user.getUserId()}" >💔</a>42 <a class="btn btn-success">👍 </a> 43 <a class="btn btn-danger">👎</a> 45 44 </td> 46 45 </th:block> 46 47 47 48 48 </tr> … … 51 51 </div> 52 52 </div> 53 </div> 53 54 </div> 54 55 -
target/classes/templates/fragments/header.html
r0226942 rad4243e 2 2 <nav class="navbar navbar-expand-md navbar-dark bg-dark"> 3 3 <div class="container"> 4 <a class="navbar-brand" href="/movies">Форум за филмови</a> 4 5 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" 5 6 aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> … … 27 28 </li> 28 29 </ul> 29 <form class="form-inline my-2 my-lg-0 hidden">30 <form class="form-inline my-2 my-lg-0"> 30 31 <div class="input-group input-group-sm"> 31 32 <input type="text" class="form-control" aria-label="Small" -
target/classes/templates/fragments/searchBarGenre.html
r0226942 rad4243e 1 <div xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" style="width:60%; margin: auto; margin-bottom: 10px"> 2 <select th:if="${genres!=null}" id="searchGenre" class="form-control" style="float: left; display: block; width: 50%"> 3 <option value="" selected>Сите</option> 4 <option th:each="genre: ${genres}" th:value="${genre.getGenreType()}" th:text="${genre.getGenreType()}"></option> 5 </select> 6 <div class="input-group-append" style="width: 40%"> 7 <button class="btn btn-secondary search-button" style="width: 100%">Филтрирај по жанр</button> 8 </div> 1 <div> 2 <label for="searchGenre" style="width: 150px;">Пребарај по жанр</label> 3 <input id="searchGenre" type="text" placeholder="жанр"> 4 <button class="search-button">Пребарај</button> 9 5 </div> -
target/classes/templates/fragments/searchBarName.html
r0226942 rad4243e 1 <div style="width:60%; margin: auto;"> 2 <input id="searchTitle" class="form-control" style="float: left; display: block; width: 50%" type="text" placeholder="..."> 3 4 <div class="input-group-append" style="width: 40%"> 5 <button class="btn btn-secondary search-button-title" style="width: 100%">Филтрирај по Наслов</button> 6 </div> 7 1 <div> 2 <label for="searchTitle" style="width: 150px;">Прабарај по име</label> 3 <input id="searchTitle" type="text" placeholder="име"> 4 <button class="search-button-title">Пребарај</button> 8 5 </div> -
target/classes/templates/movieShow.html
r0226942 rad4243e 13 13 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 80%; margin: auto"> 14 14 <div> 15 <div style="width: 30%; margin-right: 10px; padding:20px; border-right: 3px solid black; border-radius: 10px; float:left" id="image-movie-section"> 16 <img th:src="${movie.getImageUrl()}" style="width: 90%; height: auto; clear: both; margin-bottom: 20px"> 17 <div id="admin-buttons"> 18 <a class="btn btn-primary" th:href="@{'/discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a> 19 <th:block sec:authorize="isAuthenticated()" > 20 <div> 21 <a class="btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">❤</a> 22 <a class="btn btn-danger button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">💔</a> 23 </div> 24 <a class="btn btn-secondary button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a> 25 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a> 26 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a> 27 </th:block> 28 </div> 15 <div style="width: 30%; margin-right: 10px; padding:20px; border-right: 3px solid black; border-radius: 10px; float:left"> 16 <img th:src="${movie.getImageUrl()}" style="width: 90%; height: auto"> 29 17 </div> 30 18 … … 38 26 </h3> 39 27 <h3 th:text="${'IMDB оцена: ' + movie.getImdbRating()}"></h3> 40 <h3 th:text="${'Прикажан на: ' + movie.get DateFormatted()}"></h3>28 <h3 th:text="${'Прикажан на: ' + movie.getAiringDate()}"></h3> 41 29 42 30 <div style="background-color: rgba(200,200,200,0.5); border-radius: 10px; padding:15px; "> … … 45 33 </div> 46 34 47 <div id="likes-showcase"> 48 <h4 style="text-align: center"> 49 <span>Филмот му се допаднал на </span> 50 <strong th:text="${likes}" id="movie_likes_count"></strong> 51 <span> корисници</span> 52 </h4> 53 </div> 54 55 <div class="person-movies-list genres-listing"> 35 <div> 56 36 <h3>Жанрови:</h3> 57 37 <ul> … … 59 39 </ul> 60 40 </div> 61 <div class="person-movies-list">41 <div> 62 42 <h3>Актери:</h3> 63 43 <ul> … … 68 48 </div> 69 49 </div> 70 50 <div id="admin-buttons"> 51 <a class="btn btn-primary" th:href="@{'/discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a> 52 <th:block sec:authorize="isAuthenticated()" > 53 <a class="btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">Додади во омилена листа</a> 54 <a class="btn btn-warning button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">Избриши од омилена листа</a> 55 <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a> 56 <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a> 57 <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a> 58 </th:block> 59 </div> 71 60 <hr> 72 61 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> … … 81 70 </div> 82 71 <div style="width: 30%; float:right; background-color: darkorange; border-radius: 10px 30px; color: whitesmoke; padding: 10px;"> 83 <h2 style="text-align: center"> Оценет:</h2>84 <p th:text="${rating.getStarsRated() + ' од 10'}" style="text-align: center"></p>72 <h2 style="text-align: center">Rated:</h2> 73 <p th:text="${rating.getStarsRated() + ' out of 10 stars'}" style="text-align: center"></p> 85 74 </div> 86 75 </div> … … 88 77 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 89 78 <h2> 90 <span>Лајковите кои филмот ги добил:</span> 79 <span>Бројот на лајкови кои филмот ги добил:</span> 80 <span th:text="${movie.getLikes().size()}"></span> 91 81 </h2> 92 82 <hr> -
target/classes/templates/moviesList.html
r0226942 rad4243e 2 2 3 3 <div style="width: 70%; margin: auto"> 4 <div th:replace="fragments/searchBarName"></div> <br>4 <div th:replace="fragments/searchBarName"></div> 5 5 <div th:replace="fragments/searchBarGenre"></div> 6 6 </div> -
target/classes/templates/moviesListPaged.html
r0226942 rad4243e 1 1 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"> 2 <div style="margin:auto; width: 60%"> 3 <div style="width: 30%; margin: auto; height: 100%; margin-bottom: 10px"> 4 <a class="btn btn-outline-dark" style="height: 100%; width: 100%; font-size: 125%" id="button_toggle_filters">Прикажи филтрирање</a> 5 </div> 6 <div style="width: 100%; margin: auto; transition: 200ms" id="filters_div" class="invisible-search"> 7 <div th:replace="fragments/searchBarName"></div><br> 8 <div th:replace="fragments/searchBarGenre"></div> 9 </div> 2 3 <div style="width: 70%; margin: auto"> 4 <div th:replace="fragments/searchBarName"></div> 5 <div th:replace="fragments/searchBarGenre"></div> 6 10 7 </div> 8 11 9 <div id="paging-section"> 12 10 <div id="inner-paging" class="input-group"> … … 27 25 </div> 28 26 </div> 29 </div><br> 27 </div><br><br><br> 30 28 31 29 <div class="container mb-4"> … … 36 34 <div class="row" th:each="row: ${movie_rows}" > 37 35 <div class="col-md-3 elements" th:each="movie: ${row}" > 38 <span th:each="genre: ${movie.getGenres()}" th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span>39 36 <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'"> 40 37 <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" > 41 38 <h3 class="card-title title" th:text="${movie.getTitle()}"></h3> 42 39 <span th:each="genre: ${movie.getGenres()}" th:text="${genre?.getGenre()?.getGenreType()}" hidden class="card-genre"></span> 40 43 41 </a> 44 <span class="card-text bottom"> 45 <h3 th:text="${'Оценет '+movie.getImdbRating() + '/10'}"></h3> 46 </span> 42 <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3> 47 43 <th:block sec:authorize="isAuthenticated()"> 48 44 <a class="bottom-heart btn btn-success button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">❤</a> -
target/classes/templates/personShow.html
r0226942 rad4243e 1 1 2 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 70%; margin: auto"> 3 <div style="clear: both; margin-bottom: 10px; display: inline-block"> 2 <div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" style="width: 80%; margin: auto"> 3 <div> 4 4 5 <div style="width: 60%; margin-left: 10px; padding:20px; float:left"> 5 6 <h1 th:text="${person.getName() + ' ' + person.getSurname()}" style="text-align: center; padding:10px; background-color: rgba(64,64,64,0.5); color:white; border-radius: 10px 0px"></h1> 6 7 <hr> 7 <h3 th:text="${' Роден на: ' + person.getDateFormatted()}"></h3>8 <h3 th:text="${'Born on: ' + person.getDateOfBirth()}"></h3> 8 9 <div style="background-color: rgba(200,200,200,0.5); border-radius: 10px; padding:15px; "> 9 <h3> Краток Опис:</h3>10 <h3>Description:</h3> 10 11 <p th:text="${person.getDescription()}" style="text-align: justify"></p> 11 12 </div> 12 13 13 <div th:if="${person.getType().toString().contains('D')}" class="person-movies-list"> 14 <h3 >Режисирани филмови:</h3> 15 <hr> 14 <div th:if="${person.getType() == 'D'}"> 15 <h3 >Directed movies:</h3> 16 16 <ul> 17 <li th:each="movie: ${ person.getMovies()}"><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" ></a></li>17 <li th:each="movie: ${actor.getMovies()}"><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" ></a></li> 18 18 </ul> 19 19 </div> 20 <div th:if="${person.getType().toString().contains('A')}" class="person-movies-list"> 21 <h3 >Се појавува во филмовите:</h3> 22 <hr> 20 <div th:if="${person.getType() == 'A'}"> 21 <h3 >Acted in movies:</h3> 23 22 <ul> 24 <li th:each="movie: ${ person.getMovieActors()}" ><a th:text="${movie.getMovie().getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovie().getMovieId()})}" ></a></li>23 <li th:each="movie: ${actor.getMovieActors()}" ><a th:text="${movie.getMovie().getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovie().getMovieId()})}" ></a></li> 25 24 </ul> 26 25 </div> 26 27 27 </div> 28 <div style="width: 30%; margin-left: 10px; padding:20px; border-left: 3px solid black; border-radius: 10px; float: right">28 <div style="width: 30%; margin-left: 10px; padding:20px; border-left: 3px solid black; border-radius: 10px; float:left"> 29 29 <img th:src="${person.getImageUrl()}" style="width: 90%; height: auto"> 30 30 </div> 31 31 </div> 32 <br> 33 <div style="clear:both; display: inline-block; width: 100%; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 32 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 34 33 <h2> 35 <span>Бројот на оцени кои личноста ги има добиено:</span>36 <span th:text="${ person.getPersonRates().size()}"></span>34 <span>Бројот на оцени кои филмот ги добил:</span> 35 <span th:text="${movie.getRates().size()}"></span> 37 36 </h2> 38 37 <hr> 39 <div th:each="rating: ${ person.getPersonRates()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 130px;">38 <div th:each="rating: ${movie.getRates()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 130px;"> 40 39 <div style="width: 60%; float:left;"> 41 40 <p th:text="${rating.getReason()}" style="text-align: justify"></p> 42 41 </div> 43 42 <div style="width: 30%; float:right; background-color: darkorange; border-radius: 10px 30px; color: whitesmoke; padding: 10px;"> 44 <h2 style="text-align: center"> Оценет со:</h2>45 <p th:text="${rating.getStarsRated() + ' од 10'}" style="text-align: center"></p>43 <h2 style="text-align: center">Rated:</h2> 44 <p th:text="${rating.getStarsRated() + ' out of 10 stars'}" style="text-align: center"></p> 46 45 </div> 47 46 </div> 48 47 </div> 49 48 <div style="width: 45%; margin: 25px; float:left; background-color: rgb(200,200,200); padding: 10px; border-radius: 5px"> 49 <h2> 50 <span>Бројот на лајкови кои филмот ги добил:</span> 51 <span th:text="${movie.getLikes().size()}"></span> 52 </h2> 53 <hr> 54 <div th:each="liked: ${movie.getLikes()}" style="margin-bottom: 10px; border: 2px solid gray; border-radius: 10px; background-color: lightblue; padding: 10px; border-radius: 10px; min-height: 60px;"> 55 <div style="width: 100%; float:left;"> 56 <h3 style="text-align: center"> 57 <span th:text="${liked.getUser().getName() + ' ' + liked.getUser().getSurname()}"></span> 58 <span style="color: green; font-size: 100%" >✔</span> 59 </h3> 60 </div> 61 </div> 62 </div> 50 63 </div> -
target/classes/templates/personsList.html
r0226942 rad4243e 5 5 </div> 6 6 <div class="container mb-4"> 7 <div class="row"> 7 8 <div class="col-12" th:if="${persons.size() > 0}"> 8 9 <div class="table-responsive"> … … 46 47 <th:block sec:authorize="isAuthenticated()"> 47 48 <td> 48 <a class="btn btn- secondary button-add-grade-person" th:person-id="${person.getPersonId()}">Остави оценка</a>49 <a class="btn btn-primary button-add-grade-person" th:person-id="${person.getPersonId()}">Остави оценка</a> 49 50 50 51 </td> 51 52 <td> 52 <a class="btn btn- warning" th:href="@{'persons/edit/{personId}' (personId = ${person.getPersonId()})}">Промени</a>53 <a class="btn btn-primary" th:href="@{'persons/edit/{personId}' (personId = ${person.getPersonId()})}">Промени</a> 53 54 </td> 54 55 <td> 55 <a class="btn btn- dangerbutton-delete-actor" th:person-id="${person.getPersonId()}">Избриши</a>56 <a class="btn btn-primary button-delete-actor" th:person-id="${person.getPersonId()}">Избриши</a> 56 57 57 58 </td> 59 60 <a class="bottom-heart btn btn-success button-add-favourite-list" 61 th:movie-id="${person.getMovieId()}" 62 th:user-id="${user.getUserId()}" 63 th:if="${!likedPersons.contains(movie)}">❤</a> 64 65 <a class="bottom-heart btn btn-danger button-remove-favourite-list" 66 th:movie-id="${person.getMovieId()}" th:user-id="${user.getUserId()}" 67 th:if="${likedPersons.contains(movie)}">💔</a> 58 68 59 69 … … 65 75 </div> 66 76 </div> 77 </div> 67 78 </div> 68 79 -
target/classes/templates/template.html
r0226942 rad4243e 16 16 </head> 17 17 <body> 18 <section class="jumbotron text-center" style="background: url('/img/cover.jpg') center; background-repeat: no-repeat; background-size: 100% auto; height: 280px; margin-bottom: 0px "> 19 <div class="container" > 20 <h1 class="jumbotron-heading" style="z-index: -1"></h1> 18 <section class="jumbotron text-center"> 19 <div class="container"> 20 <!--<img th:src="@{/img/logo.png}" style="opacity: 0.3; z-index: 5; position: absolute; margin: auto; height: 225px; width: auto; left: 42%; top: 2%">--> 21 <h1 class="jumbotron-heading" style="z-index: -1">weDiscussMovies</h1> 21 22 </div> 22 23 </section>
Note:
See TracChangeset
for help on using the changeset viewer.