Skip to content

Commit

Permalink
fis all error
Browse files Browse the repository at this point in the history
  • Loading branch information
seung-gyu-kim committed Aug 9, 2019
1 parent 084c9a2 commit 055777b
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 133 deletions.
148 changes: 73 additions & 75 deletions board/templates/board.html
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">&laquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="" aria-label="Previous">
<span aria-disabled="true">&laquo;</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">&raquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="" aria-label="Next">
<span aria-disabled="true">&raquo;</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">&raquo;</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<a class="page-link" href="" aria-label="Next">
<span aria-disabled="true">&raquo;</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 %}
109 changes: 51 additions & 58 deletions board/templates/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,69 @@
}
</style>

<div class="container" style="padding-top: 200px;">
<h2>{{ board.title }}</h2>
<p>{{ board.date }}</p>
<div class="container" style="padding-top: 200px;">
<h2>{{ board.title }}</h2>
<p>{{ board.date }}</p>

<br>
<br>
<div class="container" style=" margin:0,25px,25px,25px; width:100%;">
<section id="recently">
<div class="col">
<div class="row">
<div style="border-radius: 5px; border:1px dashed rgb(91,155,213); padding: 15px; width:100%; ">
<p>{{ board.body }}</p>
</div>
<br>
<br>
<div class="container" style=" margin:0,25px,25px,25px; width:100%;">
<section id="recently">
<div class="col">
<div class="row">
<div style="border-radius: 5px; border:1px dashed rgb(91,155,213); padding: 15px; width:100%; ">
<p>{{ board.body }}</p>
</div>
</div>
</section>
</div>

<br>
<br>



<a href="{% url 'board' %}">글목록</a>
<a href="{% url 'chart' board.id %}">차트보기</a>
</div>
</section>
</div>

<br>
<br>

<h4> 댓글</h4>

<form method="POST" action='{% url "createcomment" board.id %}'>
{% csrf_token %}
<div>
<textarea class="form-control" id="exampleFormControlTextarea1" name="text" rows="3"></textarea>
<h4>가격 : </h4> <input type="number" name="price" min="1" max="10000000">
</div>
<br>
<br>

<h4> 댓글</h4>
<a href="{% url 'board' %}">글목록</a>
<a href="{% url 'chart' board.id %}">차트보기</a>
</div>

<form method="POST" action='{% url "createcomment" board.id %}'>
{% csrf_token %}
<div>
<textarea class="form-control" id="exampleFormControlTextarea1" name="text" rows="3"></textarea>
<h4>가격 : </h4> <input type="number" name="price" min="1" max="10">
</div>
<br>
<div align='right'>
<button type="submit" class="btn btn-primary">등록</button>
</div>
</form>
<br>
<br>

<hr border='1'>
{% for comments in comment.all %}
<div class="comment">
<div class="date">
<strong>{{ comments.author }}</strong>
{{ comments.created_date }}
</div>
<p>{{ comments.text|linebreaks }}</p>
<p>제시한 가격 : {{comments.price}}</p>
</div>
<hr border='1'>
{% empty %}
<p>No comments here yet :(</p>
{% endfor %}
<h4> 댓글</h4>

<form method="POST" action='{% url "createcomment" board.id %}'>
{% csrf_token %}
<div>
<textarea class="form-control" id="exampleFormControlTextarea1" name="text" rows="3"></textarea>
<h4>가격 : </h4> <input type="number" name="price" min="1" max="10000000">
</div>
<br>
<div align='right'>
<button type="submit" class="btn btn-primary">등록</button>
</div>
<br>
<br>
</form>

<hr border='1'>
{% for comments in comment.all %}
<div class="comment">
<div class="date">
<strong>{{ comments.author }}</strong>
{{ comments.created_date }}
</div>
<p>{{ comments.text|linebreaks }}</p>
<p>제시한 가격 : {{comments.price}}</p>
</div>
<hr border='1'>
{% empty %}
<p>No comments here yet :(</p>
{% endfor %}
</div>

<div style="margin-bottom: 150px;"></div>



{% endblock %}

0 comments on commit 055777b

Please sign in to comment.