-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. 추천 로직 작동 3. 음식 데이터베이스 스키마 변경
- Loading branch information
Showing
6 changed files
with
133 additions
and
40 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
33 changes: 33 additions & 0 deletions
33
diet/migrations/0004_remove_food_created_at_remove_food_deleted_and_more.py
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,33 @@ | ||
# Generated by Django 5.0 on 2024-02-16 09:02 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("diet", "0003_remove_detailofdiet_image_x_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="food", | ||
name="created_at", | ||
), | ||
migrations.RemoveField( | ||
model_name="food", | ||
name="deleted", | ||
), | ||
migrations.RemoveField( | ||
model_name="food", | ||
name="deleted_at", | ||
), | ||
migrations.RemoveField( | ||
model_name="food", | ||
name="image_path", | ||
), | ||
migrations.RemoveField( | ||
model_name="food", | ||
name="updated_at", | ||
), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// .expanded 클래스를 가진 모든 요소에 대한 클릭 이벤트 리스너 추가 | ||
document.querySelectorAll('.expand').forEach(function(expandedElement) { | ||
expandedElement.addEventListener('click', function() { | ||
var nutritionElement = expandedElement.nextElementSibling; | ||
|
||
// this의 자식 요소를 선택한다. | ||
var icon = this.querySelector('.bi'); | ||
|
||
|
||
if (this.classList.contains('expanded')) { | ||
// expanded 클래스 삭제 | ||
this.classList.remove('expanded'); | ||
// icon의 클래스를 변경 | ||
icon.classList.replace('bi-chevron-up', 'bi-chevron-down'); | ||
|
||
while(nutritionElement){ | ||
// nutritionElement를 안보이게 변경 | ||
nutritionElement.classList.replace('d-flex','d-none'); | ||
break; | ||
nutritionElement = nutritionElement.nextElementSibling; | ||
} | ||
} else { | ||
// 클릭된 .expanded 클래스 추가 | ||
this.classList.add('expanded'); | ||
// 아이콘 변경 | ||
icon.classList.replace('bi-chevron-down', 'bi-chevron-up'); | ||
|
||
while (nutritionElement) { | ||
nutritionElement.classList.replace('d-none', 'd-flex'); | ||
break; // .nutrition 클래스를 가진 첫 번째 요소를 숨기고 반복 종료 | ||
nutritionElement = nutritionElement.nextElementSibling; | ||
} | ||
} | ||
|
||
|
||
}); | ||
}); | ||
|
||
function pageReload() { | ||
// 현재 페이지 새로고침 | ||
location.reload(); | ||
} |
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