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 @@
{%- if proposal.project != project %}
- {{ proposal.project.short_title() }}
- {% elif proposal.section.title %}
- - {{ proposal.section.title }}
{% endif %}
- - {{ proposal.technical_level }}
- {{ proposal.voteset.count }} upvotes
- {{ proposal.commentset.count }} comments
- {{ proposal.datetime.strftime("%a, %e %b") }}
diff --git a/funnel/templates/session_view_popup.html.jinja2 b/funnel/templates/session_view_popup.html.jinja2
index acde30eac..30e61f98b 100644
--- a/funnel/templates/session_view_popup.html.jinja2
+++ b/funnel/templates/session_view_popup.html.jinja2
@@ -26,22 +26,6 @@
- {% if session.proposal %}
-
-
- {% if session.proposal.section %}
-
-
Section
-
{{ session.proposal.section.title }}
-
- {% endif %}
-
-
Technical Level
-
{{ session.proposal.technical_level }}
-
-
-
- {% endif %}
{% if session.description_html %}
{% trans %}Description{% endtrans %}
diff --git a/funnel/views/proposal.py b/funnel/views/proposal.py
index 2a5fd13a5..cf5016f99 100644
--- a/funnel/views/proposal.py
+++ b/funnel/views/proposal.py
@@ -56,11 +56,15 @@ def proposal_data(proposal):
('proposer', proposal.user.pickername),
('speaker', proposal.speaker.pickername if proposal.speaker else None),
('section', proposal.section.title if proposal.section else None),
- ('type', proposal.session_type),
- ('level', proposal.technical_level),
- ('objective', proposal.objective.html),
- ('description', proposal.description.html),
- ('requirements', proposal.requirements.html),
+ ('objective', proposal.abstract.html), # TODO: Remove this, name has changed
+ ('description', proposal.outline.html), # TODO: Remove this, name has changed
+ ('requirements', proposal.requirements.html), # TODO: Remove this, name has changed
+ ('abstract_text', proposal.abstract.text),
+ ('abstract_html', proposal.abstract.html),
+ ('outline_text', proposal.outline.text),
+ ('outline_html', proposal.outline.html),
+ ('requirements_text', proposal.requirements.text),
+ ('requirements_html', proposal.requirements.html),
('slides', proposal.slides.url),
('links', proposal.links),
('preview_video', proposal.preview_video.url),
@@ -158,8 +162,7 @@ def view(self):
return dict(project=self.obj.project, proposal=self.obj,
comments=comments, commentform=commentform, delcommentform=delcommentform,
links=links, transition_form=transition_form, proposal_move_form=proposal_move_form,
- part_a=self.obj.project.proposal_part_a.get('title', 'Objective'),
- part_b=self.obj.project.proposal_part_b.get('title', 'Description'), csrf_form=Form(),
+ csrf_form=Form(),
proposal_label_admin_form=proposal_label_admin_form)
@route('json')
diff --git a/funnel/views/schedule.py b/funnel/views/schedule.py
index 16258fb5a..4a8575c9f 100644
--- a/funnel/views/schedule.py
+++ b/funnel/views/schedule.py
@@ -78,9 +78,6 @@ def schedule_data(project):
'description': session.description,
'speaker_bio': session.speaker_bio,
'speaker_bio_text': session.speaker_bio_text,
- 'section_name': session.proposal.section.name if session.proposal and session.proposal.section else None,
- 'section_title': session.proposal.section.title if session.proposal and session.proposal.section else None,
- 'technical_level': session.proposal.technical_level if session.proposal and session.proposal.section else None,
})
schedule = []
for day in sorted(data):
diff --git a/migrations/versions/1b8fc63c0fb0_remove_and_rename_obsolete_columns.py b/migrations/versions/1b8fc63c0fb0_remove_and_rename_obsolete_columns.py
new file mode 100644
index 000000000..80cb3b665
--- /dev/null
+++ b/migrations/versions/1b8fc63c0fb0_remove_and_rename_obsolete_columns.py
@@ -0,0 +1,56 @@
+"""Remove and rename obsolete columns
+
+Revision ID: 1b8fc63c0fb0
+Revises: ea20c403b240
+Create Date: 2019-06-06 12:43:24.087572
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '1b8fc63c0fb0'
+down_revision = 'ea20c403b240'
+
+import json
+from alembic import op
+import sqlalchemy as sa # NOQA
+from sqlalchemy.dialects import postgresql
+
+
+default_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 upgrade():
+ op.alter_column('proposal', 'objective_text', new_column_name='abstract_text')
+ op.alter_column('proposal', 'objective_html', new_column_name='abstract_html')
+ op.alter_column('proposal', 'description_text', new_column_name='outline_text')
+ op.alter_column('proposal', 'description_html', new_column_name='outline_html')
+ op.drop_column('project', 'labels')
+ op.drop_column('proposal', 'technical_level')
+ op.drop_column('proposal', 'session_type')
+
+
+def downgrade():
+ op.add_column('proposal', sa.Column('session_type', sa.VARCHAR(length=40), autoincrement=False, nullable=True))
+ op.add_column('proposal', sa.Column('technical_level', sa.VARCHAR(length=40), autoincrement=False, nullable=True))
+ op.add_column('project', sa.Column('labels',
+ postgresql.JSONB(astext_type=sa.Text()),
+ server_default=sa.text("'" + json.dumps(default_part_labels) + "'::jsonb"),
+ autoincrement=False, nullable=False))
+ op.alter_column('project', 'labels', server_default=sa.text("'{}'::jsonb"))
+ op.alter_column('proposal', 'abstract_text', new_column_name='objective_text')
+ op.alter_column('proposal', 'abstract_html', new_column_name='objective_html')
+ op.alter_column('proposal', 'outline_text', new_column_name='description_text')
+ op.alter_column('proposal', 'outline_html', new_column_name='description_html')