# Path: conference/cfp/models.py
# class Submission(AbstractSubmission):
#     proposal_why = models.TextField(
#         _('Motivation'),
#         help_text=_('Explain here why your proposal is important for the attendees and what they will get from it.')
#     )
#     proposal_requirements = models.TextField(
#         _('Requirements'), blank=False, default='',
#     )
#     mentor_wanted = models.BooleanField(
#         _('Mentor'), default=False,
#         help_text=_('More experienced speakers can help you reviewing your talk, '
#                     'practicing, and getting ready for the presentation')
#     )
#     mentor_offer = models.BooleanField(
#         _('Mentor - Offer'), default=False,
#         help_text=_('Are you an experienced speaker and are you willing to help other speakers? '
#                     'Select this and we will get in contact with you!')
#     )
#     pycon = models.BooleanField(
#         _('PyCon'), default=False,
#         help_text=_('We will share your proposal with the PyCon Italia Team and they will '
#                     'evaluate independently your proposal.')
#     )
# 
#     class Meta:
#         verbose_name = _('talk submission')
#         verbose_name_plural = _('talk submissions')
# 
# class WorkshopSubmission(AbstractSubmission):
#     TWO_HOURS = '2'
#     DURATIONS = (
#         (TWO_HOURS, _('2 Hours')),
#     )
#     workshop_duration = models.CharField(
#         _('Duration'), choices=DURATIONS, max_length=10,
#     )
# 
#     class Meta:
#         verbose_name = _('workshop submission')
#         verbose_name_plural = _('workshop submissions')


from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from import_export import resources
from import_export.admin import ExportActionModelAdmin
from .models import Submission, WorkshopSubmission
set_submission_as_selected.short_description = _("Set submission as 'Selected'")  # NOQA


@admin.register(Submission)
class TalkSubmissionAdmin(ExportActionModelAdmin):
    list_display = (
        'author', 'proposal_title', 'selected', 'pycon', 'created_at',
        'mentor_wanted', 'mentor_offer'
    )
    list_filter = ('selected', 'pycon')
    search_fields = ('author', 'proposal_title')
    actions = [set_submission_as_selected]


class TalkSubmissionData(resources.ModelResource):
    class Meta:
        model = Submission


@admin.register(WorkshopSubmission)
class WorkshopSubmissionAdmin(ExportActionModelAdmin):
    list_display = (
        'author', 'proposal_title', 'selected', 'workshop_duration', 'created_at'
    )
    list_filter = ('selected', 'proposal_audience')
    search_fields = ('author', 'proposal_title')


class WorkshopSubmissionData(resources.ModelResource):
    class Meta:

# Path: conference/cfp/models.py
# class Submission(AbstractSubmission):
#     proposal_why = models.TextField(
#         _('Motivation'),
#         help_text=_('Explain here why your proposal is important for the attendees and what they will get from it.')
#     )
#     proposal_requirements = models.TextField(
#         _('Requirements'), blank=False, default='',
#     )
#     mentor_wanted = models.BooleanField(
#         _('Mentor'), default=False,
#         help_text=_('More experienced speakers can help you reviewing your talk, '
#                     'practicing, and getting ready for the presentation')
#     )
#     mentor_offer = models.BooleanField(
#         _('Mentor - Offer'), default=False,
#         help_text=_('Are you an experienced speaker and are you willing to help other speakers? '
#                     'Select this and we will get in contact with you!')
#     )
#     pycon = models.BooleanField(
#         _('PyCon'), default=False,
#         help_text=_('We will share your proposal with the PyCon Italia Team and they will '
#                     'evaluate independently your proposal.')
#     )
# 
#     class Meta:
#         verbose_name = _('talk submission')
#         verbose_name_plural = _('talk submissions')
# 
# class WorkshopSubmission(AbstractSubmission):
#     TWO_HOURS = '2'
#     DURATIONS = (
#         (TWO_HOURS, _('2 Hours')),
#     )
#     workshop_duration = models.CharField(
#         _('Duration'), choices=DURATIONS, max_length=10,
#     )
# 
#     class Meta:
#         verbose_name = _('workshop submission')
#         verbose_name_plural = _('workshop submissions')


# Path: conference/cfp/admin.py
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from import_export import resources
from import_export.admin import ExportActionModelAdmin
from .models import Submission, WorkshopSubmission

set_submission_as_selected.short_description = _("Set submission as 'Selected'")  # NOQA


@admin.register(Submission)
class TalkSubmissionAdmin(ExportActionModelAdmin):
    list_display = (
        'author', 'proposal_title', 'selected', 'pycon', 'created_at',
        'mentor_wanted', 'mentor_offer'
    )
    list_filter = ('selected', 'pycon')
    search_fields = ('author', 'proposal_title')
    actions = [set_submission_as_selected]


class TalkSubmissionData(resources.ModelResource):
    class Meta:
        model = Submission


@admin.register(WorkshopSubmission)
class WorkshopSubmissionAdmin(ExportActionModelAdmin):
    list_display = (
        'author', 'proposal_title', 'selected', 'workshop_duration', 'created_at'
    )
    list_filter = ('selected', 'proposal_audience')
    search_fields = ('author', 'proposal_title')


class WorkshopSubmissionData(resources.ModelResource):
    class Meta:

        model = WorkshopSubmission