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.
Showing
7 changed files
with
119 additions
and
57 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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block content %} | ||
<div class="container-fluid row" style="width:100%; margin:0; padding:0;"> | ||
<div class="containerleft"> | ||
</div> | ||
<div class="containerbody"> | ||
<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); width:100%; "> | ||
<h1 style="text-align: center;">내가 단 댓글</h1> | ||
<div style="padding-top: 20px;"></div> | ||
<div class="flexbox"> | ||
<div class="item"><a href="{% url 'update'%}">사용자정보</a></div> | ||
<div class="item"><a href="{% url 'mypageComment'%}">내가 단 댓글</a></div> | ||
<div class="item"><a href="{% url 'mypageBlog'%}">내가 쓴 게시글</a></div> | ||
</div> | ||
<table class="table table-hover"> | ||
<thead> | ||
<tr style="text-align: center;"> | ||
<th scope="col">순번</th> | ||
<th scope="col">글제목</th> | ||
<th scope="col">글내용</th> | ||
<th scope="col">작성일자</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for post in posts %} | ||
<tr onclick="location.href='{% url 'test' post.id %}'" style="text-align: center;"> | ||
<th scope="row">{{post.id}}</th> | ||
<td>{{post.title}}</td> | ||
<td>{{post.body| truncatechars:10}}</td> | ||
<td>{{post.date}}</td> | ||
</tr> | ||
|
||
{%endfor%} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
<div class="containerright"></div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{% extends 'base.html' %} | ||
|
||
{% block content %} | ||
<div class="container-fluid row" style="width:100%; margin:0; padding:0;"> | ||
<div class="containerleft"> | ||
</div> | ||
<div class="containerbody"> | ||
<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); width:100%; "> | ||
<h1 style="text-align: center;">내가 쓴 게시글</h1> | ||
<div style="padding-top: 20px;"></div> | ||
<div class="flexbox"> | ||
<div class="item"><a href="{% url 'update'%}">사용자정보</a></div> | ||
<div class="item"><a href="{% url 'mypageComment'%}">내가 단 댓글</a></div> | ||
<div class="item"><a href="{% url 'mypageBlog'%}">내가 쓴 게시글</a></div> | ||
</div> | ||
<table class="table table-hover"> | ||
<thead> | ||
<tr style="text-align: center;"> | ||
<th scope="col">순번</th> | ||
<th scope="col">글제목</th> | ||
<th scope="col">댓글내용</th> | ||
<th scope="col">작성일자</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for post in posts %} | ||
<tr onclick="location.href='{% url 'test' post.id %}'" style="text-align: center;"> | ||
<th scope="row">{{post.id}}</th> | ||
<td>{{post.title}}</td> | ||
<td>{{post.text | truncatechars:10}}</td> | ||
<td>{{post.created_date}}</td> | ||
</tr> | ||
|
||
{%endfor%} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</div> | ||
<div class="containerright"></div> | ||
</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
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,10 +1,17 @@ | ||
from django.shortcuts import render, redirect | ||
from board.models import Board | ||
from board.models import Board, Comment | ||
|
||
# Create your views here. | ||
def mypage(request): | ||
def mypageBlog(request): | ||
if request.user.is_authenticated: | ||
posts = Board.objects.filter(userId = request.user.id) | ||
return render(request, 'mypage/mypage.html', {'posts': posts}) | ||
return render(request, 'mypage/mypageBlog.html', {'posts': posts}) | ||
else: | ||
return redirect('login') | ||
|
||
def mypageComment(request): | ||
if request.user.is_authenticated: | ||
posts = Comment.objects.filter(userId = request.user.id) | ||
return render(request, 'mypage/mypageComment.html', {'posts': posts}) | ||
else: | ||
return redirect('login') |