forked from seung-gyu-kim/LikeLion_GASILI_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
084c9a2
commit 055777b
Showing
2 changed files
with
124 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,92 @@ | ||
{% extends 'base.html' %} | ||
|
||
|
||
{% block content %} | ||
|
||
|
||
<div class="container" style="padding-top: 100px;"> | ||
<h1 style="text-align: center;">GaSiRi</h1> | ||
{% block content %} | ||
|
||
<div style="padding-top: 100px;"> | ||
<table class="table table-hover"> | ||
<thead> | ||
|
||
<div class="container" style="padding-top: 100px;"> | ||
<h1 style="text-align: center;">GaSiRi</h1> | ||
|
||
<div style="padding-top: 100px;"> | ||
<table class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th scope="col" style="text-align: center;">순번</th> | ||
<th scope="col" style="text-align: center;">글제목</th> | ||
<th scope="col" style="text-align: center;">작성자</th> | ||
<th scope="col" style="text-align: center;">작성일자</th> | ||
<th scope="col" style="text-align: center;">순번</th> | ||
<th scope="col" style="text-align: center;">글제목</th> | ||
<th scope="col" style="text-align: center;">작성자</th> | ||
<th scope="col" style="text-align: center;">작성일자</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
</thead> | ||
<tbody> | ||
{% for board in posts %} | ||
<tr onclick="location.href='{% url 'test' board.id %}'"> | ||
<th scope="row" style="text-align: center;">{{board.id}}</th> | ||
<td style="text-align: center;">{{board.title}}</td> | ||
<td style="text-align: center;">{{board.userName}}</td> | ||
<td style="text-align: center;">{{board.date}}</td> | ||
<th scope="row" style="text-align: center;">{{board.id}}</th> | ||
<td style="text-align: center;">{{board.title}}</td> | ||
<td style="text-align: center;">{{board.userName}}</td> | ||
<td style="text-align: center;">{{board.date}}</td> | ||
</tr> | ||
|
||
|
||
{%endfor%} | ||
</tbody> | ||
</table> | ||
{%endfor%} | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div > | ||
<div > | ||
{%if posts.has_previous%} | ||
<a href="?page=1">First</a> | ||
<a href="?page={{posts.previous_page_number}}">Previous</a> | ||
{%endif%} | ||
|
||
<span>{{posts.number}}</span> | ||
<span>of</span> | ||
<span>{{posts.paginator.num_pages}}</span> | ||
|
||
{%if posts.has_next%} | ||
<a href="?page={{posts.next_page_number}}">Next</a> | ||
<a href="?page={{posts.paginator.num_pages}}">Last</a> | ||
{%endif%} | ||
</div> | ||
<div> | ||
<div> | ||
<nav aria-label="Page navigation example"> | ||
<ul class="pagination"> | ||
{%if posts.has_previous%} | ||
<li class="page-item"> | ||
<a class="page-link" href="?page={{posts.previous_page_number}}" aria-label="Previous"> | ||
<span aria-hidden="true">«</span> | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="page-item disabled"> | ||
<a class="page-link" href="" aria-label="Previous"> | ||
<span aria-disabled="true">«</span> | ||
</a> | ||
</li> | ||
|
||
{%endif%} | ||
|
||
|
||
{% for i in p_range %} | ||
|
||
{% if i == page %} | ||
<li class="page-item active"><a class="page-link" href="?page={{i}}">{{i}}</a></li> | ||
{% else %} | ||
<li class="page-item"><a class="page-link" href="?page={{i}}">{{i}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{%if posts.has_next%} | ||
<li class="page-item"> | ||
<a class="page-link" href="?page={{posts.next_page_number}}" aria-label="Next"> | ||
<span aria-hidden="true">»</span> | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="page-item disabled"> | ||
<a class="page-link" href="" aria-label="Next"> | ||
<span aria-disabled="true">»</span> | ||
</a> | ||
</li> | ||
{%endif%} | ||
</ul> | ||
</nav> | ||
</div> | ||
{% if user.is_authenticated %} | ||
<a href = "{% url 'board_new' %}"><button type="button" class="btn btn-danger" style="float: right;">글쓰기</button></a> | ||
<a href="{% url 'board_new' %}"><button type="button" class="btn btn-danger" | ||
style="float: right;">글쓰기</button></a> | ||
{% else %} | ||
<button type="button" onclick="alert('로그인을 해주세요'); location.replace('../accounts/login/');" class="btn btn-danger" style="float: right;">글쓰기</button> | ||
<button type="button" onclick="alert('로그인을 해주세요'); location.replace('../accounts/login/');" | ||
class="btn btn-danger" style="float: right;">글쓰기</button> | ||
{% endif %} | ||
<div style="margin-bottom:60px;"></div> | ||
</div> | ||
|
||
</div> | ||
|
||
{% for i in p_range %} | ||
|
||
{% if i == page %} | ||
<li class="page-item active"><a class="page-link" href="?page={{i}}">{{i}}</a></li> | ||
{% else %} | ||
<li class="page-item"><a class="page-link" href="?page={{i}}">{{i}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
<div style="margin-bottom: 150px;"></div> | ||
|
||
{%if posts.has_next%} | ||
<li class="page-item"> | ||
<a class="page-link" href="?page={{posts.next_page_number}}" aria-label="Next"> | ||
<span aria-hidden="true">»</span> | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="page-item disabled"> | ||
<a class="page-link" href="" aria-label="Next"> | ||
<span aria-disabled="true">»</span> | ||
</a> | ||
</li> | ||
{%endif%} | ||
</ul> | ||
</nav> | ||
</div> | ||
{% if user.is_authenticated %} | ||
<a href = "{% url 'board_new' %}"><button type="button" class="btn btn-danger" style="float: right;">글쓰기</button></a> | ||
{% else %} | ||
<button type="button" onclick="alert('로그인을 해주세요'); location.replace('../accounts/login/');" class="btn btn-danger" style="float: right;">글쓰기</button> | ||
{% endif %} | ||
</div> | ||
|
||
</div> | ||
{% endblock %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters