Skip to content

Commit

Permalink
update print format for admin title that show html code.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebamus committed Sep 3, 2024
1 parent 7f272f8 commit 097b2ba
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
Binary file modified config/locale/ko/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion config/locale/ko/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ msgid ""
" "
msgstr ""
"\n"
" <p>입니다.</p>\n"
" <p>경력을 가지고 입습니다.</p>\n"
" <p>이 사이트는 <strong>'devspoon-portfolio-blog' 저장소</"
"strong>의 django 기반 오픈 소스로 만들어졌습니다.</p>\n"
" <p><strong><i>개인 포트폴리오, 블로그, 커뮤니티</i></"
Expand Down
4 changes: 2 additions & 2 deletions custom_middlewares/admin/home_statistics_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def changelist_view(self, request, extra_context=None):
ConnectionMethodStats.objects.filter(
created_at__day=timezone.now().date().day
)
.annotate()
# .annotate()
.values("win", "mac", "iph", "android", "oth")
)

Expand All @@ -46,7 +46,7 @@ def changelist_view(self, request, extra_context=None):
ConnectionHardwareStats.objects.filter(
created_at__day=timezone.now().date().day
)
.annotate()
# .annotate()
.values("mobile", "tablet", "pc", "bot")
)

Expand Down
1 change: 0 additions & 1 deletion custom_middlewares/common/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self, get_response):

def stats(self, os_info):
today = timezone.now().date()
print("today : ", today)
with transaction.atomic():
# 오늘 날짜의 통계 가져오기 (잠금)
(
Expand Down
14 changes: 11 additions & 3 deletions portfolio/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.utils.decorators import method_decorator
from django.utils.safestring import mark_safe
from django_summernote.admin import SummernoteModelAdmin

from django.utils.html import format_html
from blog.models.blog import ProjectPost
from common.components.admin.admin_components import AdminCacheClean
from common.decorators.cache import index_cache_clean
Expand Down Expand Up @@ -162,14 +162,14 @@ class WorkExperienceAdmin(AdminCacheClean, SummernoteModelAdmin):

list_display = [
"id",
"title",
"get_cleaned_title",
"role",
"color",
"sort_num",
"language",
"project_start_date",
]
list_display_links = ["id", "title", "role"]
list_display_links = ["id", "get_cleaned_title", "role"]
list_editable = (
"color",
"sort_num",
Expand All @@ -191,6 +191,14 @@ def get_actions(self, request):
del actions["delete_selected"]
return actions

def get_cleaned_title(self, obj):
# HTML 태그를 제거하고 텍스트만 반환
return format_html(
obj.title
) # 또는 obj.title.strip()으로 HTML 제거 가능, 만약 HTML 태그를 제거하고 싶다면, strip_tags를 사용

get_cleaned_title.short_description = "Title" # Admin에서 표시될 제목


class EducationStudyAdmin(AdminCacheClean, SummernoteModelAdmin):
cache_prefix = "portfolio"
Expand Down
6 changes: 5 additions & 1 deletion templates/base/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,21 @@ <h4>{% trans "Support" %}</h4>
<div class="footer-widget">
<h4>{% trans "Contact Us" %}</h4>
<ul>
{% if site_info.office_phone_number %}
<li>
<span>Phone:</span>
<a href="tel:{{site_info.country_code}}-{{site_info.office_phone_number}}">{{site_info.country_code}}-{{site_info.office_phone_number}}</a>
</li>
{% endif %}
{% if site_info.office_email %}
<li>
<span>Email:</span>
<a href="mailto:{{site_info.office_email}}" >{{site_info.office_email}}</a>
</li>
{% endif %}
<li>
<span>Copyright:</span>
from 2022-Now
from 2022.4-2024.8
</li>
</ul>
</div>
Expand Down
4 changes: 4 additions & 0 deletions templates/base/mobile_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
</div>
<div class="header_contact_info">
<ul class="d-flex">
{% if site_info.office_phone_number %}
<li class="text-white"> <i class="lni lni-phone"></i> <a href="tel:{{site_info.country_code}}-{{site_info.office_phone_number}}">{{site_info.country_code}}-{{site_info.office_phone_number}}</a></li>
{% endif %}
{% if site_info.office_email %}
<li class="text-white"> <i class="icofont-ui-email"></i> <a href="mailto:{{site_info.office_email}}" >{{site_info.office_email}}</a></li>
{% endif %}
</ul>
</div>
<div class="header_social d-flex">
Expand Down

0 comments on commit 097b2ba

Please sign in to comment.