Skip to content

Commit 5d92868

Browse files
authored
후원사 신청하기 페이지 구현 (#39)
1 parent e8dd000 commit 5d92868

File tree

21 files changed

+711
-84
lines changed

21 files changed

+711
-84
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@ db.sqlite3
113113

114114
collected_static/
115115
env.sh
116+
media/
116117

pyconkr/locale/en/LC_MESSAGES/django.po

+6-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2020-03-15 19:22+0900\n"
10+
"POT-Creation-Date: 2020-03-24 16:32+0900\n"
1111
"PO-Revision-Date: 2017-05-13 01:45+0900\n"
1212
"Last-Translator: [email protected]\n"
1313
"Language-Team: \n"
@@ -129,7 +129,7 @@ msgstr "Describe about your contribution activity in this project."
129129
msgid "Brief"
130130
msgstr "Brief"
131131

132-
#: program/forms.py:154 pyconkr/templates/pyconkr/proposal_detail.html:21
132+
#: program/forms.py:154 pyconkr/templates/pyconkr/proposal_detail.html:23
133133
#: pyconkr/templates/pyconkr/sprintproposal_detail.html:43
134134
#: pyconkr/templates/pyconkr/tutorialproposal_detail.html:68
135135
msgid "Detailed description"
@@ -224,15 +224,15 @@ msgstr "Update tutorial"
224224
msgid "Tutorial proposal successfully created."
225225
msgstr "Tutorial proposal successfully created."
226226

227-
#: program/views.py:374 program/views.py:389
227+
#: program/views.py:374 program/views.py:396
228228
msgid "Proposal"
229229
msgstr "Proposal"
230230

231-
#: program/views.py:382
231+
#: program/views.py:383
232232
msgid "Proposal successfully updated."
233233
msgstr "Proposal successfully updated."
234234

235-
#: program/views.py:400
235+
#: program/views.py:407
236236
msgid "Proposal successfully created."
237237
msgstr "Proposal successfully created."
238238

@@ -367,8 +367,6 @@ msgid "Video Subtitle"
367367
msgstr ""
368368

369369
#: pyconkr/context_processors.py:95 pyconkr/templates/index.html:94
370-
#: pyconkr/templates/pyconkr/sponsor_detail.html:4
371-
#: pyconkr/templates/pyconkr/sponsor_detail.html:5
372370
msgid "Sponsor"
373371
msgstr "Sponsor"
374372

@@ -812,7 +810,7 @@ msgstr "Submit preferences"
812810
msgid "Up to 5 items can be selected."
813811
msgstr "Up to 5 items can be selected."
814812

815-
#: pyconkr/templates/pyconkr/proposal_detail.html:26
813+
#: pyconkr/templates/pyconkr/proposal_detail.html:28
816814
msgid "Comment to reviewers"
817815
msgstr "Comment to reviewers (optional)"
818816

pyconkr/locale/ko/LC_MESSAGES/django.po

+6-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2020-03-15 19:22+0900\n"
10+
"POT-Creation-Date: 2020-03-24 16:32+0900\n"
1111
"PO-Revision-Date: 2017-05-13 01:46+0900\n"
1212
"Last-Translator: [email protected]\n"
1313
"Language-Team: \n"
@@ -130,7 +130,7 @@ msgstr "이 프로젝트에서의 자신의 기여 활동 내용"
130130
msgid "Brief"
131131
msgstr "간단한 설명"
132132

133-
#: program/forms.py:154 pyconkr/templates/pyconkr/proposal_detail.html:21
133+
#: program/forms.py:154 pyconkr/templates/pyconkr/proposal_detail.html:23
134134
#: pyconkr/templates/pyconkr/sprintproposal_detail.html:43
135135
#: pyconkr/templates/pyconkr/tutorialproposal_detail.html:68
136136
msgid "Detailed description"
@@ -225,15 +225,15 @@ msgstr "튜토리얼 갱신"
225225
msgid "Tutorial proposal successfully created."
226226
msgstr "튜토리얼 제안을 제출하였습니다."
227227

228-
#: program/views.py:374 program/views.py:389
228+
#: program/views.py:374 program/views.py:396
229229
msgid "Proposal"
230230
msgstr "발표안"
231231

232-
#: program/views.py:382
232+
#: program/views.py:383
233233
msgid "Proposal successfully updated."
234234
msgstr "발표안이 수정되었습니다."
235235

236-
#: program/views.py:400
236+
#: program/views.py:407
237237
msgid "Proposal successfully created."
238238
msgstr "발표안을 제출하였습니다."
239239

@@ -368,8 +368,6 @@ msgid "Video Subtitle"
368368
msgstr "영상 자막"
369369

370370
#: pyconkr/context_processors.py:95 pyconkr/templates/index.html:94
371-
#: pyconkr/templates/pyconkr/sponsor_detail.html:4
372-
#: pyconkr/templates/pyconkr/sponsor_detail.html:5
373371
msgid "Sponsor"
374372
msgstr "후원사"
375373

@@ -795,7 +793,7 @@ msgstr "선호도 등록하기"
795793
msgid "Up to 5 items can be selected."
796794
msgstr "최대 5개까지만 선택하실 수 있습니다."
797795

798-
#: pyconkr/templates/pyconkr/proposal_detail.html:26
796+
#: pyconkr/templates/pyconkr/proposal_detail.html:28
799797
msgid "Comment to reviewers"
800798
msgstr "검토자에게 알리고 싶은 말 (선택)"
801799

pyconkr/settings.py

+3
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,12 @@ def static_url(url):
297297
'IMP_INTL_API_SECRET': ('', '아임포트 해외용 API SECRET'),
298298
'SHOW_SLIDE_DATA': (False, 'Show slide data on schedule table and program detail'),
299299
'SLACK_CHANNEL': ('#bot-test', '홈페이지에서 파준위 슬랙으로 알림을 보낼 채널'),
300+
'CFP_OPEN': (datetime.datetime(2000, 1, 1), 'CFP 오픈'),
300301
'CFP_DEADLINE': (datetime.datetime(2000, 1, 1, tzinfo=KST), 'CFP 마감기간'),
301302
'OPEN_REVIEW_START': (datetime.datetime(2000, 1, 1, tzinfo=KST), '오픈 리뷰 시작 시점'),
302303
'OPEN_REVIEW_FINISH': (datetime.datetime(2000, 1, 1, tzinfo=KST), '오픈 리뷰 마감 시점'),
304+
'CFS_OPEN': (datetime.datetime(2000, 1, 1), '후원사 모집 오픈'),
305+
'CFS_DEADLINE': (datetime.datetime(2000, 1, 1), '후원사 모집 종료'),
303306
}
304307

