Skip to content

Commit

Permalink
Add tags to CfP form
Browse files Browse the repository at this point in the history
  • Loading branch information
SamLR committed Dec 24, 2023
1 parent 4df79d8 commit d15eb87
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/cfp_review/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
EVENT_SPACING,
FavouriteProposal,
)
from models.cfp_tag import Tag
from models.user import User
from models.purchase import Ticket
from .forms import (
Expand Down Expand Up @@ -343,6 +344,7 @@ def log_and_close(msg, next_page, proposal_id=None):
form.state.data = prop.state
form.title.data = prop.title
form.description.data = prop.description
form.tags.data = Tag.serialise_tags(prop.tags)
form.requirements.data = prop.requirements
form.length.data = prop.length
form.notice_required.data = prop.notice_required
Expand Down
3 changes: 3 additions & 0 deletions apps/cfp_review/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from wtforms.validators import DataRequired, Optional, NumberRange, ValidationError

from models.cfp import Venue, ORDERED_STATES
from models.cfp_tag import Tag
from ..common.forms import Form, HiddenIntegerField, EmailField

from dateutil.parser import parse as parse_date
Expand All @@ -24,6 +25,7 @@ class UpdateProposalForm(Form):
state = SelectField("State", choices=[(s, s) for s in ORDERED_STATES])
title = StringField("Title", [DataRequired()])
description = TextAreaField("Description", [DataRequired()])
tags = StringField("Tags")
requirements = TextAreaField("Requirements")
length = StringField("Length")
notice_required = SelectField(
Expand Down Expand Up @@ -94,6 +96,7 @@ def validate_allowed_times(self, field):
def update_proposal(self, proposal):
proposal.title = self.title.data
proposal.description = self.description.data
proposal.tags = Tag.parse_serialised_tags(self.tags.data)
proposal.requirements = self.requirements.data
proposal.length = self.length.data
proposal.notice_required = self.notice_required.data
Expand Down
1 change: 1 addition & 0 deletions templates/cfp_review/update_proposal.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h2>{{proposal.published_title or proposal.title}}<br>
{{ render_dl_field(form.state) }}
{{ render_dl_field(form.title) }}
{{ render_dl_field(form.description, rows=8) }}
{{ render_dl_field(form.tags) }}
{{ render_dl_field(form.requirements, rows=3) }}
{{ render_dl_field(form.length) }}
{{ render_dl_field(form.notice_required) }}
Expand Down

0 comments on commit d15eb87

Please sign in to comment.