Skip to content

Commit

Permalink
Merge pull request #300 from smu-nity/feature/298
Browse files Browse the repository at this point in the history
feat: 융합경영학과 졸업요건 수정 (#298)
  • Loading branch information
hyunmin0317 authored Jan 30, 2024
2 parents 92faae4 + 8fd1d7b commit 0583c0f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
2 changes: 2 additions & 0 deletions accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def subjects_culture_s(self):
context = {'cnt': cnt, 'cultures': cultures, 'subjects': subs}
return context

def credit_major_s(self):
return self.year.major_s if self.department.pk != 28 else 60

class LoginHistory(models.Model):
user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) # 장고 유저
Expand Down
66 changes: 33 additions & 33 deletions templates/core/result.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,35 +82,37 @@
</div>
</div>
<!-- 전공심화 -->
<div class="resultbox">
<div class="result_name">
<i class="fa-solid fa-pen"></i> &nbsp;전공심화
<div class="recommend" onclick="info_in(this)" open="modal-major-i">추천 과목 보기</div>
</div>
<div class="result_container">
<div class="result_content">
<div class="result_content_number">{{ profile.year.major_i }}</div>
<div class="result_content_info">총 기준 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count" data-count="{{ subjects_major_i|zero_filter }}" style="border-right: 2px solid lightgray;"></div>
<div class="result_content_info">총 이수 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count rednumber" data-count="{{ profile.year.major_i|sub:subjects_major_i }}"></div>
<div class="result_content_info" >필요 학점</div>
{% if profile.department.pk != 28 %}
<div class="resultbox">
<div class="result_name">
<i class="fa-solid fa-pen"></i> &nbsp;전공심화
<div class="recommend" onclick="info_in(this)" open="modal-major-i">추천 과목 보기</div>
</div>
<div class="result_content">
<div class="pie-chart">
<div class="pie-chart-color pie-major-i">
<div class="pie-chart-inner">
<span class="center percent" percent="{{ subjects_major_i|div:profile.year.major_i }}"></span>
<div class="result_container">
<div class="result_content">
<div class="result_content_number">{{ profile.year.major_i }}</div>
<div class="result_content_info">총 기준 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count" data-count="{{ subjects_major_i|zero_filter }}" style="border-right: 2px solid lightgray;"></div>
<div class="result_content_info">총 이수 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count rednumber" data-count="{{ profile.year.major_i|sub:subjects_major_i }}"></div>
<div class="result_content_info" >필요 학점</div>
</div>
<div class="result_content">
<div class="pie-chart">
<div class="pie-chart-color pie-major-i">
<div class="pie-chart-inner">
<span class="center percent" percent="{{ subjects_major_i|div:profile.year.major_i }}"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<!-- 전공선택 -->
<div class="resultbox">
<div class="result_name">
Expand All @@ -119,22 +121,22 @@
</div>
<div class="result_container">
<div class="result_content">
<div class="result_content_number">{{ profile.year.major_s }}</div>
<div class="result_content_number">{{ profile.credit_major_s }}</div>
<div class="result_content_info test">총 기준 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count" style="border-right: 2px solid lightgray;" data-count="{{ subjects_major_s|zero_filter }}" ></div>
<div class="result_content_info">총 이수 학점</div>
</div>
<div class="result_content">
<div class="result_content_number count rednumber" data-count="{{ profile.year.major_s|sub:subjects_major_s|zero_filter }}"></div>
<div class="result_content_number count rednumber" data-count="{{ profile.credit_major_s|sub:subjects_major_s|zero_filter }}"></div>
<div class="result_content_info">필요 학점</div>
</div>
<div class="result_content">
<div class="pie-chart">
<div class="pie-chart-color pie-major-s">
<div class="pie-chart-inner">
<span class="center percent" percent = "{{ subjects_major_s|div:profile.year.major_s }}"></span>
<span class="center percent" percent = "{{ subjects_major_s|div:profile.credit_major_s }}"></span>
</div>
</div>
</div>
Expand Down Expand Up @@ -232,7 +234,7 @@
</div>

<!-- 균형교양 -->
{% if profile.department.name != "융합경영학과" %}
{% if profile.department.pk != 28 %}
<div class="resultbox">
<div class="result_name">
<i class="fa-solid fa-book-journal-whills"></i> &nbsp;균형교양
Expand Down Expand Up @@ -355,10 +357,10 @@
</div>
{% endif %}
<div class="partdiv">
{% if subjects_major_s|div:profile.year.major_s == 100 %}
{% if subjects_major_s|div:profile.credit_major_s == 100 %}
<span style="color:#17a55e">기준 학점을 만족했습니다.</span>
{% else %}
<span style="color:#d32f2f">{{ profile.year.major_s|sub:subjects_major_s }} 학점이 부족합니다.</span>
<span style="color:#d32f2f">{{ profile.credit_major_s|sub:subjects_major_s }} 학점이 부족합니다.</span>
{% endif %}
</div>
</div>
Expand Down Expand Up @@ -480,8 +482,7 @@
</div>
</div>
<!-- 균형교양 -->
{% if profile.department.name != "융합경영학과" %}
<div id="modal-culture-s" class="modal">
<div id="modal-culture-s" class="modal">
<div class="update_modal_content modal-scroll" style="max-height: 75%;">
<span class="close" id="close-culture-s" onclick="modal_close(this)" close="modal-culture-s">&times;</span>
<br>
Expand Down Expand Up @@ -543,7 +544,6 @@
</div>
</div>
</div>
{% endif %}
</div>
{% endblock %}

Expand All @@ -554,7 +554,7 @@
draw(Number({{ subjects_all|div:profile.year.all }}), '.pie-all', '#6188E8');
draw(Number({{ subjects_all|div:profile.year.all }}), '.pie-all-mobile', '#6188E8');
draw(Number({{ subjects_major_i|div:profile.year.major_i }}), '.pie-major-i', '#6188E8');
draw(Number({{ subjects_major_s|div:profile.year.major_s }}), '.pie-major-s', '#6188E8');
draw(Number({{ subjects_major_s|div:profile.credit_major_s }}), '.pie-major-s', '#6188E8');
draw(Number({{ subjects_culture|div:profile.year.culture }}), '.pie-culture', '#6188E8');
draw(Number({{ culture_cnt|div:profile.year.culture_cnt }}), '.pie-culture-b', '#6188E8');
draw(Number({{ subjects_culture_e.cnt|div:2 }}), '.pie-culture-e', '#6188E8');
Expand Down

0 comments on commit 0583c0f

Please sign in to comment.