Skip to content

Commit

Permalink
feat : 메인 화면에서 활동사진이 보여질 수 있도록 변경(#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
effort-type committed Apr 25, 2024
1 parent bab02bd commit 1c8849d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 23 deletions.
Binary file modified homePage/db.sqlite3
Binary file not shown.
6 changes: 3 additions & 3 deletions homePage/picture/templates/picture/picture_detail_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
</a>
<div class="hidden md:flex space-x-4">
<!-- Navigation Links -->
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="https://forms.gle/gJVS9kTaVgh4f4tt9" target="_blank" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="/posts" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="/picture" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">결과물</a>
</div>
<!-- Mobile Menu Button -->
Expand Down
8 changes: 5 additions & 3 deletions homePage/picture/templates/picture/picture_post.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<div class="hidden md:flex space-x-4">
<!-- Navigation Links -->
<a href="https://forms.gle/gJVS9kTaVgh4f4tt9" target="_blank" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="posts.html" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="/posts" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="/picture" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">결과물</a>
</div>
<!-- Mobile Menu Button -->
Expand All @@ -90,9 +90,11 @@ <h2 class="text-2xl font-bold text-blue-800">활동사진</h2>

<div class="col-md-4">
<div class="card mb-4 shadow-sm">
{{ p.image.url }}
<img class="card-img-top" src="{{ p.image.url }}" alt="Card image cap" />
<div class="card-body">
<p class="card-text">{{ p.content }}</p>
<p class="card-text">{{ p.title|safe }}</p>
<br/>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary"><a href="{{p.pk}}">자세히 보기</a></button>
Expand Down
27 changes: 16 additions & 11 deletions homePage/post/templates/post/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<!-- Navigation Links -->
<a href="https://forms.gle/gJVS9kTaVgh4f4tt9" target="_blank" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="/posts" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="/picture" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">결과물</a>
</div>
<!-- Mobile Menu Button -->
Expand Down Expand Up @@ -82,22 +82,27 @@ <h2 class="text-2xl font-bold text-blue-800">공지사항</h2>
<section class="container mx-auto">
<div class="flex items-center justify-between border-b-2 border-blue-800 pb-2">
<h2 class="text-2xl font-bold text-blue-800">활동 사진</h2>
<a href="#" class="text-blue-600 hover:text-blue-800 float-right font-semibold">MORE +</a>
<a href="/picture" class="text-blue-600 hover:text-blue-800 float-right font-semibold">MORE +</a>
</div>

<ul class="my-4">
<div class="col-span-1">
<div class="relative">
<!-- 슬라이드 이미지 -->
<div class="slide">
<img class="w-full" src="https://source.unsplash.com/featured/?university,event" alt="이벤트 이미지">
</div>
<div class="slide">
<img class="w-full" src="https://source.unsplash.com/featured/?university,seminar" alt="세미나 이미지">
</div>
<div class="slide">
<img class="w-full" src="https://source.unsplash.com/featured/?university,graduation" alt="졸업식 이미지">
</div>
{% for p in picture %}
<div class="slide">
<img class="w-full" src="{{ p.image.url }}" alt="이벤트 이미지">
</div>
{% endfor %}
{# <div class="slide">#}
{# <img class="w-full" src="https://source.unsplash.com/featured/?university,event" alt="이벤트 이미지">#}
{# </div>#}
{# <div class="slide">#}
{# <img class="w-full" src="https://source.unsplash.com/featured/?university,seminar" alt="세미나 이미지">#}
{# </div>#}
{# <div class="slide">#}
{# <img class="w-full" src="https://source.unsplash.com/featured/?university,graduation" alt="졸업식 이미지">#}
{# </div>#}

<!-- 이전/다음 버튼 -->
<a class="absolute top-1/2 left-0 transform -translate-y-1/2 bg-blue-500 text-white p-1 cursor-pointer" onclick="moveSlide(-1)">&#10094;</a>
Expand Down
6 changes: 3 additions & 3 deletions homePage/post/templates/post/postDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
</a>
<div class="hidden md:flex space-x-4">
<!-- Navigation Links -->
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="https://forms.gle/gJVS9kTaVgh4f4tt9" target="_blank" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="/posts" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="/picture" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">결과물</a>
</div>
<!-- Mobile Menu Button -->
Expand Down
4 changes: 2 additions & 2 deletions homePage/post/templates/post/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<div class="hidden md:flex space-x-4">
<!-- Navigation Links -->
<a href="https://forms.gle/gJVS9kTaVgh4f4tt9" target="_blank" class="hover:bg-blue-700 px-3 py-2 rounded-md">모집 신청서</a>
<a href="posts.html" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="/posts" class="hover:bg-blue-700 px-3 py-2 rounded-md">공지사항</a>
<a href="/picture" class="hover:bg-blue-700 px-3 py-2 rounded-md">활동사진</a>
<a href="#" class="hover:bg-blue-700 px-3 py-2 rounded-md">결과물</a>
</div>
<!-- Mobile Menu Button -->
Expand Down
5 changes: 4 additions & 1 deletion homePage/post/views.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from .models import Post
from picture.models import Picture


# Create your views here.
def index(request):
posts = Post.objects.all().order_by('-pk')[:10]
pictures = Picture.objects.all()

return render(
request,
'post/index.html',
{
'posts': posts
'posts': posts,
'picture': pictures
},
)

Expand Down

0 comments on commit 1c8849d

Please sign in to comment.