diff --git a/funnel/forms/proposal.py b/funnel/forms/proposal.py index 4b562da56..3690e1f2a 100644 --- a/funnel/forms/proposal.py +++ b/funnel/forms/proposal.py @@ -79,10 +79,10 @@ class ProposalForm(forms.Form): (0, __(u"I’m proposing a topic for someone to speak on"))]) title = forms.StringField(__("Title"), validators=[forms.validators.DataRequired()], description=__("The title of your session")) - objective = forms.MarkdownField(__("Objective"), validators=[forms.validators.DataRequired()], - description=__("What is the expected benefit for someone attending this?")) - description = forms.MarkdownField(__("Description"), validators=[forms.validators.DataRequired()], - description=__("A detailed description of the session")) + abstract = forms.MarkdownField(__("Abstract"), validators=[forms.validators.DataRequired()], + description=__("A brief description of your session with target audience and key takeaways")) + outline = forms.MarkdownField(__("Outline"), validators=[forms.validators.DataRequired()], + description=__("A detailed description of the session with the sequence of ideas to be presented")) requirements = forms.MarkdownField(__("Requirements"), description=__("For workshops, what must participants bring to the session?")) slides = forms.URLField(__("Slides"), @@ -110,18 +110,6 @@ class ProposalForm(forms.Form): formlabels = forms.FormField(forms.Form, __("Labels")) - def __init__(self, *args, **kwargs): - super(ProposalForm, self).__init__(*args, **kwargs) - project = kwargs.get('parent') - if project.proposal_part_a.get('title'): - self.objective.label.text = project.proposal_part_a.get('title') - if project.proposal_part_a.get('hint'): - self.objective.description = project.proposal_part_a.get('hint') - if project.proposal_part_b.get('title'): - self.description.label.text = project.proposal_part_b.get('title') - if project.proposal_part_b.get('hint'): - self.description.description = project.proposal_part_b.get('hint') - def set_queries(self): self.formlabels.form = proposal_label_form(project=self.edit_parent, proposal=self.edit_obj) diff --git a/funnel/models/project.py b/funnel/models/project.py index 9fe69c1f2..3f82fe7f2 100644 --- a/funnel/models/project.py +++ b/funnel/models/project.py @@ -126,7 +126,6 @@ class Project(UuidMixin, BaseScopedNameMixin, db.Model): parent_id = db.Column(None, db.ForeignKey('project.id', ondelete='SET NULL'), nullable=True) parent_project = db.relationship('Project', remote_side='Project.id', backref='subprojects') inherit_sections = db.Column(db.Boolean, default=True, nullable=False) - part_labels = db.Column('labels', JsonDict, nullable=False, server_default='{}') #: Featured project flag. This can only be set by website editors, not #: project editors or profile admins. @@ -357,40 +356,6 @@ def proposals_by_confirmation(self): def location_geonameid(self): return geonameid_from_location(self.location) if self.location else set() - @property - def proposal_part_a(self): - return self.part_labels.get('proposal', {}).get('part_a', {}) - - @property - def proposal_part_b(self): - return self.part_labels.get('proposal', {}).get('part_b', {}) - - def set_labels(self, value=None): - """ - Sets 'labels' with the provided JSON, else with a default configuration - for fields with customizable labels. - - Currently, the 'part_a' and 'part_b' fields in 'Proposal' - are allowed to be customized per project. - """ - if value and isinstance(value, dict): - self.part_labels = value - else: - self.part_labels = { - "proposal": { - "part_a": { - "title": "Abstract", - "hint": "Give us a brief description of your talk, key takeaways for the audience and the" - " intended audience." - }, - "part_b": { - "title": "Outline", - "hint": "Give us a break-up of your talk either in the form of draft slides, mind-map or" - " text description." - } - } - } - def permissions(self, user, inherited=None): perms = super(Project, self).permissions(user, inherited) perms.add('view') diff --git a/funnel/models/proposal.py b/funnel/models/proposal.py index bd6fc4660..4884d57d8 100644 --- a/funnel/models/proposal.py +++ b/funnel/models/proposal.py @@ -73,12 +73,8 @@ class Proposal(UuidMixin, BaseScopedIdNameMixin, CoordinatesMixin, db.Model): section_id = db.Column(None, db.ForeignKey('section.id'), nullable=True) section = db.relationship(Section, primaryjoin=section_id == Section.id, backref="proposals") - objective = MarkdownColumn('objective', nullable=True) - part_a = db.synonym('objective') - session_type = db.Column(db.Unicode(40), nullable=True) - technical_level = db.Column(db.Unicode(40), nullable=True) - description = MarkdownColumn('description', nullable=True) - part_b = db.synonym('description') + abstract = MarkdownColumn('abstract', nullable=True) + outline = MarkdownColumn('outline', nullable=True) requirements = MarkdownColumn('requirements', nullable=True) slides = db.Column(UrlType, nullable=True) preview_video = db.Column(UrlType, default=u'', nullable=True) @@ -107,8 +103,8 @@ class Proposal(UuidMixin, BaseScopedIdNameMixin, CoordinatesMixin, db.Model): __roles__ = { 'all': { 'read': { - 'title', 'speaker', 'speaking', 'bio', 'section', 'objective', 'session_type', - 'technical_level', 'description', 'requirements', 'slides', 'preview_video', 'links', 'location', + 'title', 'speaker', 'speaking', 'bio', 'section', 'abstract', + 'outline', 'requirements', 'slides', 'preview_video', 'links', 'location', 'latitude', 'longitude', 'coordinates' }, 'call': { diff --git a/funnel/templates/proposal.html.jinja2 b/funnel/templates/proposal.html.jinja2 index 225271000..3e0eb9432 100644 --- a/funnel/templates/proposal.html.jinja2 +++ b/funnel/templates/proposal.html.jinja2 @@ -240,11 +240,11 @@
-

{% trans %}{{part_a}}{% endtrans %} {% if proposal.user == g.user %}edit{% endif %}

-
{{ proposal.objective }}
+

{% trans %}Abstract{% endtrans %} {% if proposal.user == g.user %}edit{% endif %}

+
{{ proposal.abstract }}
-

{% trans %}{{part_b}}{% endtrans %} {% if proposal.user == g.user %}edit{% endif %}

-
{{ proposal.description }}
+

{% trans %}Outline{% endtrans %} {% if proposal.user == g.user %}edit{% endif %}

+
{{ proposal.outline }}
{% if proposal.requirements.text -%}

{% trans %}Requirements{% endtrans %} {% if proposal.user == g.user %}edit{% endif %}

@@ -278,7 +278,7 @@

{% trans %}Slides{% endtrans %} edit

This section is empty.

{% endif %} - + {% if proposal.preview_video.url %}

{% trans %}Preview video{% endtrans %}

{{ proposal.preview_video }} diff --git a/funnel/templates/proposals.html.jinja2 b/funnel/templates/proposals.html.jinja2 index 07ec65120..9aa3164e8 100644 --- a/funnel/templates/proposals.html.jinja2 +++ b/funnel/templates/proposals.html.jinja2 @@ -36,10 +36,7 @@