Skip to content

Commit

Permalink
Merge pull request #338 from sparcs-kaist/develop
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
injoonH authored Aug 28, 2022
2 parents 03806de + 281e714 commit 48c8fe8
Show file tree
Hide file tree
Showing 48 changed files with 1,895 additions and 311 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ superuser:
flush:
mysql -u root -e 'DROP DATABASE new_ara;'

flush_test:
mysql -u root -e 'DROP DATABASE test_new_ara;'

reset: flush init

run:
Expand Down
26 changes: 22 additions & 4 deletions apps/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
BestSearch,
Report,
Comment,
CommunicationArticle
)


Expand Down Expand Up @@ -86,7 +87,7 @@ class FAQAdmin(MetaDataModelAdmin):
@admin.register(Article)
class ArticleAdmin(MetaDataModelAdmin):
list_filter = (
'is_anonymous',
'name_type',
'is_content_sexual',
'is_content_social',
'parent_topic',
Expand All @@ -98,7 +99,7 @@ class ArticleAdmin(MetaDataModelAdmin):
'hit_count',
'positive_vote_count',
'negative_vote_count',
'is_anonymous',
'name_type',
'is_content_sexual',
'is_content_social',
'report_count',
Expand Down Expand Up @@ -128,14 +129,14 @@ def restore_hidden_articles(self, request, queryset):
@admin.register(Comment)
class CommentAdmin(MetaDataModelAdmin):
list_filter = (
'is_anonymous',
'name_type',
HiddenContentListFilter,
)
list_display = (
'content',
'positive_vote_count',
'negative_vote_count',
'is_anonymous',
'name_type',
'report_count',
'hidden_at',
)
Expand Down Expand Up @@ -224,3 +225,20 @@ class ReportAdmin(MetaDataModelAdmin):
'type',
'content',
)


@admin.register(CommunicationArticle)
class CommunicationArticleAdmin(MetaDataModelAdmin):
list_filter = (
'response_deadline',
'answered_at',
)
list_display = (
'article',
'get_status_string',
'response_deadline',
'answered_at',
)
raw_id_fields = (
'article',
)
6 changes: 5 additions & 1 deletion apps/core/filters/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Meta:
'content_text': [
'contains',
],
'is_anonymous': [
'name_type': [
'exact',
],
'is_content_sexual': [
Expand Down Expand Up @@ -47,6 +47,10 @@ class Meta:
'in',
'exact',
],
'communication_article__school_response_status': [
'exact',
'lt'
]
}

main_search__contains = filters.CharFilter(
Expand Down
2 changes: 1 addition & 1 deletion apps/core/filters/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Meta:
'parent_comment': [
'exact',
],
'is_anonymous': [
'name_type': [
'exact',
],
'created_by': [
Expand Down
4 changes: 2 additions & 2 deletions apps/core/filters/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ class Meta:
}

is_read = filters.BooleanFilter(
name='is_read',
field_name='is_read',
label='조회 여부',
method='get_is_read',
)

@staticmethod
def get_is_read(queryset, name, value):
def get_is_read(queryset, field_name, value):
return queryset.filter(
notification_read_log_set__is_read=value,
)
18 changes: 18 additions & 0 deletions apps/core/migrations/0033_board_group_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.9 on 2022-02-26 11:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0032_board_is_anonymous'),
]

operations = [
migrations.AddField(
model_name='board',
name='group_id',
field=models.IntegerField(default=1, verbose_name='그룹 ID'),
),
]
18 changes: 18 additions & 0 deletions apps/core/migrations/0034_board_banner_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2022-03-09 14:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0033_board_group_id'),
]

operations = [
migrations.AddField(
model_name='board',
name='banner_image',
field=models.ImageField(blank=True, default=None, null=True, upload_to='board/banner_images', verbose_name='게시판 배너 이미지'),
),
]
23 changes: 23 additions & 0 deletions apps/core/migrations/0035_board_banner_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2 on 2022-03-09 14:42

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0034_board_banner_image'),
]

operations = [
migrations.AddField(
model_name='board',
name='en_banner_description',
field=models.TextField(blank=True, default=None, null=True, verbose_name='게시판 배너에 삽입되는 영문 소개'),
),
migrations.AddField(
model_name='board',
name='ko_banner_description',
field=models.TextField(blank=True, default=None, null=True, verbose_name='게시판 배너에 삽입되는 국문 소개'),
),
]
18 changes: 18 additions & 0 deletions apps/core/migrations/0036_alter_board_banner_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2022-03-09 14:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0035_board_banner_description'),
]

operations = [
migrations.AlterField(
model_name='board',
name='banner_image',
field=models.ImageField(default='default_banner.png', upload_to='board_banner_images', verbose_name='게시판 배너 이미지'),
),
]
18 changes: 18 additions & 0 deletions apps/core/migrations/0037_board_banner_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.9 on 2022-03-14 15:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0036_alter_board_banner_image'),
]

