]> _ Git - fluidbook-v3.git/commitdiff
WIP #3641 @5.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 18 May 2020 15:56:03 +0000 (15:56 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 18 May 2020 15:56:03 +0000 (15:56 +0000)
framework/application/Bootstrap.php
framework/application/forms/CMS/Sub/Blog/ContentBlock.php
framework/application/models/Blog.php
framework/application/views/helpers/BlogIndex.php
framework/application/views/scripts/blogpost/index.phtml
framework/application/views/scripts/templates/blog.phtml
js/010-admin.js
less/010-admin.less

index d826599709d4a29c5d504ae53b1162f88a05eb8e..7215eae22fdd7e832df846e2ca8c80f4f9369a2b 100644 (file)
@@ -40,7 +40,7 @@ class Bootstrap extends CubeIT_Bootstrap {
 
     // URL template used for blog pages
     public static function getBlogPostURLTemplate() {
-        return '/blog/%title%'; // Important: must have leading slash or pages will show as not found!
+        return 'blog/%title%';
     }
 
     /* @param CubeIT_Navigation_Page_Locale $page */
@@ -67,8 +67,8 @@ class Bootstrap extends CubeIT_Bootstrap {
 
             $p = new CubeIT_Navigation_Page_Locale();
             $p->setController('Blogpost');
-            $p->setId('blog/' . $r->id);
-            $p->setAutoUri($r, $URL_template);
+            $p->setId($locale .'/blog/'. $r->id);
+            $p->setAutoUri($r, $URL_template, $locale);
             $p->setSitemap($online);
             $p->setTitle($pageTitle);
             $p->setEditable(false);
index 50d5a53fafc529677fdcf916659bbc242f3bbb7d..d7b7ee84fb666af6c1c1e79371a04105b9b292f9 100644 (file)
@@ -9,22 +9,18 @@ class Fluidbook_Form_CMS_Sub_Blog_ContentBlock extends CubeIT_Form_SubForm {
 
         $select = new Zend_Form_Element_Select('content_type');
         $select->setAttrib('data-name', 'content-type')
+               ->setLabel('Content Type')
                ->setMultiOptions([
                    'text' => 'Text Block',
                    'image' => 'Image',
                ]);
         $this->addElement($select);
 
-        $text = new CubeIT_Form_Element_Markitup_Basic('text');
+        $text = new CubeIT_Form_Element_Markitup('text');
         $text->setLabel('Text Block')
              ->setAttrib('data-type', 'text'); // Shown when "text" content type is selected
         $this->addElementLocalized($text, $compact_translations);
 
-        $image = new CubeIT_Form_Element_File_Image('image');
-        $image->setLabel('Image')
-              ->setMaxItems(1)
-              ->setAttrib('data-type', 'image'); // Shown when "image" content type is selected
-        $this->addElementLocalized($image, $compact_translations);
 
         $image_style = new Zend_Form_Element_Select('image_style');
         $image_style->setLabel('Image Style')
@@ -33,7 +29,13 @@ class Fluidbook_Form_CMS_Sub_Blog_ContentBlock extends CubeIT_Form_SubForm {
                         '' => 'Normal',
                         'xl' => 'Extra Large',
                     ]);
-        $this->addElementLocalized($image_style, $compact_translations);
+        $this->addElement($image_style);
+
+        $image = new CubeIT_Form_Element_File_Image('image');
+        $image->setLabel('Image')
+              ->setMaxItems(1)
+              ->setAttrib('data-type', 'image'); // Shown when "image" content type is selected
+        $this->addElementLocalized($image, $compact_translations);
 
     }
 }
index 5971fb823d555161a39bbec7aafe429342aab8d0..3c49dc9f85eb52202da9aa3ae2d7d30395c6ce10 100644 (file)
@@ -28,4 +28,18 @@ class Fluidbook_Model_Blog extends CubeIT_Model_Data_Table
         return $table;\r
     }\r
 \r
+    public function getThumbnailHTML($width, $height, $class) {\r
+\r
+        $this->view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;\r
+\r
+        $img = $this->view->imageProcess($this->getThumbnail(), '', $width, $height, ['class' => $class]);\r
+\r
+        // Fallback to other uploaded images if no thumbnail is set\r
+        if (!$img) {\r
+            $img = '<div class="blog-featured-image blog-featured-image-empty"></div>';\r
+        }\r
+\r
+        return $img;\r
+    }\r
+\r
 }\r
index 203100e9cbeacc65b54a239dc9037052f85c4768..5ab92de9a4785a2bfe9195a6993e78e3384cad97 100644 (file)
@@ -22,11 +22,7 @@ class Fluidbook_View_Helper_BlogIndex extends CubeIT_View_Helper_Abstract {
 \r
         $URL = CubeIT_Navigation_Page::generateAutoUri($post, Bootstrap::getBlogPostURLTemplate());\r
 \r
-        $img = $post->getThumbnail(247, 247, 'blog-featured-image');\r
-\r
-        if (!$img) {\r
-            $img = '<div class="blog-featured-image blog-featured-image-empty"></div>';\r
-        }\r
+        $img = $post->getThumbnailHTML(247, 247, 'blog-featured-image');\r
 \r
         $res  = $this->link($img, $URL);\r
         $res .= $this->dateTime($post->getPublishDate(), CubeIT_Date::DAY . '/' . CubeIT_Date::MONTH . '/' . CubeIT_Date::YEAR);\r
index 4b9cb78f199b0ed646768b40a9723c6659126d17..f6c5470c28eb4d76c48b35f5ba0d276c5e03ec92 100644 (file)
@@ -1,4 +1,4 @@
 <?php // TODO: blog post detail view ?>
-<pre>
+<pre style="margin-top: 200px;">
     <?php print_r($this->post); ?>
 </pre>
index 26853e9920e2f0e5d4ee9a198dcee6be2a22d992..d2110f71255002202ff8a1e2f57a78dea9b51fd3 100644 (file)
@@ -2,6 +2,5 @@
 
 $this->headScript()->addScriptAndStyle('610-blog');
 
-echo $this->introBlock($this->intro, '');
-echo $this->blogIndex();
+echo $this->introBlock($this->intro, $this->blogIndex());
 echo $this->contactFooter();
index 2dee9c446cbb43979d04b2fbd499a056348f453b..d6fe8f4776f4a5efd92a2f0b6ede34114af20e75 100644 (file)
@@ -39,6 +39,6 @@ function getFieldWrapper(field) {
   if (field.parents('.localized').length > 0) {
     return field.parents('.localized').parent();
   } else {
-    return field.parents('.elementwrap').parent();
+    return field.parents('.elementwrap');
   }
 }
index 3099aa99c455358b28157ff58deba76c8013f202..c544f445f6fa98ec412dcf9fcc7265e474896135 100644 (file)
@@ -9,9 +9,9 @@
        width: 100%;\r
        padding:5px 5%;\r
        .bar {\r
-               color: #5c6268;\r
+               color: #999;\r
                a.right{\r
-                       color:#c00;\r
+                       color: #f70;\r
                }\r
        }\r
 \r
@@ -27,4 +27,4 @@
 \r
 #contentWrapper .cubeit-content{\r
        padding-top:120px;\r
-}
\ No newline at end of file
+}\r