Skip to content

Commit a3e1aaa

Browse files
committed
[spalenque] - #14602 * Make CFP header title dynamic according to Selection Plan
1 parent 5843498 commit a3e1aaa

4 files changed

Lines changed: 28 additions & 14 deletions

File tree

summit/code/pages/PresentationPage.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ public function index(SS_HTTPRequest $r)
698698
public function summary(SS_HTTPRequest $r)
699699
{
700700
return $this->customise(array(
701-
'Presentation' => $this->presentation
701+
'Presentation' => $this->presentation,
702+
'HeaderTitle' => $this->getSubmissionTitle()
702703
))->renderWith(array('PresentationPage_summary', 'PresentationPage'), $this->parent);
703704
}
704705

@@ -717,7 +718,8 @@ public function speakers(SS_HTTPRequest $r)
717718
public function tags(SS_HTTPRequest $r)
718719
{
719720
return $this->customise(array(
720-
'Presentation' => $this->presentation
721+
'Presentation' => $this->presentation,
722+
'HeaderTitle' => $this->getSubmissionTitle()
721723
))->renderWith(array('PresentationPage_tags', 'PresentationPage'), $this->parent);
722724
}
723725

@@ -1104,6 +1106,21 @@ public function doFinishSpeaker($data, $form)
11041106
return $this->parent->redirect($this->parent->Link().$vars);
11051107
}
11061108
}
1109+
1110+
public function getSubmissionTitle()
1111+
{
1112+
$title = $this->presentation->Exists() ? 'Edit Your' : 'Add New';
1113+
1114+
if ($selection_plan = $this->Summit()->getOpenSelectionPlanForStage('Submission')) {
1115+
if (strpos(strtolower($selection_plan->Name), 'forum') !== false) {
1116+
$title .= ' Forum Session';
1117+
} else {
1118+
$title .= ' Presentation';
1119+
}
1120+
}
1121+
1122+
return $title;
1123+
}
11071124
}
11081125

11091126

summit/templates/Layout/PresentationPage_speakers.ss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
<div class="col-lg-9 col-md-9">
1010
<div class="presentation-main-panel">
1111
<div class="main-panel-section">
12-
<h2><% if $Presentation.Speakers %>Speakers<% else %>Add a
13-
Speaker<% end_if %></h2>
12+
<h2>
13+
<% if $Presentation.Speakers %>
14+
Speakers
15+
<% else %>
16+
Add a Speaker
17+
<% end_if %>
18+
</h2>
1419
</div>
1520

1621
<% if $Presentation.Moderator %>

summit/templates/Layout/PresentationPage_summary.ss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
<div class="col-lg-9 col-md-9">
1010
<div class="presentation-main-panel">
1111
<div class="main-panel-section">
12-
<% if $Presentation.exists %>
13-
<h2>Edit Your Presentation</h2>
14-
<% else %>
15-
<h2>Add New Presentation</h2>
16-
<% end_if %>
12+
<h2>{$HeaderTitle}</h2>
1713
</div>
1814
$PresentationForm
1915
</div>

summit/templates/Layout/PresentationPage_tags.ss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
<div class="col-lg-9 col-md-9">
1010
<div class="presentation-main-panel">
1111
<div class="main-panel-section">
12-
<% if $Presentation.exists %>
13-
<h2>Edit Your Forum Session</h2>
14-
<% else %>
15-
<h2>Add New Forum Session</h2>
16-
<% end_if %>
12+
<h2>{$HeaderTitle}</h2>
1713
</div>
1814
$PresentationTagsForm
1915
</div>

0 commit comments

Comments
 (0)