Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
[BE][지영] :: home 최신글 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Zy0ung committed Nov 19, 2021
1 parent c5db85a commit 6e4df97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
17 changes: 10 additions & 7 deletions school/static/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ margin-top: 15vh;
.bulletin_board_table th{
height: 1vh;
border-color: black;

}
td{


}

.first_row{
Expand All @@ -147,7 +144,13 @@ background-color: white;
width: 8vw;
background-color: white;
}
td.content_board{

#board{
background-color: #CDF0FF;
height: 100%;
width: 100%;
border-radius: 44px;
}

.content_board{
width: 560px;
height: 402px;
}
9 changes: 8 additions & 1 deletion school/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
<div class="main">
<table class="bulletin_board_table" >
<tr class="test"><!-- 첫번째 줄 시작 -->
<td class="content_board"><div id="board">1</div></td>
<td class="content_board"><div id="board">
{%for a in notices%}
<div>
<a href="{% url 'notice_detail' a.id %}">{{a.Notice_title}}</a>
</div>
{%endfor%}
</div></td>
<td class="table_column_margin"></td>
<td class="content_board"><div id="board">2</div></td>

Expand Down Expand Up @@ -56,6 +62,7 @@
</table>



</div>

<div class="undermargin"></div>
Expand Down
6 changes: 5 additions & 1 deletion school/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

# Create your views here.
def home(request):
return render(request, 'home.html')
notices = Notice.objects.all().order_by('-Notice_pub_date')
paginator = Paginator(notices, 3)
page_number = request.GET.get('page')
page = paginator.get_page(page_number)
return render(request, 'home.html',{'notices':page})

## 메인 자유게시판
def mainpage(requset):
Expand Down

0 comments on commit 6e4df97

Please sign in to comment.