Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Oct 17, 2017
2 parents e980eba + dd105c6 commit 9410997
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/styles/bundle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
// Import Model Styles:

@import "model/Link";
@import "model/Slide";
14 changes: 14 additions & 0 deletions client/src/styles/model/Slide.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Slide Styles
===================================================================================================================== */

.component.slide {

.slide-caption.title-after {

> h1, > h2, > h3, > h4, > h5, > h6 {
margin-bottom: 0;
}

}

}
3 changes: 2 additions & 1 deletion src/Lists/ListSourceSlide.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ protected function createSlide(ViewableData $item)
'ParentID' => $this->ParentID,
'HideImage' => $this->HideImage,
'HideTitle' => $this->HideTitle,
'HideCaption' => $this->HideCaption
'HideCaption' => $this->HideCaption,
'TitleAfterCaption' => $this->TitleAfterCaption
]);

// Define Slide Link:
Expand Down
37 changes: 34 additions & 3 deletions src/Model/Slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class Slide extends Component
'HideImage' => 'Boolean',
'HideTitle' => 'Boolean',
'HideCaption' => 'Boolean',
'LinkDisabled' => 'Boolean'
'LinkDisabled' => 'Boolean',
'TitleAfterCaption' => 'Boolean'
];

/**
Expand Down Expand Up @@ -143,7 +144,8 @@ class Slide extends Component
'HideImage' => 0,
'HideTitle' => 1,
'HideCaption' => 0,
'LinkDisabled' => 0
'LinkDisabled' => 0,
'TitleAfterCaption' => 0
];

/**
Expand Down Expand Up @@ -226,6 +228,10 @@ public function getCMSFields()
CheckboxField::create(
'LinkDisabled',
$this->fieldLabel('LinkDisabled')
),
CheckboxField::create(
'TitleAfterCaption',
$this->fieldLabel('TitleAfterCaption')
)
]);

Expand Down Expand Up @@ -260,6 +266,7 @@ public function fieldLabels($includerelations = true)
$labels['HideTitle'] = _t(__CLASS__ . '.HIDETITLE', 'Hide title');
$labels['HideCaption'] = _t(__CLASS__ . '.HIDECAPTION', 'Hide caption');
$labels['LinkDisabled'] = _t(__CLASS__ . '.LINKDISABLED', 'Link disabled');
$labels['TitleAfterCaption'] = _t(__CLASS__ . '.SHOWTITLEAFTERCAPTION', 'Show title after caption');

// Define Relation Labels:

Expand Down Expand Up @@ -371,7 +378,7 @@ public function getSlideClass($isFirst = false, $isMiddle = false, $isLast = fal
*/
public function getSlideClassNames($isFirst = false, $isMiddle = false, $isLast = false)
{
$classes = ViewTools::singleton()->getAncestorClassNames($this, self::class);
$classes = parent::getClassNames();

$classes[] = $this->ImageShown ? 'has-image' : 'no-image';

Expand Down Expand Up @@ -425,6 +432,10 @@ public function getCaptionClassNames()
$classes = array_merge($classes, $this->getParent()->getCaptionClassNames($this));
}

if ($this->TitleAfterCaption) {
$classes[] = 'title-after';
}

$this->extend('updateCaptionClassNames', $classes);

return $classes;
Expand Down Expand Up @@ -562,6 +573,26 @@ public function getTitleShown()
return ($this->Title && !$this->HideTitle);
}

/**
* Answers true if the slide title is to be shown before the caption.
*
* @return boolean
*/
public function getTitleShownBeforeCaption()
{
return ($this->TitleShown && !$this->TitleAfterCaption);
}

/**
* Answers true if the slide title is to be shown after the caption.
*
* @return boolean
*/
public function getTitleShownAfterCaption()
{
return ($this->TitleShown && $this->TitleAfterCaption);
}

/**
* Answers true if the slide caption is to be shown.
*
Expand Down
5 changes: 4 additions & 1 deletion templates/SilverWare/Model/Slide.ss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
<% end_if %>
<% if $TitleOrCaptionShown %>
<div class="$CaptionClass">
<% if $TitleShown %>
<% if $TitleShownBeforeCaption %>
<{$HeadingTag}>{$FontIconTag}<span class="text">{$Title}</span></{$HeadingTag}>
<% end_if %>
<% if $CaptionShown %>
$Caption
<% end_if %>
<% if $TitleShownAfterCaption %>
<{$HeadingTag}>{$FontIconTag}<span class="text">{$Title}</span></{$HeadingTag}>
<% end_if %>
</div>
<% end_if %>
<% if $LinkShown %></a><% end_if %>
Expand Down

0 comments on commit 9410997

Please sign in to comment.