Changeset 42d565b in Git


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

Merge pull request #1 from partaloski/master

Fixed and added a better front end, improved clarity

Files:
7 added
107 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/configuration/SecurityConfig.java

    r5b447b0 r42d565b  
    55import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
    66import org.springframework.security.config.annotation.web.builders.HttpSecurity;
     7import org.springframework.security.config.annotation.web.builders.WebSecurity;
    78import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
    89
     
    1516    }
    1617
     18    @Override
     19    public void configure(WebSecurity web) throws Exception {
     20        web.ignoring().antMatchers("/*.jpg");
     21        web.ignoring().antMatchers("/*.png");
     22        web.ignoring().antMatchers("/*.css");
     23        web.ignoring().antMatchers("/*.js");
     24    }
    1725
    1826    @Override
     
    2129        http.csrf().disable()
    2230                .authorizeRequests()
    23                 .antMatchers("/movies","/actors","/directors","/discussions","/replies","/register","/genres").permitAll()
     31                .antMatchers("/movies","/movies/**/","/actors","/persons/**/","/directors","/discussions","/discussions/**/","/discussions/all/**/","/replies","/register","/genres", "/css/**", "/js/**").permitAll()
    2432                .anyRequest()
    2533                .authenticated()
  • src/main/java/com/wediscussmovies/project/model/Movie.java

    r5b447b0 r42d565b  
    66import com.wediscussmovies.project.model.relation.MovieRates;
    77import lombok.Data;
     8import org.hibernate.annotations.Fetch;
    89
    910import javax.persistence.*;
     
    3738    private Double imdbRating;
    3839
    39     @OneToMany(mappedBy = "movie")
     40    @OneToMany(mappedBy = "movie", fetch = FetchType.LAZY)
    4041    private Collection<MovieActors> actors;
    4142    @OneToMany(mappedBy = "movie")
  • src/main/java/com/wediscussmovies/project/web/controller/MovieController.java

    r5b447b0 r42d565b  
    11package com.wediscussmovies.project.web.controller;
    22
     3import com.wediscussmovies.project.LoggedUser;
    34import com.wediscussmovies.project.model.Movie;
    45import com.wediscussmovies.project.model.Person;
     
    1920import java.sql.Date;
    2021import java.time.LocalDate;
     22import java.util.ArrayList;
    2123import java.util.List;
    2224
     
    5355          model.addAttribute("user",user);
    5456        }
    55 
     57        List<Movie> movieList = movies;
     58        List<List<Movie>> movie_rows = new ArrayList<>();
     59        for(int i=0; i<movieList.size(); i+=4){
     60            int j = i+4;
     61            if(j>movieList.size())
     62                j=movieList.size();
     63            movie_rows.add(movieList.subList(i, j));
     64        }
    5665        model.addAttribute("movies", movies);
     66        model.addAttribute("movie_rows", movie_rows);
    5767        model.addAttribute("contentTemplate", "moviesList");
    5868        if (error != null && !error.equals(" "))
     
    6171    }
    6272
     73    @GetMapping("/{id}")
     74    public String getMovie(@PathVariable Integer id, Model model){
     75        model.addAttribute("movie", movieService.findById(id));
     76
     77        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
     78        if (!(auth instanceof AnonymousAuthenticationToken)){
     79            UserDetails userDetails = (UserDetails) auth.getPrincipal();
     80            User user = (User) userDetails;
     81            model.addAttribute("likedMovies",this.movieService.findLikedMoviesByUser(user));
     82            model.addAttribute("user",user);
     83        }
     84
     85        model.addAttribute("contentTemplate", "movieShow");
     86        return "template";
     87    }
    6388
    6489    @GetMapping("/add")
  • src/main/java/com/wediscussmovies/project/web/controller/PersonController.java

    r5b447b0 r42d565b  
    4545        model.addAttribute("persons", persons);
    4646        model.addAttribute("contentTemplate", "personsList");
     47        return "template";
     48    }
     49
     50    @GetMapping("/persons/{id}")
     51    public String getPerson(@PathVariable Integer id, Model model){
     52        Person person = personService.findById(id);
     53        //Error handling, could be null!!!!!!!!!
     54        model.addAttribute("person", person);
     55
     56        model.addAttribute("contentTemplate", "personShow");
    4757        return "template";
    4858    }
  • src/main/java/com/wediscussmovies/project/web/controller/UsersController.java

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

    r5b447b0 r42d565b  
    22    max-width: 5vw;
    33}
     4
     5.row{
     6    height: 300px;
     7    margin-bottom: 15px;
     8}
     9
     10.row div{
     11    height: 100%;
     12}
     13
     14.row div div{
     15    height: 100%;
     16}
     17
     18.card{
     19    background-size: 100vh auto;
     20    float:left;
     21    margin: 7px;
     22    border-radius: 10px;
     23    padding: 20px;
     24    color: white;
     25    -webkit-text-stroke-width: 1px !important;
     26    -webkit-text-stroke-color: black !important;
     27    width: 90%;
     28    height: 90%;
     29    box-shadow: 4px 4px 4px rgba(128,128,128,1);
     30}
     31
     32.card a h3{
     33    -webkit-text-stroke-width: 1px;
     34    -webkit-text-stroke-color: black;
     35    color:white;
     36    transition: 100ms;
     37}
     38
     39.card:hover a h3{
     40    transition: 400ms;
     41    color:black;
     42    -webkit-text-stroke-color: white;
     43}
     44
     45.title{
     46    text-align: center;
     47    background-color: rgba(0,0,0,0.25);
     48    border-radius: 10px 10px 0px 0px;
     49    padding: 10px;
     50}
     51
     52.bottom{
     53    position: absolute;
     54    top: 80%;
     55    margin:auto;
     56    width: 100%;
     57    left: 0%;
     58    border-radius: 0px;
     59    text-align: center;
     60    background-color: rgba(0,0,0,0.25);
     61}
     62
     63
     64.bottom-heart{
     65    top: 60%;
     66    left: auto;
     67    position: absolute;
     68    margin: auto;
     69    width: 20%;
     70    text-align: center;
     71}
  • src/main/resources/static/js/sharedScript.js

    r5b447b0 r42d565b  
    44    var elements = $(".elements")
    55    var elementGrade;
     6
    67
    78    $("#dialog-rating").dialog({
     
    145146                let movieId=$(button).attr("movie-id")
    146147                if (type==='like') {
    147                     $(button).parent().append("<a class='btn btn-primary button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">Избриши од омилена листа</a>")
     148                    $(button).parent().append("<a class='bottom-heart btn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>")
    148149                    console.log("da")
    149150                }
    150151                else{
    151                     $(button).parent().append("<a class='btn btn-primary button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">Додади во омилена листа</a>")
     152                    $(button).parent().append("<a class='bottom-heart btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>")
    152153
    153154                }
  • src/main/resources/templates/discussion.html

    r5b447b0 r42d565b  
    11<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
    2     <div th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></div>
    3     <div th:text="${disc.getTitle()}"></div>
    4     <div th:text="${disc.getText()}"></div>
    5     <div th:text="${disc.getDate()}"></div>
    6     <div th:text="${disc.getUser().getUsername()}"></div>
    7     <div th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </div>
    8     <div th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </div>
    9     <table class="table table-striped">
     2    <div style="width: 85%; text-align: justify; margin: auto; clear: both">
     3        <div>
     4            <h1 th:text="${disc.getTitle()}" style="width: 80%; float: left"></h1>
     5        </div>
     6        <hr><br><br>
     7        <div>
     8            <h5 th:text="${disc.getText()}" style="width: 90%; margin: auto; background-color: lightblue; border-radius: 4px; padding: 20px"></h5>
     9        </div>
     10        <br><br><br>
     11        <h6 style="width: 60%; float:left;">
     12            <span th:text="${'Поставено од: '+disc.getUser().getUsername()}"></span>
     13            <span th:text="${', на датум '+ disc.getDate()}"></span>
     14            <br>
     15            <span>Поставено за </span>
     16            <span th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' + disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}" ></span>
     17        </h6>
     18        <div style="float: right"  sec:authorize="isAuthenticated()">
     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>
     23    </div>
     24    <table class="table table-striped" style="width: 70%; margin: auto;">
    1025        <thead>
    1126        <tr>
    12 
    13             <th scope="col">Опис</th>
    14             <th scope="col">Датум</th>
    15             <th scope="col">Корисник</th>
     27            <th scope="col">Реплика</th>
     28            <th scope="col">Поставена на</th>
     29            <th scope="col">Поставена од</th>
    1630            <th:block  sec:authorize="isAuthenticated()">
    17 
    1831                <th scope="col"></th>
    1932                <th scope="col"></th>
    2033            </th:block>
    21 
    2234        </tr>
    2335        </thead>
     
    2739            <td th:text="${reply.getDate()}"></td>
    2840            <td th:text="${reply.getUser().getUsername()}"></td>
    29             <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/edit/{discussionId}/{replyId}' (discussionId=${disc.getDiscussionId()},replyId=${reply.getReplyId()})}">Промени</a> </td>
    30             <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-primary button-delete-reply" th:reply-id="${reply.getReplyId()}" th:dicsussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    31 
     41            <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/replies/edit/{discussionId}/{replyId}' (discussionId=${disc.getDiscussionId()},replyId=${reply.getReplyId()})}">Промени</a> </td>
     42            <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-danger button-delete-reply" th:reply-id="${reply.getReplyId()}" th:dicsussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3243            <th:block sec:authorize="isAuthenticated()">
    33                 <td th:if="${!reply.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    3444                <td th:if="${!reply.getUser().equals(user)}">
    35                     <a class="btn btn-primary">Ми се допаѓа</a>
    36                     <a class="btn btn-primary">Не ми се допаѓа</a>
     45                    <a class="btn btn-success">👍 </a>
     46                    <a class="btn btn-danger">👎</a>
    3747                </td>
    3848            </th:block>
    39 
    40 
    4149        </tr>
    4250        </tbody>
  • src/main/resources/templates/discussionForType.html

    r5b447b0 r42d565b  
    88                        <thead>
    99                        <tr>
    10                             <th scope="col">Наменета</th>
    1110                            <th scope="col">Наслов</th>
    1211                            <th scope="col">Опис</th>
     
    2625                        <tbody>
    2726                        <tr th:each="disc : ${discussions}" class="movie">
    28                             <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
    29                             <td th:text="${disc.getTitle()}"></td>
     27                            <td>
     28                                <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
     29                            </td>
    3030                            <td th:text="${disc.getText()}"></td>
    3131                            <td th:text="${disc.getDate()}"></td>
    3232                            <td th:text="${disc.getUser().getUsername()}"></td>
    33                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </td>
    34                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
     33                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Измени</a> </td>
     34                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3535
    3636                            <th:block sec:authorize="isAuthenticated()">
    37                                 <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
     37                                <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    3838                                <td th:if="${!disc.getUser().equals(user)}">
    39                                     <a class="btn btn-primary">Ми се допаѓа</a>
    40                                     <a class="btn btn-primary">Не ми се допаѓа</a>
     39                                    <a class="btn btn-success">👍 </a>
     40                                    <a class="btn btn-danger">👎</a>
    4141                                </td>
    4242                            </th:block>
  • src/main/resources/templates/discussionsList.html

    r5b447b0 r42d565b  
    1010                        <thead>
    1111                        <tr>
    12                             <th scope="col">Наменета</th>
    1312                            <th scope="col">Наслов</th>
    1413                            <th scope="col">Опис</th>
     
    2928                        <tr th:each="disc : ${discussions}" class="movie">
    3029                            <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
    31                             <td th:text="${disc.getTitle()}"></td>
     30                            <td>
     31                                <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
     32                            </td>
    3233                            <td th:text="${disc.getText()}"></td>
    3334                            <td th:text="${disc.getDate()}"></td>
    3435                            <td th:text="${disc.getUser().getUsername()}"></td>
    35                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </td>
    36                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
     36                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Измени</a> </td>
     37                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3738
    3839                            <th:block sec:authorize="isAuthenticated()">
    39                             <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
     40                            <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    4041                            <td th:if="${!disc.getUser().equals(user)}">
    41                                 <a class="btn btn-primary">Ми се допаѓа</a>
    42                                 <a class="btn btn-primary">Не ми се допаѓа</a>
     42                                <a class="btn btn-success">👍 </a>
     43                                <a class="btn btn-danger">👎</a>
    4344                            </td>
    4445                            </th:block>
  • src/main/resources/templates/favoriteList.html

    r5b447b0 r42d565b  
    1 <div class="container mb-4">
    2     <div class="row">
     1<div class="container mb-4" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
     2    <div class="row" th:each="row: ${movie_rows}" >
     3        <div class="col-md-3" th:each="movie: ${row}" >
     4            <a class="card-text-center" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
     5                    <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
     6                        <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
     7                        <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
     8                    </div>
     9            </a>
     10        </div>
     11    </div>
     12
     13    <!--<div class="row">
    314        <div class="col-12" th:if="${movies.size() > 0}">
    415            <div class="table-responsive">
     
    3950            </div>
    4051        </div>
    41     </div>
     52    </div>-->
    4253</div>
  • src/main/resources/templates/fragments/header.html

    r5b447b0 r42d565b  
    22    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
    33        <div class="container">
    4             <a class="navbar-brand" href="/">Форум за филмови</a>
     4            <a class="navbar-brand" href="/movies">Форум за филмови</a>
    55            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
    66                    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
     
    1616                    </li>
    1717                    <li class="nav-item m-auto">
    18                         <a class="nav-link active" href="/directors">Директори</a>
     18                        <a class="nav-link active" href="/directors">Режисери</a>
    1919                    </li>
    2020                    <li class="nav-item m-auto">
  • src/main/resources/templates/fragments/searchBarGenre.html

    r5b447b0 r42d565b  
    11<div>
    2       <label for="searchGenre">жанр</label>
     2      <label for="searchGenre" style="width: 150px;">Пребарај по жанр</label>
    33        <input id="searchGenre" type="text" placeholder="жанр">
    44        <button class="search-button">Пребарај</button>
  • src/main/resources/templates/fragments/searchBarName.html

    r5b447b0 r42d565b  
    11<div>
    2     <label for="searchTitle">Прабарај по име</label>
     2    <label for="searchTitle" style="width: 150px;">Прабарај по име</label>
    33    <input id="searchTitle" type="text" placeholder="име">
    44    <button class="search-button-title">Пребарај</button>
  • src/main/resources/templates/moviesList.html

    r5b447b0 r42d565b  
    11<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
    2     <div th:replace="fragments/searchBarGenre">
    32
     3    <div style="width: 70%; margin: auto">
     4        <div th:replace="fragments/searchBarName"></div>
     5        <div th:replace="fragments/searchBarGenre"></div>
    46    </div>
    57
     
    911
    1012    <div class="container mb-4">
     13        <div class="row" th:each="row: ${movie_rows}" >
     14            <div class="col-md-3" th:each="movie: ${row}" >
     15                    <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
     16                        <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
     17                        <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
     18                        </a>
     19                        <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
     20                        <th:block sec:authorize="isAuthenticated()">
     21                            <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>
     22                            <a class="bottom-heart btn btn-danger button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">💔</a>
     23                        </th:block>
     24                    </div>
     25            </div>
     26        </div>
     27    </div>
     28    <!--<div class="container mb-4">
    1129        <div class="row">
    1230            <div class="col-12" th:if="${movies.size() > 0}">
     
    1937                            <th scope="col">Датум издавање</th>
    2038                            <th scope="col">Допаѓања</th>
    21                             <th scope="col">Занрови</th>
     39                            <th scope="col">Жанрови</th>
    2240                            <th scope="col">Актери</th>
    2341                            <th scope="col">Режисер</th>
     
    3755                        <tbody>
    3856                        <tr th:each="movie : ${movies}" class="elements">
    39                             <td th:text="${movie.getTitle()}"></td>
     57                            <td><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}"></a></td>
    4058                            <td th:text="${movie.getDescription()}"></td>
    4159                            <td th:text="${movie.getAiringDate()}"></td>
     
    4765                            </td>
    4866                            <td>
    49                                 <div th:each="a: ${movie.getActors()}" th:text="${a.getPerson().getName()} "></div>
     67                                <div th:each="ac: ${movie.getActors()}">
     68                                    <a th:href="@{'/persons/{id}' (id=${ac.getPerson().getPersonId()})}" th:text="${ac.getPerson().getName() + ' ' + ac.getPerson().getSurname()}"></a>
     69                                </div>
    5070                            </td>
    51                             <td th:text="${movie.getDirector() != null ? movie.getDirector()?.getName() + ' '+ movie.getDirector()?.getSurname() : 'Не е додаен директор'}"></td>
     71                            <td th:if="${movie.getDirector() != null}">
     72                                <a th:href="@{'/persons/{id}' (id=${movie.getDirector().getPersonId()})}" th:text="${movie.getDirector().getName() + ' ' + movie.getDirector().getSurname()}"></a>
     73                            </td>
     74                            <td th:if="${movie.getDirector() == null}">
     75                                Филмот нема режисер.
     76                            </td>
    5277                            <td>
    5378                                <a class="btn btn-primary" th:href="@{'discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a>
     
    5580                            <th:block sec:authorize="isAuthenticated()">
    5681                            <td>
    57                                 <a class="btn btn-primary button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">Додади во омилена листа</a>
    58                                 <a class="btn btn-primary button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">Избриши од омилена листа</a>
    59 
     82                                <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>
     83                                <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>
    6084                            </td>
    6185                            <td>
    62                                 <a class="btn btn-primary button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
     86                                <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
    6387                            </td>
    6488                            <td>
    65                                 <a class="btn btn-primary" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a>
     89                                <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Измени</a>
    6690                            </td>
    6791                            <td>
    68                                 <a class="btn btn-primary button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
     92                                <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
    6993                            </td>
    7094                            </th:block>
     
    7599            </div>
    76100        </div>
    77     </div>
     101    </div>-->
    78102
    79103</div>
  • src/main/resources/templates/personsList.html

    r5b447b0 r42d565b  
    1212                        <tr>
    1313                            <th scope="col">Име</th>
    14                             <th scope="col">Презиме</th>
     14                            <!--<th scope="col">Презиме</th>-->
    1515                            <th scope="col">Датум рагање</th>
    16                             <th scope="col">Опис</th>
     16                            <!--<th scope="col">Опис</th>-->
    1717<!--                            <th scope="col">Занрови</th>-->
    1818                            <th scope="col">Слика</th>
     
    3131                        <tbody>
    3232                        <tr th:each="person : ${persons}" class="elements">
    33                             <td th:text="${person.getName()}"></td>
    34                             <td th:text="${person.getSurname()}"></td>
     33                            <td><a th:href="@{'/persons/{id}' (id=${person.getPersonId()})}" th:text="${person.getName() + ' ' + person.getSurname()}"></a></td>
     34                            <!--<td th:text="${person.getSurname()}"></td>-->
    3535                            <td th:text="${person.getDateOfBirth()}"></td>
    36                             <td th:text="${person.getDescription()}"></td>
     36                            <!--<td th:text="${person.getDescription()}"></td>-->
    3737
    3838<!--                            <td>-->
  • src/main/resources/templates/template.html

    r5b447b0 r42d565b  
    33<head>
    44    <meta charset="UTF-8"/>
    5     <title>Products</title>
     5    <title>weDiscussMovies</title>
    66    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    77    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     
    1818<section class="jumbotron text-center">
    1919    <div class="container">
    20         <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
    21         <h3 class="jumbotron-heading">All products</h3>
     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>
    2222    </div>
    2323</section>
     
    2727    <h1 class="danger" th:text="${error?.toString()}"></h1>
    2828</div>
    29 <div th:replace="fragments/searchBarName"></div>
    3029<section th:include="${contentTemplate}"></section>
    3130<div id="dialog-rating" style="display: none">
  • target/classes/static/css/shared.css

    r5b447b0 r42d565b  
    22    max-width: 5vw;
    33}
     4
     5.row{
     6    height: 300px;
     7    margin-bottom: 15px;
     8}
     9
     10.row div{
     11    height: 100%;
     12}
     13
     14.row div div{
     15    height: 100%;
     16}
     17
     18.card{
     19    background-size: 100vh auto;
     20    float:left;
     21    margin: 7px;
     22    border-radius: 10px;
     23    padding: 20px;
     24    color: white;
     25    -webkit-text-stroke-width: 1px !important;
     26    -webkit-text-stroke-color: black !important;
     27    width: 90%;
     28    height: 90%;
     29    box-shadow: 4px 4px 4px rgba(128,128,128,1);
     30}
     31
     32.card a h3{
     33    -webkit-text-stroke-width: 1px;
     34    -webkit-text-stroke-color: black;
     35    color:white;
     36    transition: 100ms;
     37}
     38
     39.card:hover a h3{
     40    transition: 400ms;
     41    color:black;
     42    -webkit-text-stroke-color: gray;
     43}
     44
     45.title{
     46    text-align: center;
     47    background-color: rgba(0,0,0,0.25);
     48    border-radius: 10px 10px 0px 0px;
     49    padding: 10px;
     50}
     51
     52.bottom{
     53    position: absolute;
     54    top: 80%;
     55    margin:auto;
     56    width: 100%;
     57    left: 0%;
     58    border-radius: 0px;
     59    text-align: center;
     60    background-color: rgba(0,0,0,0.25);
     61}
     62
     63
     64.bottom-heart{
     65    top: 60%;
     66    left: auto;
     67    position: absolute;
     68    margin: auto;
     69    width: 20%;
     70    text-align: center;
     71}
  • target/classes/static/js/sharedScript.js

    r5b447b0 r42d565b  
    44    var elements = $(".elements")
    55    var elementGrade;
     6
    67
    78    $("#dialog-rating").dialog({
     
    145146                let movieId=$(button).attr("movie-id")
    146147                if (type==='like') {
    147                     $(button).parent().append("<a class='btn btn-primary button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">Избриши од омилена листа</a>")
     148                    $(button).parent().append("<a class='bottom-heart btn btn-danger button-remove-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">💔</a>")
    148149                    console.log("da")
    149150                }
    150151                else{
    151                     $(button).parent().append("<a class='btn btn-primary button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">Додади во омилена листа</a>")
     152                    $(button).parent().append("<a class='bottom-heart btn btn-success button-add-favourite-list' movie-id=" + movieId + " user-id=" + userId + ">❤</a>")
    152153
    153154                }
  • target/classes/templates/discussion.html

    r5b447b0 r42d565b  
    11<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
    2     <div th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></div>
    3     <div th:text="${disc.getTitle()}"></div>
    4     <div th:text="${disc.getText()}"></div>
    5     <div th:text="${disc.getDate()}"></div>
    6     <div th:text="${disc.getUser().getUsername()}"></div>
    7     <div th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </div>
    8     <div th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </div>
    9     <table class="table table-striped">
     2    <div style="width: 85%; text-align: justify; margin: auto; clear: both">
     3        <div>
     4            <h1 th:text="${disc.getTitle()}" style="width: 80%; float: left"></h1>
     5        </div>
     6        <hr><br><br>
     7        <div>
     8            <h5 th:text="${disc.getText()}" style="width: 90%; margin: auto; background-color: lightblue; border-radius: 4px; padding: 20px"></h5>
     9        </div>
     10        <br><br><br>
     11        <h6 style="width: 60%; float:left;">
     12            <span th:text="${'Поставено од: '+disc.getUser().getUsername()}"></span>
     13            <span th:text="${', на датум '+ disc.getDate()}"></span>
     14            <br>
     15            <span>Поставено за </span>
     16            <span th:text="${disc.getMovie() != null ? 'Филмот ' + disc.getMovie().getTitle() : 'Актерот ' + disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}" ></span>
     17        </h6>
     18        <div style="float: right"  sec:authorize="isAuthenticated()">
     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>
     23    </div>
     24    <table class="table table-striped" style="width: 70%; margin: auto;">
    1025        <thead>
    1126        <tr>
    12 
    13             <th scope="col">Опис</th>
    14             <th scope="col">Датум</th>
    15             <th scope="col">Корисник</th>
     27            <th scope="col">Реплика</th>
     28            <th scope="col">Поставена на</th>
     29            <th scope="col">Поставена од</th>
    1630            <th:block  sec:authorize="isAuthenticated()">
    17 
    1831                <th scope="col"></th>
    1932                <th scope="col"></th>
    2033            </th:block>
    21 
    2234        </tr>
    2335        </thead>
     
    2739            <td th:text="${reply.getDate()}"></td>
    2840            <td th:text="${reply.getUser().getUsername()}"></td>
    29             <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/edit/{discussionId}/{replyId}' (discussionId=${disc.getDiscussionId()},replyId=${reply.getReplyId()})}">Промени</a> </td>
    30             <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-primary button-delete-reply" th:reply-id="${reply.getReplyId()}" th:dicsussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    31 
     41            <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/replies/edit/{discussionId}/{replyId}' (discussionId=${disc.getDiscussionId()},replyId=${reply.getReplyId()})}">Промени</a> </td>
     42            <td th:if="${reply.getUser().equals(user)}"><a class="btn btn-danger button-delete-reply" th:reply-id="${reply.getReplyId()}" th:dicsussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3243            <th:block sec:authorize="isAuthenticated()">
    33                 <td th:if="${!reply.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    3444                <td th:if="${!reply.getUser().equals(user)}">
    35                     <a class="btn btn-primary">Ми се допаѓа</a>
    36                     <a class="btn btn-primary">Не ми се допаѓа</a>
     45                    <a class="btn btn-success">👍 </a>
     46                    <a class="btn btn-danger">👎</a>
    3747                </td>
    3848            </th:block>
    39 
    40 
    4149        </tr>
    4250        </tbody>
  • target/classes/templates/discussionForType.html

    r5b447b0 r42d565b  
    88                        <thead>
    99                        <tr>
    10                             <th scope="col">Наменета</th>
    1110                            <th scope="col">Наслов</th>
    1211                            <th scope="col">Опис</th>
     
    2625                        <tbody>
    2726                        <tr th:each="disc : ${discussions}" class="movie">
    28                             <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
    29                             <td th:text="${disc.getTitle()}"></td>
     27                            <td>
     28                                <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
     29                            </td>
    3030                            <td th:text="${disc.getText()}"></td>
    3131                            <td th:text="${disc.getDate()}"></td>
    3232                            <td th:text="${disc.getUser().getUsername()}"></td>
    33                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </td>
    34                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
     33                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Измени</a> </td>
     34                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3535
    3636                            <th:block sec:authorize="isAuthenticated()">
    37                                 <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
     37                                <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    3838                                <td th:if="${!disc.getUser().equals(user)}">
    39                                     <a class="btn btn-primary">Ми се допаѓа</a>
    40                                     <a class="btn btn-primary">Не ми се допаѓа</a>
     39                                    <a class="btn btn-success">👍 </a>
     40                                    <a class="btn btn-danger">👎</a>
    4141                                </td>
    4242                            </th:block>
  • target/classes/templates/discussionsList.html

    r5b447b0 r42d565b  
    1010                        <thead>
    1111                        <tr>
    12                             <th scope="col">Наменета</th>
    1312                            <th scope="col">Наслов</th>
    1413                            <th scope="col">Опис</th>
     
    2928                        <tr th:each="disc : ${discussions}" class="movie">
    3029                            <td th:text="${disc.getMovie() != null ? disc.getMovie().getTitle() : disc.getPerson().getName() + ' ' + disc.getPerson().getSurname()}"></td>
    31                             <td th:text="${disc.getTitle()}"></td>
     30                            <td>
     31                                <a th:text="${disc.getTitle()}" th:href="@{'/discussions/{id}' (id=${disc.getDiscussionId()})}"></a>
     32                            </td>
    3233                            <td th:text="${disc.getText()}"></td>
    3334                            <td th:text="${disc.getDate()}"></td>
    3435                            <td th:text="${disc.getUser().getUsername()}"></td>
    35                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Промени</a> </td>
    36                             <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-primary button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
     36                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-warning" th:href="@{'/discussions/add/{id}' (id=${disc.getDiscussionId()})}">Измени</a> </td>
     37                            <td th:if="${disc.getUser().equals(user)}"><a class="btn btn-danger button-delete-discussion" th:discussion-id="${disc.getDiscussionId()}">Избриши</a> </td>
    3738
    3839                            <th:block sec:authorize="isAuthenticated()">
    39                             <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-primary" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
     40                            <td th:if="${!disc.getUser().equals(user)}"><a class="btn btn-success" th:href="@{'/replies/add/{discussionId}' (discussionId=${disc.getDiscussionId()})}">Реплицирај</a> </td>
    4041                            <td th:if="${!disc.getUser().equals(user)}">
    41                                 <a class="btn btn-primary">Ми се допаѓа</a>
    42                                 <a class="btn btn-primary">Не ми се допаѓа</a>
     42                                <a class="btn btn-success">👍 </a>
     43                                <a class="btn btn-danger">👎</a>
    4344                            </td>
    4445                            </th:block>
  • target/classes/templates/favoriteList.html

    r5b447b0 r42d565b  
    1 <div class="container mb-4">
    2     <div class="row">
     1<div class="container mb-4" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
     2    <div class="row" th:each="row: ${movie_rows}" >
     3        <div class="col-md-3" th:each="movie: ${row}" >
     4            <a class="card-text-center" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
     5                    <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
     6                        <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
     7                        <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
     8                    </div>
     9            </a>
     10        </div>
     11    </div>
     12
     13    <!--<div class="row">
    314        <div class="col-12" th:if="${movies.size() > 0}">
    415            <div class="table-responsive">
     
    3950            </div>
    4051        </div>
    41     </div>
     52    </div>-->
    4253</div>
  • target/classes/templates/fragments/header.html

    r5b447b0 r42d565b  
    22    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
    33        <div class="container">
    4             <a class="navbar-brand" href="/">Форум за филмови</a>
     4            <a class="navbar-brand" href="/movies">Форум за филмови</a>
    55            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
    66                    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
     
    1616                    </li>
    1717                    <li class="nav-item m-auto">
    18                         <a class="nav-link active" href="/directors">Директори</a>
     18                        <a class="nav-link active" href="/directors">Режисери</a>
    1919                    </li>
    2020                    <li class="nav-item m-auto">
  • target/classes/templates/fragments/searchBarGenre.html

    r5b447b0 r42d565b  
    11<div>
    2       <label for="searchGenre">жанр</label>
     2      <label for="searchGenre" style="width: 150px;">Пребарај по жанр</label>
    33        <input id="searchGenre" type="text" placeholder="жанр">
    44        <button class="search-button">Пребарај</button>
  • target/classes/templates/fragments/searchBarName.html

    r5b447b0 r42d565b  
    11<div>
    2     <label for="searchTitle">Прабарај по име</label>
     2    <label for="searchTitle" style="width: 150px;">Прабарај по име</label>
    33    <input id="searchTitle" type="text" placeholder="име">
    44    <button class="search-button-title">Пребарај</button>
  • target/classes/templates/moviesList.html

    r5b447b0 r42d565b  
    11<div xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
    2     <div th:replace="fragments/searchBarGenre">
    32
     3    <div style="width: 70%; margin: auto">
     4        <div th:replace="fragments/searchBarName"></div>
     5        <div th:replace="fragments/searchBarGenre"></div>
    46    </div>
    57
     
    911
    1012    <div class="container mb-4">
     13        <div class="row" th:each="row: ${movie_rows}" >
     14            <div class="col-md-3" th:each="movie: ${row}" >
     15                    <div class="card-body card bg-image" th:style="'background:url(' + ${movie.getImageUrl()} + ') no-repeat center #eee;'">
     16                        <a class="card-text-center" style="color: white" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}" >
     17                        <h3 class="card-title title" th:text="${movie.getTitle()}"></h3>
     18                        </a>
     19                        <h3 class="card-text bottom" th:text="${'Rated '+movie.getImdbRating()}"></h3>
     20                        <th:block sec:authorize="isAuthenticated()">
     21                            <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>
     22                            <a class="bottom-heart btn btn-danger button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">💔</a>
     23                        </th:block>
     24                    </div>
     25            </div>
     26        </div>
     27    </div>
     28    <!--<div class="container mb-4">
    1129        <div class="row">
    1230            <div class="col-12" th:if="${movies.size() > 0}">
     
    1937                            <th scope="col">Датум издавање</th>
    2038                            <th scope="col">Допаѓања</th>
    21                             <th scope="col">Занрови</th>
     39                            <th scope="col">Жанрови</th>
    2240                            <th scope="col">Актери</th>
    2341                            <th scope="col">Режисер</th>
     
    3755                        <tbody>
    3856                        <tr th:each="movie : ${movies}" class="elements">
    39                             <td th:text="${movie.getTitle()}"></td>
     57                            <td><a th:text="${movie.getTitle()}" th:href="@{'/movies/{id}' (id=${movie.getMovieId()})}"></a></td>
    4058                            <td th:text="${movie.getDescription()}"></td>
    4159                            <td th:text="${movie.getAiringDate()}"></td>
     
    4765                            </td>
    4866                            <td>
    49                                 <div th:each="a: ${movie.getActors()}" th:text="${a.getPerson().getName()} "></div>
     67                                <div th:each="ac: ${movie.getActors()}">
     68                                    <a th:href="@{'/persons/{id}' (id=${ac.getPerson().getPersonId()})}" th:text="${ac.getPerson().getName() + ' ' + ac.getPerson().getSurname()}"></a>
     69                                </div>
    5070                            </td>
    51                             <td th:text="${movie.getDirector() != null ? movie.getDirector()?.getName() + ' '+ movie.getDirector()?.getSurname() : 'Не е додаен директор'}"></td>
     71                            <td th:if="${movie.getDirector() != null}">
     72                                <a th:href="@{'/persons/{id}' (id=${movie.getDirector().getPersonId()})}" th:text="${movie.getDirector().getName() + ' ' + movie.getDirector().getSurname()}"></a>
     73                            </td>
     74                            <td th:if="${movie.getDirector() == null}">
     75                                Филмот нема режисер.
     76                            </td>
    5277                            <td>
    5378                                <a class="btn btn-primary" th:href="@{'discussions/all/{id}?type=M' (id=${movie.getMovieId()})}" >Прегледај дискусии</a>
     
    5580                            <th:block sec:authorize="isAuthenticated()">
    5681                            <td>
    57                                 <a class="btn btn-primary button-add-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${!likedMovies.contains(movie)}">Додади во омилена листа</a>
    58                                 <a class="btn btn-primary button-remove-favourite-list" th:movie-id="${movie.getMovieId()}" th:user-id="${user.getUserId()}" th:if="${likedMovies.contains(movie)}">Избриши од омилена листа</a>
    59 
     82                                <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>
     83                                <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>
    6084                            </td>
    6185                            <td>
    62                                 <a class="btn btn-primary button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
     86                                <a class="btn btn-success button-add-grade-movie" th:movie-id="${movie.getMovieId()}">Остави оценка</a>
    6387                            </td>
    6488                            <td>
    65                                 <a class="btn btn-primary" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Промени</a>
     89                                <a class="btn btn-warning" th:href="@{'/movies/{id}/edit' (id=${movie.getMovieId()})}">Измени</a>
    6690                            </td>
    6791                            <td>
    68                                 <a class="btn btn-primary button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
     92                                <a class="btn btn-danger button-delete-movie" th:movie-id="${movie.getMovieId()}">Избриши филм</a>
    6993                            </td>
    7094                            </th:block>
     
    7599            </div>
    76100        </div>
    77     </div>
     101    </div>-->
    78102
    79103</div>
  • target/classes/templates/personsList.html

    r5b447b0 r42d565b  
    1212                        <tr>
    1313                            <th scope="col">Име</th>
    14                             <th scope="col">Презиме</th>
     14                            <!--<th scope="col">Презиме</th>-->
    1515                            <th scope="col">Датум рагање</th>
    16                             <th scope="col">Опис</th>
     16                            <!--<th scope="col">Опис</th>-->
    1717<!--                            <th scope="col">Занрови</th>-->
    1818                            <th scope="col">Слика</th>
     
    3131                        <tbody>
    3232                        <tr th:each="person : ${persons}" class="elements">
    33                             <td th:text="${person.getName()}"></td>
    34                             <td th:text="${person.getSurname()}"></td>
     33                            <td><a th:href="@{'/persons/{id}' (id=${person.getPersonId()})}" th:text="${person.getName() + ' ' + person.getSurname()}"></a></td>
     34                            <!--<td th:text="${person.getSurname()}"></td>-->
    3535                            <td th:text="${person.getDateOfBirth()}"></td>
    36                             <td th:text="${person.getDescription()}"></td>
     36                            <!--<td th:text="${person.getDescription()}"></td>-->
    3737
    3838<!--                            <td>-->
  • target/classes/templates/template.html

    r5b447b0 r42d565b  
    33<head>
    44    <meta charset="UTF-8"/>
    5     <title>Products</title>
     5    <title>weDiscussMovies</title>
    66    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    77    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
     
    1818<section class="jumbotron text-center">
    1919    <div class="container">
    20         <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
    21         <h3 class="jumbotron-heading">All products</h3>
     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>
    2222    </div>
    2323</section>
     
    2727    <h1 class="danger" th:text="${error?.toString()}"></h1>
    2828</div>
    29 <div th:replace="fragments/searchBarName"></div>
    3029<section th:include="${contentTemplate}"></section>
    3130<div id="dialog-rating" style="display: none">
Note: See TracChangeset for help on using the changeset viewer.