Browse Source

First Development branch commit -> intended for Drupal.org sandbox

logicp 7 years ago
parent
commit
a91a66db32

+ 1 - 1
heartbeat.services.yml

@@ -1,6 +1,6 @@
 services:
   heartbeat.heartbeattype:
-    class: Drupal\heartbeat\HeartbeatTypeServices
+    class: Drupal\heartbeat\HeartbeatTypeService
     arguments: ['@entity_type.manager', '@entity_type.bundle.info', '@entity.query']
 
   heartbeatstream:

+ 4 - 4
src/Form/HeartbeatFeedForm.php

@@ -9,7 +9,7 @@ use Drupal\Core\Render\Element\Ajax;
 use Drupal\heartbeat\Ajax\SelectFeedCommand;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\heartbeat\HeartbeatService;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\Core\Ajax\AjaxResponse;
 
@@ -28,9 +28,9 @@ class HeartbeatFeedForm extends FormBase {
    */
   protected $heartbeatService;
   /**
-   * Drupal\heartbeat\HeartbeatTypeServices definition.
+   * Drupal\heartbeat\HeartbeatTypeService definition.
    *
-   * @var \Drupal\heartbeat\HeartbeatTypeServices
+   * @var \Drupal\heartbeat\HeartbeatTypeService
    */
   protected $typeService;
   /**
@@ -51,7 +51,7 @@ class HeartbeatFeedForm extends FormBase {
 
   public function __construct(
     HeartbeatService $heartbeat,
-    HeartbeatTypeServices $heartbeat_heartbeattype,
+    HeartbeatTypeService $heartbeat_heartbeattype,
     HeartbeatStreamServices $heartbeatstream
   ) {
     $this->heartbeatService = $heartbeat;

+ 2 - 2
src/Form/HeartbeatStreamForm.php

@@ -5,7 +5,7 @@ namespace Drupal\heartbeat\Form;
 use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Entity\EntityManager;
 use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\Entity\HeartbeatStream;
 use Drupal\heartbeat\Entity\HeartbeatType;
 use Drupal\Core\Database\Database;
@@ -59,7 +59,7 @@ class HeartbeatStreamForm extends ContentEntityForm {
    * @param Renderer $renderer
    * @throws \Exception
    */
-  public function __construct(HeartbeatTypeServices $heartbeatTypeService, EntityManager $entityManager) {
+  public function __construct(HeartbeatTypeService $heartbeatTypeService, EntityManager $entityManager) {
     parent::__construct($entityManager);
     $this->heartbeatTypeService = $heartbeatTypeService;
 

+ 0 - 0
src/HeartbeatTypeServices.php → src/HeartbeatTypeService.php


+ 6 - 6
src/Plugin/Block/HeartbeatBlock.php

@@ -16,7 +16,7 @@ use Drupal\file\Entity\File;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Database;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\heartbeat\HeartbeatService;
 use Drupal\heartbeat\Plugin\Block\HeartbeatCommentBlock;
@@ -34,11 +34,11 @@ use Drupal\heartbeat\Plugin\Block\HeartbeatCommentBlock;
 class HeartbeatBlock extends BlockBase implements ContainerFactoryPluginInterface {
 
   /**
-   * Drupal\heartbeat\HeartbeatTypeServices definition.
+   * Drupal\heartbeat\HeartbeatTypeService definition.
    *
-   * @var \Drupal\heartbeat\HeartbeatTypeServices
+   * @var \Drupal\heartbeat\HeartbeatTypeService
    */
-  protected $heartbeatTypeServices;
+  protected $heartbeatTypeService;
   /**
    * Drupal\heartbeat\HeartbeatStreamServices definition.
    *
@@ -78,12 +78,12 @@ class HeartbeatBlock extends BlockBase implements ContainerFactoryPluginInterfac
         array $configuration,
         $plugin_id,
         $plugin_definition,
-        HeartbeatTypeServices $heartbeat_heartbeattype,
+        HeartbeatTypeService $heartbeat_heartbeattype,
 	HeartbeatStreamServices $heartbeatstream,
 	HeartbeatService $heartbeat, EntityTypeManager $entity_type_manager, DateFormatter $date_formatter, FlagService $flag_service, FormBuilder $form_builder, ConfigFactory $configFactory
   ) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
-    $this->heartbeatTypeServices = $heartbeat_heartbeattype;
+    $this->heartbeatTypeService = $heartbeat_heartbeattype;
     $this->heartbeatStreamServices = $heartbeatstream;
     $this->heartbeatService = $heartbeat;
     $this->entityTypeManager = $entity_type_manager;

+ 6 - 6
src/Plugin/Block/HeartbeatFeedBlock.php

@@ -6,7 +6,7 @@ use Drupal\Core\Block\BlockBase;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Database;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\heartbeat\HeartbeatService;
 
@@ -21,11 +21,11 @@ use Drupal\heartbeat\HeartbeatService;
 class HeartbeatFeedBlock extends BlockBase implements ContainerFactoryPluginInterface {
 
     /**
-     * Drupal\heartbeat\HeartbeatTypeServices definition.
+     * Drupal\heartbeat\HeartbeatTypeService definition.
      *
-     * @var \Drupal\heartbeat\HeartbeatTypeServices
+     * @var \Drupal\heartbeat\HeartbeatTypeService
      */
-    protected $heartbeatTypeServices;
+    protected $heartbeatTypeService;
     /**
      * Drupal\heartbeat\HeartbeatStreamServices definition.
      *
@@ -52,13 +52,13 @@ class HeartbeatFeedBlock extends BlockBase implements ContainerFactoryPluginInte
         array $configuration,
         $plugin_id,
         $plugin_definition
-//        HeartbeatTypeServices $heartbeat_heartbeattype,
+//        HeartbeatTypeService $heartbeat_heartbeattype,
 //        HeartbeatStreamServices $heartbeatstream,
 //        HeartbeatService $heartbeat
     ) {
 
         parent::__construct($configuration, $plugin_id, $plugin_definition);
-//        $this->heartbeatTypeServices = $heartbeat_heartbeattype;
+//        $this->heartbeatTypeService = $heartbeat_heartbeattype;
 //        $this->heartbeatStreamServices = $heartbeatstream;
 //        $this->heartbeatService = $heartbeat;
     }

+ 6 - 6
src/Plugin/Block/HeartbeatHashBlock.php

@@ -17,7 +17,7 @@ use Drupal\file\Entity\File;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Database;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\heartbeat\HeartbeatService;
 
@@ -33,11 +33,11 @@ use Drupal\heartbeat\HeartbeatService;
 class HeartbeatHashBlock extends BlockBase implements ContainerFactoryPluginInterface {
 
   /**
-   * Drupal\heartbeat\HeartbeatTypeServices definition.
+   * Drupal\heartbeat\HeartbeatTypeService definition.
    *
-   * @var \Drupal\heartbeat\HeartbeatTypeServices
+   * @var \Drupal\heartbeat\HeartbeatTypeService
    */
-  protected $heartbeatTypeServices;
+  protected $heartbeatTypeService;
   /**
    * Drupal\heartbeat\HeartbeatStreamServices definition.
    *
@@ -75,12 +75,12 @@ class HeartbeatHashBlock extends BlockBase implements ContainerFactoryPluginInte
         array $configuration,
         $plugin_id,
         $plugin_definition,
-        HeartbeatTypeServices $heartbeat_heartbeattype,
+        HeartbeatTypeService $heartbeat_heartbeattype,
 	HeartbeatStreamServices $heartbeatstream,
 	HeartbeatService $heartbeat, EntityTypeManager $entity_type_manager, DateFormatter $date_formatter, FlagService $flag_service, FormBuilder $form_builder
   ) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
-    $this->heartbeatTypeServices = $heartbeat_heartbeattype;
+    $this->heartbeatTypeService = $heartbeat_heartbeattype;
     $this->heartbeatStreamServices = $heartbeatstream;
     $this->heartbeatService = $heartbeat;
     $this->entityTypeManager = $entity_type_manager;

+ 6 - 6
src/Plugin/Block/HeartbeatMoreBlock.php

@@ -17,7 +17,7 @@ use Drupal\file\Entity\File;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Database;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\heartbeat\HeartbeatService;
 
@@ -33,11 +33,11 @@ use Drupal\heartbeat\HeartbeatService;
 class HeartbeatMoreBlock extends BlockBase implements ContainerFactoryPluginInterface {
 
   /**
-   * Drupal\heartbeat\HeartbeatTypeServices definition.
+   * Drupal\heartbeat\HeartbeatTypeService definition.
    *
-   * @var \Drupal\heartbeat\HeartbeatTypeServices
+   * @var \Drupal\heartbeat\HeartbeatTypeService
    */
-  protected $heartbeatTypeServices;
+  protected $heartbeatTypeService;
   /**
    * Drupal\heartbeat\HeartbeatStreamServices definition.
    *
@@ -75,12 +75,12 @@ class HeartbeatMoreBlock extends BlockBase implements ContainerFactoryPluginInte
         array $configuration,
         $plugin_id,
         $plugin_definition,
-        HeartbeatTypeServices $heartbeat_heartbeattype,
+        HeartbeatTypeService $heartbeat_heartbeattype,
 	HeartbeatStreamServices $heartbeatstream,
 	HeartbeatService $heartbeat, EntityTypeManager $entity_type_manager, DateFormatter $date_formatter, FlagService $flag_service, FormBuilder $form_builder
   ) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
-    $this->heartbeatTypeServices = $heartbeat_heartbeattype;
+    $this->heartbeatTypeService = $heartbeat_heartbeattype;
     $this->heartbeatStreamServices = $heartbeatstream;
     $this->heartbeatService = $heartbeat;
     $this->entityTypeManager = $entity_type_manager;

+ 5 - 5
src/Plugin/Block/HeartbeatUsernameBlock.php

@@ -11,7 +11,7 @@ use Drupal\Core\Url;
 use Drupal\file\Entity\File;
 use Drupal\heartbeat\Entity\Heartbeat;
 use Symfony\Component\DependencyInjection\ContainerInterface;
-use Drupal\heartbeat\HeartbeatTypeServices;
+use Drupal\heartbeat\HeartbeatTypeService;
 use Drupal\heartbeat\HeartbeatStreamServices;
 use Drupal\heartbeat\HeartbeatService;
 use Drupal\Core\Entity\EntityTypeManager;
@@ -29,11 +29,11 @@ use Drupal\flag\FlagService;
 class HeartbeatUsernameBlock extends BlockBase implements ContainerFactoryPluginInterface {
 
   /**
-   * Drupal\heartbeat\HeartbeatTypeServices definition.
+   * Drupal\heartbeat\HeartbeatTypeService definition.
    *
-   * @var \Drupal\heartbeat\HeartbeatTypeServices
+   * @var \Drupal\heartbeat\HeartbeatTypeService
    */
-  protected $heartbeatTypeServices;
+  protected $heartbeatTypeService;
   /**
    * Drupal\heartbeat\HeartbeatStreamServices definition.
    *
@@ -71,7 +71,7 @@ class HeartbeatUsernameBlock extends BlockBase implements ContainerFactoryPlugin
     array $configuration,
     $plugin_id,
     $plugin_definition,
-    HeartbeatTypeServices $heartbeat_heartbeattype,
+    HeartbeatTypeService $heartbeat_heartbeattype,
     HeartbeatStreamServices $heartbeatstream,
     HeartbeatService $heartbeat,
     EntityTypeManager $entity_type_manager,

+ 9 - 4
templates/heartbeat-stream.html.twig

@@ -59,16 +59,20 @@
                 <span class="comment-owner">{{ comment.owner }}
                   <span class="comment-username">{{ comment.username }}</span><br>
                   <span class="comment-ago">{{ comment.timeAgo }}</span>
-                <span class="comment-like">{{ comment.commentLike}}</span></span>
-                <span class="comment-body">{{ comment.body }}</span>
+                </span>
+                <span class="comment-body">{{ comment.body }}
+                  <div class="comment-like">{{ comment.commentLike}}</div>
+                </span>
                 <span class ="sub-comment">
                   {% for subComment in comment.subComments %}
                   <div class="heartbeat-subcomment" id="sub-comment-{{ subComment.id }}">
                     <span class="sub-comment-owner">{{ subComment.owner }}
                       <span class="sub-comment-username">{{ subComment.username }}</span><br>
                       <span class="sub-comment-ago">{{ subComment.timeAgo }}</span>
-                <span class="sub-comment-like">{{ subComment.commentLike}}</span></span>
-                <span class="sub-comment-body">{{ subComment.body }}</span>
+                    </span>
+                    <span class="sub-comment-body">{{ subComment.body }}
+                      <div class="sub-comment-like">{{ subComment.commentLike}}</div>
+                    </span>
                   </div>
                   {% endfor %}
                   {{ comment.reply }}
@@ -82,3 +86,4 @@
   {% endfor %}
   {% endautoescape %}
 </div>
+<div id="heartbeat-friendship-action"></div>