operations = [
migrations.AddField(
model_name='board',
name='banner_url',
field=models.TextField(blank=True, default=None, null=True, verbose_name='게시판 배너를 클릭 시에 이동하는 링크'),
),
]
44 changes: 44 additions & 0 deletions apps/core/migrations/0038_rename_is_anonymous_to_name_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 3.2.9 on 2022-04-04 13:49

import apps.core.models.board
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0037_board_banner_url'),
]

operations = [
migrations.RenameField(
model_name='article',
old_name='is_anonymous',
new_name='name_type',
),
migrations.AlterField(
model_name='article',
name='name_type',
field=models.SmallIntegerField(default=apps.core.models.board.BoardNameType['REGULAR'], verbose_name='익명 혹은 실명 여부'),
),
migrations.RenameField(
model_name='board',
old_name='is_anonymous',
new_name='name_type',
),
migrations.AlterField(
model_name='board',
name='name_type',
field=models.SmallIntegerField(db_index=True, default=apps.core.models.board.BoardNameType['REGULAR'], help_text='게시판의 글과 댓글들이 익명 혹은 실명이도록 합니다.', verbose_name='익명/실명 게시판'),
),
migrations.RenameField(
model_name='comment',
old_name='is_anonymous',
new_name='name_type',
),
migrations.AlterField(
model_name='comment',
name='name_type',
field=models.SmallIntegerField(default=apps.core.models.board.BoardNameType['REGULAR'], verbose_name='익명 혹은 실명'),
),
]
43 changes: 43 additions & 0 deletions apps/core/migrations/0039_add_communication_article.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 3.2.9 on 2022-05-05 16:34

import apps.core.models.communication_article
import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('core', '0038_rename_is_anonymous_to_name_type'),
]

operations = [
migrations.AddField(
model_name='board',
name='is_school_communication',
field=models.BooleanField(db_index=True, default=False, help_text='학교 소통 게시판 글임을 표시', verbose_name='학교와의 소통 게시판'),
),
migrations.CreateModel(
name='CommunicationArticle',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='생성 시간')),
('updated_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='수정 시간')),
('deleted_at', models.DateTimeField(db_index=True, default=datetime.datetime(1, 1, 1, 0, 0, tzinfo=utc), verbose_name='삭제 시간')),
('response_deadline', models.DateTimeField(default=datetime.datetime(1, 1, 1, 0, 0, tzinfo=utc), verbose_name='답변 요청 기한')),
('confirmed_by_school_at', models.DateTimeField(default=datetime.datetime(1, 1, 1, 0, 0, tzinfo=utc), verbose_name='학교측 문의 확인 시각')),
('answered_at', models.DateTimeField(default=datetime.datetime(1, 1, 1, 0, 0, tzinfo=utc), verbose_name='학교측 답변을 받은 시각')),
('school_response_status', models.SmallIntegerField(default=apps.core.models.communication_article.SchoolResponseStatus['BEFORE_UPVOTE_THRESHOLD'], verbose_name='답변 진행 상황')),
('article', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='communication_article', to='core.article', verbose_name='게시물')),
],
options={
'verbose_name': '소통 게시물',
'verbose_name_plural': '소통 게시물 목록',
'ordering': ('-created_at',),
'abstract': False,
},
),
]
28 changes: 28 additions & 0 deletions apps/core/migrations/0040_alter_communication_article_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 3.2.9 on 2022-05-05 17:37

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('core', '0039_add_communication_article'),
]

operations = [
migrations.RemoveField(
model_name='communicationarticle',
name='id',
),
migrations.AlterField(
model_name='board',
name='access_mask',
field=models.IntegerField(default=222, verbose_name='접근 권한 값'),
),
migrations.AlterField(
model_name='communicationarticle',
name='article',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='communication_article', serialize=False, to='core.article', verbose_name='게시물'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.9 on 2022-05-12 16:15

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0040_alter_communication_article_field'),
]

operations = [
migrations.RemoveField(
model_name='communicationarticle',
name='confirmed_by_school_at',
),
]
27 changes: 27 additions & 0 deletions apps/core/migrations/0042_add_read_write_access_masks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.2.9 on 2022-05-26 12:53

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0041_remove_communicationarticle_confirmed_by_school_at'),
]

operations = [
migrations.RemoveField(
model_name='board',
name='access_mask',
),
migrations.AddField(
model_name='board',
name='read_access_mask',
field=models.SmallIntegerField(default=222, verbose_name='읽기 권한'),
),
migrations.AddField(
model_name='board',
name='write_access_mask',
field=models.SmallIntegerField(default=218, verbose_name='쓰기 권한'),
),
]
Loading

0 comments on commit 48c8fe8

Please sign in to comment.