소스 검색

resolve conflicts

Olivier Massot 4 년 전
부모
커밋
9f04377d3a
20개의 변경된 파일154개의 추가작업 그리고 12개의 파일을 삭제
  1. 37 12
      ot_core/Classes/Domain/Repository/BaseApiRepository.php
  2. 24 0
      ot_templating/Configuration/TypoScript/setup.txt
  3. 3 0
      ot_templating/Resources/Private/Layouts/Classic/Home.html
  4. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-blue.css
  5. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-blue.css.map
  6. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-green.css
  7. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-green.css.map
  8. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-grey.css
  9. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-grey.css.map
  10. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-light-blue.css
  11. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-light-blue.css.map
  12. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-light-red.css
  13. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-light-red.css.map
  14. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-orange.css
  15. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-orange.css.map
  16. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-purple.css
  17. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-purple.css.map
  18. 10 0
      ot_templating/Resources/Public/assets/Classic/style/classic-red.css
  19. 0 0
      ot_templating/Resources/Public/assets/Classic/style/classic-red.css.map
  20. 10 0
      ot_templating/Resources/Public/assets/Classic/style/module/_news.scss

+ 37 - 12
ot_core/Classes/Domain/Repository/BaseApiRepository.php

@@ -8,14 +8,14 @@ use Opentalent\OtCore\Exception\ApiRequestException;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerAwareTrait;
+use TYPO3\CMS\Core\Core\ApplicationContext;
 use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
-use TYPO3\CMS\Extbase\Persistence\Repository;
 
 /**
  *  Base class for repositories based on the Opentalent API
  *
  */
-abstract class BaseApiRepository extends Repository implements LoggerAwareInterface
+abstract class BaseApiRepository implements LoggerAwareInterface
 {
     use LoggerAwareTrait;
 
@@ -24,13 +24,38 @@ abstract class BaseApiRepository extends Repository implements LoggerAwareInterf
     const HTTP_METHOD = 'GET';
     const DEFAULT_ITEMS_PER_PAGE = 8;
 
-    private $client;
-    private $context;
+    protected $client;
+    protected $context;
 
-    public function __construct(ObjectManagerInterface $objectManager) {
-        parent::__construct($objectManager);
-        $this->client = new Client(['base_uri' => static::BASE_URI]);
-        $this->context = \TYPO3\CMS\Core\Core\Environment::getContext();
+    /**
+     * BaseApiRepository constructor.
+     *
+     * @param ObjectManagerInterface $objectManager
+     * @param Client|null $client  [For tests only]
+     * @param ApplicationContext|null $context  [For tests only]
+     */
+    public function __construct(
+        ?Client $client = null,
+        ?ApplicationContext $context = null
+    ) {
+        if ($client === null) {
+            $this->client = new Client(['base_uri' => static::BASE_URI]);
+        } else {
+            $this->client = $client;
+        }
+        if ($context === null) {
+            $this->context = \TYPO3\CMS\Core\Core\Environment::getContext();
+        } else {
+            $this->context = $context;
+        }
+    }
+
+    /**
+     * [FOR TESTS ONLY]
+     * @param Client $client
+     */
+    protected function injectClient(Client $client) {
+        $this->client = $client;
     }
 
     /**
@@ -43,7 +68,7 @@ abstract class BaseApiRepository extends Repository implements LoggerAwareInterf
      * @throws ApiRequestException
      */
     protected function getApiRecords(string $uri, $params = []) {
-        $body = $this->getJson($uri, $params);
+        $body = $this->getJsonDecoded($uri, $params);
 
         $page = (int)($params['page'] ?? 1);
 
@@ -100,7 +125,7 @@ abstract class BaseApiRepository extends Repository implements LoggerAwareInterf
      * @return array
      * @throws ApiRequestException
      */
-    protected function getJson(string $uri, $params = [])
+    protected function getJsonDecoded(string $uri, $params = [])
     {
         return json_decode($this->getBody($uri, $params),true);
     }
@@ -116,7 +141,7 @@ abstract class BaseApiRepository extends Repository implements LoggerAwareInterf
      */
     protected function getBody(string $uri, $params = [])
     {
-        return (string)$this->get($uri, $params)->getBody();
+        return (string)$this->getResponse($uri, $params)->getBody();
     }
 
     /**
@@ -128,7 +153,7 @@ abstract class BaseApiRepository extends Repository implements LoggerAwareInterf
      * @return ResponseInterface
      * @throws ApiRequestException
      */
-    protected function get(string $uri, $params = [])
+    protected function getResponse(string $uri, $params = [])
     {
         $uri = $uri . '?_format=json';
         if(!isset($params['itemsPerPage'])) {

+ 24 - 0
ot_templating/Configuration/TypoScript/setup.txt

@@ -194,4 +194,28 @@ lib.tx_ottemplating.widgets {
         action = detail
         switchableControllerActions.News.1 = detail
     }
+
+    news_latest < lib.tx_ottemplating.widgets.news_list
+    news_latest {
+        action = list
+
+        settings < plugin.tx_news.settings
+        settings {
+            # settings for the news.list plugin
+            # @see https://docs.typo3.org/p/georgringer/news/master/en-us/AdministratorManual/Configuration/TypoScript/#
+            list.paginate {
+                insertAbove = 0
+            }
+            topNewsFirst = 1
+            media {
+                maxWidth = 50px
+                maxHeight = 50px
+            }
+            media.maxWidth = 50px
+            media.maxHeight = 50px
+            limit = 2
+            hidePagination = 1
+            defaultDetailPid= {newsPageUid}
+        }
+    }
 }

+ 3 - 0
ot_templating/Resources/Private/Layouts/Classic/Home.html

@@ -32,6 +32,9 @@
 
     <f:comment><!-- Right column --></f:comment>
     <div class="rightcol">
+        <f:comment><!-- Render the last news section defined in partial/LastNews.html--></f:comment>
+        <f:render partial="Classic/LatestNews" />
+
         <f:comment><!-- Render the donors section defined in partial/Donors.html--></f:comment>
         <f:render partial="Classic/Donors" arguments="{settings: settings}" />
         <f:render partial="Classic/Donors" arguments="{settings: settings, fromParents: 1}"/>

+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-blue.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-blue.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-green.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-green.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-grey.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-grey.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-light-blue.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-light-blue.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-light-red.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-light-red.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-orange.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-orange.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-purple.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-purple.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-red.css

@@ -1681,6 +1681,16 @@ form button[type=submit]:hover {
   margin-left: 4px;
 }
 
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}
+
 .contact-form {
   width: 80%;
   margin: auto;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
ot_templating/Resources/Public/assets/Classic/style/classic-red.css.map


+ 10 - 0
ot_templating/Resources/Public/assets/Classic/style/module/_news.scss

@@ -31,3 +31,13 @@ $content-a-color: $content-a-color;
 .ot-news .f3-widget-paginator li {
   margin-left: 4px;
 }
+
+.ot-last-news img {
+  max-width: 70px;
+  max-height: 70px;
+}
+
+.ot-last-news .article {
+  padding-bottom: 0;
+  margin-bottom: 0;
+}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.