]> _ Git - fluidbook-v3.git/commitdiff
WIP #3641 @6
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 28 May 2020 16:00:18 +0000 (16:00 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 28 May 2020 16:00:18 +0000 (16:00 +0000)
framework/application/controllers/BlogpostController.php
framework/application/views/helpers/BlogIndex.php
framework/application/views/helpers/BlogIntro.php
less/610-blog.less

index 716788339a686485a0e3ef529325044129cce897..679577072a2ace1d67690d011e755521b772212e 100644 (file)
@@ -5,6 +5,7 @@ class BlogpostController extends CubeIT_Controller_PageController {
     public function indexAction() {
 
         $this->view->headScript()->addScriptAndStyle('610-blog');
+        $this->view->body_class = 'blog-post-single';
 
         //$parent = $this->view->currentPage->getParent();
         //$parent_data = $this->getBootstrap()->getCMSDatasOfNavigationPage($parent);
index e876ebee15cf55eec52dad9c74c0615ad3c713bb..c24ec0d502c8fe6cd95053f721fd1d7529280bd5 100644 (file)
@@ -20,7 +20,7 @@ class Fluidbook_View_Helper_BlogIndex extends CubeIT_View_Helper_Abstract {
 \r
         foreach ($posts as $post) {\r
             /* @var $post Fluidbook_Model_Blog */\r
-            $res .= $this->blogIntro($post, false);\r
+            $res .= $this->htmlElement($this->blogIntro($post, false), 'article', ['itemProp' => 'blogPost']);\r
         }\r
 \r
         return $this->htmlElement($res, 'div', ['class' => 'blog-index']);\r
index 0bd8f9a637a03da12c572f1e0cbe6cb9f99aa4aa..d115af16bd50962ecd10cea928657085ce2bd780 100644 (file)
@@ -19,6 +19,9 @@ class Fluidbook_View_Helper_BlogIntro extends CubeIT_View_Helper_Abstract {
             $title_tag = 'h2';
         }
 
+        // Avoid orphaned punctuation in titles
+        $title = str_replace([' ?', ' :'], ['&nbsp;?', '&nbsp;:'], $title);
+
         // Blog intro content structure
         $res  = '<div class="grid">';
         $res .= '<div class="blog-intro-content">';
index 2d7f6f24e3acf68868b7934328cc4eaae55e1c39..88f833db4464ceb40158722c5414d453c057dcc1 100644 (file)
 .blog-intro {
   display: flex;
   align-items: center;
-  padding: 0 !important;
+
+  // Extra padding to ensure text doesn't get too close to edges or overlap when under a header
+  // Padding is symmetrical so that vertical centre is not thrown off
+  padding: 144px 0 !important;
+
+  @media @m1280 {
+    padding: 86px 0 !important;
+  }
+  @media @m900 {
+    padding: 96px 0 !important;
+  }
+  @media @m768 {
+    padding: 75px 0 !important;
+  }
+
+  @media @m1024 {
+    min-height: 0 !important; // Reset min-height now that there's no image
+  }
+
+
 
   &.light {
     color: #fff;
 
   &-content {
     flex-basis: 40%;
+
+    @media @m1280 {
+      flex-basis: 42%;
+    }
+    @media (max-width: 1100px) {
+      flex-basis: 47%;
+    }
+    @media @m1024 {
+      flex-basis: 100%;
+    }
+
+    @media @m900 {
+      text-align: center;
+    }
   }
 
   &-date {
     color: currentColor !important;
     font-size: 60px !important;
 
+    @media (max-width: 1600px) {
+      font-size: 50px !important;
+    }
+    @media @m1024 {
+      font-size: 40px !important;
+    }
+    @media @m640 {
+      font-size: 30px !important;
+    }
+
     &:after {
       background-color: currentColor !important;
       bottom: 0.7em !important;
     font-size: 15px;
     line-height: 1.7;
     max-width: 550px;
+
+    @media @m1024 {
+      max-width: none;
+    }
+  }
+
+  .grid {
+    width: 100%;
   }
 
   .picture {
     @media @m1024 {
       display: none;
     }
+
+    // Make image cover space even when text pushes height out
+    img {
+      left: 0;
+      height: 100% !important;
+      object-fit: cover;
+      object-position: left;
+    }
+
   }
 
 }
   max-width: 1008px;
   width: 100%;
 
+  @media @m1024 {
+    font-size: 20px;
+  }
+  @media @m900 {
+    font-size: 18px;
+  }
+  @media @m640 {
+    font-size: 16px;
+  }
+
+
   > * + * {
     margin-top: 1.5em;
   }
   padding: 1.5em;
   font-size: 15px;
 
+  @media (max-width: 600px) {
+    flex-wrap: wrap;
+    justify-content: center;
+    text-align: center;
+
+    > * + * {
+      padding-top: 0.75em;
+    }
+
+  }
+
   &-photo {
+    flex-shrink: 0;
     width: 120px;
     height: 120px;
     background-size: cover;
     background-position: center;
     background-repeat: no-repeat;
     border-radius: 50%;
-    margin-right: 1.5em;
+  }
+
+  &-details {
+    margin: 0 1.5em;
   }
 
   &-name {
     font-family: @heading-font;
     font-size: 30px;
+    font-weight: normal;
+    line-height: 1.3;
+    margin-bottom: 0.2em;
   }
 }