13
13
< h2 class ="form-heading "> List of all polls</ h2 >
14
14
< h3 th:text ="${'Total of ' + totalNum + ' polls.'} " />
15
15
16
+ < div class ="float-right ">
17
+ < a href ="/create " class ="text-primary "> Create a new poll</ a >
18
+ </ div >
19
+
16
20
< div class ="container mb-3 ">
17
21
< div class ="row align-items-start ">
18
22
< div class ="col border border-info bg-info bg-opacity-10 "> Name</ div >
@@ -25,22 +29,22 @@ <h3 th:text="${'Total of ' + totalNum + ' polls.'}" />
25
29
< div class ="col border " th:text ="${poll.participants} " />
26
30
< div class ="col border " th:text ="${{poll.deleted}} " />
27
31
< div class ="col border ">
28
- < a th:href ="@{/delete (id=${poll.id})} "> Close </ a >
29
- < a th:href ="@{/vote (id=${poll.id})} "> Participate </ a >
30
- < a th:href ="@{/results (id=${poll.id})} "> Show results </ a >
32
+ < a th:href ="@{/vote (id=${poll.id})} " class =" text-primary " > Participate </ a >
33
+ < a th:href ="@{/results (id=${poll.id})} " class =" text-secondary " > Show results </ a >
34
+ < a th:unless =" ${poll.deleted} " th: href ="@{/close (id=${poll.id})} " class =" text-danger " > Close </ a >
31
35
</ div >
32
36
</ div >
33
37
</ div >
34
38
35
- < div class ="container mb-3 ">
39
+ < div class ="container mb-3 " th:if =" ${totalPages > 1} " >
36
40
< div class ="row align-items-start "> </ div >
37
41
< nav aria-label ="Page navigation ">
38
42
< ul class ="pagination ">
39
43
< li th:class ="${currentPage == 1} ? 'page-item disabled' : 'page-item' "> < a class ="page-link "
40
- th:href ="${currentPage == 1} ? '#' : ' @{/list(p=${currentPage-1})}' "> Previous</ a > </ li >
41
- < li th:class ="${currentPage == totalPages} ? 'page-item disabled' : 'page-item' "> < a
44
+ th:href ="${currentPage == 1} ? '#' : @{/list(p=${currentPage-1})} "> Previous</ a > </ li >
45
+ < li th:class ="${totalPages > 1 && currentPage == totalPages} ? 'page-item disabled' : 'page-item' "> < a
42
46
class ="page-link "
43
- th:href ="${currentPage == totalPages} ? '#' : ' @{/list(p=${currentPage+1})}' "> Next</ a > </ li >
47
+ th:href ="${totalPages > 1 && currentPage == totalPages} ? '#' : @{/list(p=${currentPage+1})} "> Next</ a > </ li >
44
48
</ ul >
45
49
</ nav >
46
50
</ div >
0 commit comments