305308
# For supporting i18n of django modules

pyconkr/templates/simple.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends "base.html" %}
2+
{% load i18n %}
3+
{% block title %}
4+
<h1>
5+
{{ title }}
6+
</h1>
7+
{% endblock %}
8+
{% block content %}
9+
<p>
10+
{{ content }}
11+
</p>
12+
{% endblock %}

registration/locale/en/LC_MESSAGES/django.po

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5-
#
6-
#, fuzzy
75
msgid ""
86
msgstr ""
97
"Project-Id-Version: PACKAGE VERSION\n"
108
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-03-15 19:22+0900\n"
9+
"POT-Creation-Date: 2020-03-24 16:32+0900\n"
1210
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1311
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1412
"Language-Team: LANGUAGE <[email protected]>\n"

registration/locale/ko/LC_MESSAGES/django.po

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2020-03-15 19:22+0900\n"
10+
"POT-Creation-Date: 2020-03-24 16:32+0900\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: woojing seok <[email protected]>\n"
1313
"Language-Team: LANGUAGE <[email protected]>\n"

sponsor/forms.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
from django import forms
2+
from django_summernote.widgets import SummernoteInplaceWidget
3+
from django.utils.translation import ugettext as _
4+
from crispy_forms.helper import FormHelper
5+
from crispy_forms.layout import Submit
6+
from .models import Sponsor, SponsorLevel
7+
8+
from django.forms import ModelChoiceField
9+
10+
11+
class SponsorLevelChoiceField(ModelChoiceField):
12+
def label_from_instance(self, obj):
13+
return f'{obj.name} ({obj.current_remaining_number}/{obj.limit})'
14+
15+
16+
class SponsorForm(forms.ModelForm):
17+
class Meta:
18+
model = Sponsor
19+
fields = ('level', 'logo_image', 'name_ko', 'name_en',
20+
'url', 'manager_name', 'manager_email',
21+
'business_registration_number', 'business_registration_file',
22+
'desc_ko', 'desc_en',
23+
'comment')
24+
25+
labels = {
26+
'level': _('후원사 등급'),
27+
'logo_image': _('로고 이미지'),
28+
'name_ko': _('후원사 이름(한글)'),
29+
'name_en': _('후원사 이름(영문)'),
30+
'url': _('후원사 홈페이지 주소'),
31+
'desc_ko': _('후원사 소개(한글)'),
32+
'desc_en': _('후원사 소개(영문)'),
33+
'manager_name': _('후원 담당자 이름'),
34+
'manager_email': _('후원 담당자 이메일'),
35+
'business_registration_number': _('후원사 사업자 등록 번호'),
36+
'business_registration_file': _('후원사 사업자 등록증'),
37+
'comment': _('추가로 문의할 점'),
38+
}
39+
40+
def __init__(self, *args, **kwargs):
41+
super(SponsorForm, self).__init__(*args, **kwargs)
42+
self.helper = FormHelper()
43+
self.helper.form_method = 'post'
44+
self.helper.add_input(Submit('save', _('Save')))
45+
self.helper.add_input(Submit('submit', _('Submit')))
46+
47+
self.fields['name_ko'].required = True
48+
self.fields['name_ko'].required = True
49+
self.fields['level'] = SponsorLevelChoiceField(
50+
queryset=SponsorLevel.objects.filter(visible=True))
51+
52+
def form_valid(self, form):
53+
if self.request.POST['submit'] == 'save':
54+
return super(SongEditView, self).form_valid(form)

0 commit comments

Comments
 (0)