Skip to content

Commit c6154cb

Browse files
committed
[spalenque] - #14257 * add page section boxes to summit homepage
1 parent a915080 commit c6154cb

8 files changed

Lines changed: 237 additions & 63 deletions

File tree

summit/code/pages/SummitAboutPage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function getCMSFields()
2828
'PageSectionSpeakers' => 'Speakers' ,
2929
'PageSectionSponsors' => 'Sponsors' ,
3030
'PageSectionVideos' => 'Videos' ,
31-
'PageSectionMovement' => 'Join Movement'
31+
'PageSectionMovement' => 'Join Movement',
32+
'PageSectionBoxes' => 'Boxes'
3233
)
3334
);
3435

summit/code/pages/sections/PageSection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class PageSection extends DataObject {
3434
static $summary_fields = array(
3535
'Name' => 'Name',
3636
'Title' => 'Title',
37+
'ClassName' => 'Class',
3738
'Enabled' => 'Enabled'
3839
);
3940

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright 2018 Openstack Foundation
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
**/
14+
15+
class PageSectionBox extends DataObject {
16+
17+
static $db = array(
18+
'Title' => 'Varchar(255)',
19+
'Text' => 'HTMLText',
20+
'ButtonLink' => 'Varchar(255)',
21+
'ButtonText' => 'Varchar(100)',
22+
'Size' => 'Int',
23+
'Order' => 'Int'
24+
);
25+
26+
static $has_one = array(
27+
'ParentSection' => 'PageSectionBoxes'
28+
);
29+
30+
function getCMSFields() {
31+
32+
$fields = new FieldList (
33+
new TextField('Title','Title:'),
34+
new HtmlEditorField('Text','Text:'),
35+
new TextField ('ButtonLink','Link:'),
36+
new TextField ('ButtonText','Label:'),
37+
new TextField ('Size','Size (1 or 2):'),
38+
new HiddenField('ParentSectionID','ParentSectionID')
39+
);
40+
41+
return $fields;
42+
}
43+
44+
function isClass($className) {
45+
return $this->is_a($className);
46+
}
47+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Copyright 2018 Openstack Foundation
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
**/
14+
15+
class PageSectionBoxQuote extends PageSectionBox {
16+
17+
static $has_one = array(
18+
'Speaker' => 'PresentationSpeaker'
19+
);
20+
21+
function getCMSFields() {
22+
$fields = parent::getCMSFields();
23+
24+
$config = GridFieldConfig_RelationEditor::create(1);
25+
$auto_completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
26+
$auto_completer->setResultsFormat('$FirstName $LastName');
27+
$config->getComponentByType('GridFieldDataColumns')->setDisplayFields(
28+
[
29+
'FirstName' => 'FirstName',
30+
'LastName' => 'LastName',
31+
'Title' => 'Title',
32+
]);
33+
$gridField = new BetterGridField('Speaker', 'Speaker', $this->Speaker(), $config);
34+
35+
if ($this->ID) {
36+
$fields->add($gridField);
37+
}
38+
39+
return $fields;
40+
}
41+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright 2018 Openstack Foundation
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
**/
14+
15+
class PageSectionBoxVideo extends PageSectionBox {
16+
17+
static $db = array(
18+
'YoutubeID' => 'Varchar(100)'
19+
);
20+
21+
static $has_one = array(
22+
'Thumbnail' => 'BetterImage'
23+
);
24+
25+
function getCMSFields() {
26+
$fields = parent::getCMSFields();
27+
28+
$fields->add(new TextField('YoutubeID', 'YoutubeID'));
29+
30+
$join_image = new UploadField('Thumbnail', 'Thumbnail');
31+
$join_image->setAllowedMaxFileNumber(1);
32+
$fields->add($join_image);
33+
34+
return $fields;
35+
}
36+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright 2018 Openstack Foundation
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
**/
14+
15+
class PageSectionBoxes extends PageSectionText {
16+
17+
static $has_many = array(
18+
'Boxes' => 'PageSectionBox'
19+
);
20+
21+
function getCMSFields() {
22+
$fields = parent::getCMSFields();
23+
24+
$config = GridFieldConfig_RecordEditor::create();
25+
$config->removeComponentsByType('GridFieldAddNewButton');
26+
$multi_class_selector = new GridFieldAddNewMultiClass();
27+
28+
$multi_class_selector->setClasses(
29+
array
30+
(
31+
'PageSectionBox' => 'Just Text' ,
32+
'PageSectionBoxQuote' => 'Speaker Quote' ,
33+
'PageSectionBoxVideo' => 'Video' ,
34+
)
35+
);
36+
37+
$config->addComponent($multi_class_selector);
38+
$config->addComponent(new GridFieldSortableRows('Order'));
39+
$gridField = new BetterGridField('Boxes', 'Boxes', $this->Boxes(), $config);
40+
41+
if ($this->ID) {
42+
$fields->add($gridField);
43+
}
44+
45+
return $fields;
46+
}
47+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!-- Summit Page Footer -->
2+
<footer>
3+
<div class="container">
4+
<div class="row footer-links">
5+
<div class="col-lg-2 col-sm-2">
6+
<h3>OpenStack</h3>
7+
<ul>
8+
<li><a href="/foundation">About The Foundation</a></li>
9+
<li><a href="http://openstack.org/projects/">Projects</a></li>
10+
<li><a href="http://openstack.org/projects/openstack-security/">OpenStack Security</a></li>
11+
<li><a href="http://openstack.org/projects/openstack-faq/">Common Questions</a></li>
12+
<li><a href="http://openstack.org/blog/">Blog</a></li>
13+
</ul>
14+
</div>
15+
<div class="col-lg-2 col-sm-2">
16+
<h3>Community</h3>
17+
<ul>
18+
<li><a href="http://openstack.org/community/">User Groups</a></li>
19+
<li><a href="http://openstack.org/community/events/">Events</a></li>
20+
<li><a href="http://openstack.org/community/jobs/">Jobs</a></li>
21+
<li><a href="http://openstack.org/foundation/companies/">Companies</a></li>
22+
<li><a href="https://wiki.openstack.org/wiki/How_To_Contribute">Contribute</a></li>
23+
</ul>
24+
</div>
25+
<div class="col-lg-2 col-sm-2">
26+
<h3>Documentation</h3>
27+
<ul>
28+
<li><a href="http://docs.openstack.org">OpenStack Manuals</a></li>
29+
<li><a href="http://openstack.org/software/start/">Getting Started</a></li>
30+
<li><a href="http://developer.openstack.org">API Documentation</a></li>
31+
<li><a href="https://wiki.openstack.org">Wiki</a></li>
32+
</ul>
33+
</div>
34+
<div class="col-lg-2 col-sm-2">
35+
<h3>Branding & Legal</h3>
36+
<ul>
37+
<li><a href="http://openstack.org/brand/">Logos & Guidelines</a></li>
38+
<li><a href="http://openstack.org/brand/openstack-trademark-policy/">Trademark Policy</a></li>
39+
<li><a href="http://openstack.org/privacy/">Privacy Policy</a></li>
40+
<li><a href="https://wiki.openstack.org/wiki/How_To_Contribute#Contributor_License_Agreement">OpenStack CLA</a></li>
41+
</ul>
42+
</div>
43+
<div class="col-lg-4 col-sm-4">
44+
<h3>Stay In Touch</h3>
45+
<a href="https://twitter.com/OpenStack" target="_blank" class="social-icons footer-twitter"></a>
46+
<a href="https://www.facebook.com/openstack" target="_blank" class="social-icons footer-facebook"></a>
47+
<a href="https://www.linkedin.com/company/openstack" target="_blank" class="social-icons footer-linkedin"></a>
48+
<a href="https://www.youtube.com/user/OpenStackFoundation" target="_blank" class="social-icons footer-youtube"></a>
49+
<!-- <form class="form-inline">
50+
<div class="form-group newsletter-form">
51+
<label>Join Our Newsletter</label>
52+
<input class="newsletter-input" type="input" placeholder="Email">
53+
<button type="submit" class="newsletter-btn">Join</button>
54+
</div>
55+
</form> -->
56+
<p class="fine-print">
57+
The OpenStack project is provided under the Apache 2.0 license. Openstack.org is powered by <a href="http://rackspace.com" target="_blank">Rackspace Cloud Computing</a>.
58+
</p>
59+
</div>
60+
</div>
61+
</div>
62+
</footer>

summit/templates/SummitPage.ss

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -32,68 +32,7 @@
3232

3333
<% include DownloadAppModal %>
3434

35-
<!-- Footer -->
36-
<footer>
37-
<div class="container">
38-
<div class="row footer-links">
39-
<div class="col-lg-2 col-sm-2">
40-
<h3>OpenStack</h3>
41-
<ul>
42-
<li><a href="/foundation">About The Foundation</a></li>
43-
<li><a href="http://openstack.org/projects/">Projects</a></li>
44-
<li><a href="http://openstack.org/projects/openstack-security/">OpenStack Security</a></li>
45-
<li><a href="http://openstack.org/projects/openstack-faq/">Common Questions</a></li>
46-
<li><a href="http://openstack.org/blog/">Blog</a></li>
47-
</ul>
48-
</div>
49-
<div class="col-lg-2 col-sm-2">
50-
<h3>Community</h3>
51-
<ul>
52-
<li><a href="http://openstack.org/community/">User Groups</a></li>
53-
<li><a href="http://openstack.org/community/events/">Events</a></li>
54-
<li><a href="http://openstack.org/community/jobs/">Jobs</a></li>
55-
<li><a href="http://openstack.org/foundation/companies/">Companies</a></li>
56-
<li><a href="https://wiki.openstack.org/wiki/How_To_Contribute">Contribute</a></li>
57-
</ul>
58-
</div>
59-
<div class="col-lg-2 col-sm-2">
60-
<h3>Documentation</h3>
61-
<ul>
62-
<li><a href="http://docs.openstack.org">OpenStack Manuals</a></li>
63-
<li><a href="http://openstack.org/software/start/">Getting Started</a></li>
64-
<li><a href="http://developer.openstack.org">API Documentation</a></li>
65-
<li><a href="https://wiki.openstack.org">Wiki</a></li>
66-
</ul>
67-
</div>
68-
<div class="col-lg-2 col-sm-2">
69-
<h3>Branding & Legal</h3>
70-
<ul>
71-
<li><a href="http://openstack.org/brand/">Logos & Guidelines</a></li>
72-
<li><a href="http://openstack.org/brand/openstack-trademark-policy/">Trademark Policy</a></li>
73-
<li><a href="http://openstack.org/privacy/">Privacy Policy</a></li>
74-
<li><a href="https://wiki.openstack.org/wiki/How_To_Contribute#Contributor_License_Agreement">OpenStack CLA</a></li>
75-
</ul>
76-
</div>
77-
<div class="col-lg-4 col-sm-4">
78-
<h3>Stay In Touch</h3>
79-
<a href="https://twitter.com/OpenStack" target="_blank" class="social-icons footer-twitter"></a>
80-
<a href="https://www.facebook.com/openstack" target="_blank" class="social-icons footer-facebook"></a>
81-
<a href="https://www.linkedin.com/company/openstack" target="_blank" class="social-icons footer-linkedin"></a>
82-
<a href="https://www.youtube.com/user/OpenStackFoundation" target="_blank" class="social-icons footer-youtube"></a>
83-
<!-- <form class="form-inline">
84-
<div class="form-group newsletter-form">
85-
<label>Join Our Newsletter</label>
86-
<input class="newsletter-input" type="input" placeholder="Email">
87-
<button type="submit" class="newsletter-btn">Join</button>
88-
</div>
89-
</form> -->
90-
<p class="fine-print">
91-
The OpenStack project is provided under the Apache 2.0 license. Openstack.org is powered by <a href="http://rackspace.com" target="_blank">Rackspace Cloud Computing</a>.
92-
</p>
93-
</div>
94-
</div>
95-
</div>
96-
</footer>
35+
<% include SummitPageFooter %>
9736

9837
<!-- Hidden Sidebar Nav -->
9938
<div class="sidebar-nav">

0 commit comments

Comments
 (0)