From 57fbaacc548a56caf16506ea5762669e3c7af03f Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 24 Jan 2018 19:55:09 +0000 Subject: [PATCH] Demo Theme git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5217 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/ui/assets/ItemSearchWidget.java | 4 +- .../FixedContentItemComponentForm.java | 6 +- .../pagemodel/ItemListComponentRenderer.java | 8 +- .../resources/themes/ccm/category-page.xsl | 52 ++++++++- .../src/main/resources/themes/ccm/style.css | 109 ++++++++++++++++++ 5 files changed, 168 insertions(+), 11 deletions(-) create mode 100644 ccm-core/src/main/resources/themes/ccm/style.css diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/assets/ItemSearchWidget.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/assets/ItemSearchWidget.java index 1ca0cd220..5c876c1aa 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/assets/ItemSearchWidget.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/assets/ItemSearchWidget.java @@ -74,8 +74,8 @@ public class ItemSearchWidget extends Widget { widget.addAttribute("asset-type", type.getName()); } - final ContentSection section = CMS.getContext().getContentSection(); - widget.addAttribute("content-section", section.getLabel()); +// final ContentSection section = CMS.getContext().getContentSection(); +// widget.addAttribute("content-section", section.getLabel()); final Long value = (Long) getValue(state); if (value != null) { diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pagemodel/FixedContentItemComponentForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pagemodel/FixedContentItemComponentForm.java index 5c1556f38..a806129b7 100644 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/pagemodel/FixedContentItemComponentForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/pagemodel/FixedContentItemComponentForm.java @@ -35,7 +35,7 @@ import org.librecms.pagemodel.FixedContentItemComponent; /** * Form for creating/editing a {@link FixedContentItemComponent}. - * + * * @author Jens Pelzetter */ public class FixedContentItemComponentForm @@ -99,7 +99,9 @@ public class FixedContentItemComponentForm final PageState state = event.getPageState(); final FixedContentItemComponent component = getComponentModel(); - itemSearchWidget.setValue(state, component.getContentItem()); + if (component != null) { + itemSearchWidget.setValue(state, component.getContentItem()); + } } @Override diff --git a/ccm-cms/src/main/java/org/librecms/pagemodel/ItemListComponentRenderer.java b/ccm-cms/src/main/java/org/librecms/pagemodel/ItemListComponentRenderer.java index da4b39528..2429ca962 100644 --- a/ccm-cms/src/main/java/org/librecms/pagemodel/ItemListComponentRenderer.java +++ b/ccm-cms/src/main/java/org/librecms/pagemodel/ItemListComponentRenderer.java @@ -111,12 +111,10 @@ public class ItemListComponentRenderer language = kernelConfig.getDefaultLocale(); } - final List categories; + final List categories = new ArrayList<>(); if (componentModel.isDescending()) { - categories = collectCategories(category); - } else { - categories = new ArrayList<>(); - } + categories.addAll(collectCategories(category)); + } categories.add(category); final Class limitToType = getLimitToType( diff --git a/ccm-core/src/main/resources/themes/ccm/category-page.xsl b/ccm-core/src/main/resources/themes/ccm/category-page.xsl index 8e98c52cd..58b5afc58 100644 --- a/ccm-core/src/main/resources/themes/ccm/category-page.xsl +++ b/ccm-core/src/main/resources/themes/ccm/category-page.xsl @@ -1,20 +1,68 @@ + xmlns:ccm="http://xmlns.libreccm.org" + exclude-result-prefixes="ccm xsl"> + + Category page + - +
+
    + + +
    +                                    
    +                                
    + +
    + + + +
    +
+
+ +
+

+ +

+

+ + +

+
+
+
+ +
+ +
+ +

diff --git a/ccm-core/src/main/resources/themes/ccm/style.css b/ccm-core/src/main/resources/themes/ccm/style.css new file mode 100644 index 000000000..536ad8752 --- /dev/null +++ b/ccm-core/src/main/resources/themes/ccm/style.css @@ -0,0 +1,109 @@ +* { + box-sizing: border-box; + + margin: 0; + padding: 0; +} + +ul.news { + + background-color: #000; + + margin: 0 auto 3em auto; + + width: 100vw; + + padding: 3em; +} + +ul.news li { + + display: flex; + + margin-left: auto; + margin-right: auto; + + max-width: 50em; + +} + +ul.news li img { + max-height: 20em; +} + +ul.news li span { + + color: #fff; + + flex: 1; + + font-size: 2rem; + + padding-left: 1em; + padding-right: 1em; +} + +main div.boxes { + display: flex; + + margin: 3em auto 3em auto; + + max-width: 80em; +} + +main div.boxes div { + position: relative; + + flex: 1; + + margin: 0 3em; +} + +main div.boxes div p img { + width: 100%; +} + +main div.boxes div a { + +} + +footer { + background-color: #000; + color: #fff; + + width: 100vw; +} + +footer ul { + + list-style: none; + + margin-left: auto; + margin-right: auto; + + max-width: 80em; + + padding-top: 4em; + padding-bottom: 4em; +} + +footer ul li { + display: inline-block; +} + +footer ul li:not(:first-child) { + margin-left: 4em; +} + +footer ul li a:link { + + color: #fff; + text-decoration: none; +} + +footer ul li a:focus, footer ul li a:hover { + + color: #fff; + text-decoration: underline; +} +