Commit 789da5d8 by Anton Sudak

Improve content block styling

parent 3fdcd13d
......@@ -14,7 +14,8 @@
name: String = "",
color: String = "gray",
sortableContainer: Boolean = false,
CssClass: String="" )(content: Html)
CssClass: String = ""
)(content: Html)
@* adds debug info in debug mode *@
@withDebugInfo(content: Html) = {
@if(Template.isDebugMode()) {
......@@ -27,18 +28,15 @@
}
}
@responsiveCollectionClass = @{
Some(data).map{
Some(data).map {
case rc: ResponsiveCollection => rc.getResponsiveCollectionCssClass
case _ => None
}
}
@wrapIntoColumn(content: Html) = {
@if(Template.addColWidthClass(data).nonEmpty) {
<div class="@Template.addColWidthClass(data)">
@content
</div>
} else {
@content
@responsiveBlockClass = @{
Some(data).map(_.getParentBlock).map {
case rs: ResponsiveCollection => Template.addColWidthClass(data)
case _ => "container"
}
}
@wrapIntoContainer(content: Html) = {
......@@ -127,7 +125,7 @@
</div>
} else {
@wrapIntoContainer {
<div class="@Some(CssClass).filterNot(_.isEmpty).getOrElse("pcms-container") @Template.addColWidthClass(data) @responsiveCollectionClass">
<div class="@Some(CssClass).filterNot(_.isEmpty) @responsiveBlockClass @responsiveCollectionClass">
@content
</div>
}
......
@(data: ch.insign.cms.models.ContentBlock)(extension: Html=Html.apply(""))
@import ch.insign.cms.models.Template
@import ch.insign.cms.views.html._blockBase;
@import play.api.i18n.Messages;
@_blockBase(data = data, delete=true, edit=true, add=false, color="red", name=Messages("content.block.name"), CssClass="container") {
<!-- Start ContentBlock @data.getId -->
<h3>@data.getTitle</h3>
<p>@{Html(data.getContent.get)}</p>
@extension
<!-- End ContentBlock @data.getId -->
@import ch.insign.cms.views.html._blockBase
@(
data: ch.insign.cms.models.ContentBlock
)(extension: Html = Html.apply(""))
@_blockBase(data = data, color = "red") {
<h3>@data.getTitle</h3>
<p>@Html(data.getContent.get)</p>
@extension
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment