Ver código fonte

login studio dscription, fixe #432

Bachir Soussi Chiadmi 4 anos atrás
pai
commit
c6ce9f691c

+ 40 - 0
web/modules/custom/edlp_studio/src/Plugin/Block/StudioUserLoginBlock.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\edlp_studio\Plugin\Block;
+
+// use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+// use Drupal\Core\Routing\RedirectDestinationTrait;
+// use Drupal\Core\Routing\RouteMatchInterface;
+// use Drupal\Core\Url;
+// use Drupal\Core\Session\AccountInterface;
+// use Drupal\Core\Block\BlockBase;
+use Drupal\user\Plugin\Block\UserLoginBlock;
+// use Drupal\user\UserInterface;
+// use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Provides a 'User login' block.
+ *
+ * @Block(
+ *   id = "studio_user_login_block",
+ *   admin_label = @Translation("Studio User login"),
+ *   category = @Translation("Forms")
+ * )
+ */
+class StudioUserLoginBlock extends UserLoginBlock implements ContainerFactoryPluginInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function build() {
+    $build = parent::build();
+    // dpm($build);
+    array_unshift($build, ["studio_description" => [
+      "#markup" => '<span class="studio-description">' . t('The studio displays your bookmarked sounds. You can save them and create your own playlists') . '</span>'
+      ]]);
+    return $build;
+  }
+
+
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
web/themes/custom/edlptheme/assets/dist/styles/app.min.css


+ 13 - 1
web/themes/custom/edlptheme/assets/styles/app.scss

@@ -2267,7 +2267,8 @@ footer{
     @include iconlinkblock(url(../img/studio.svg), url(../img/studio-active.svg));
   }
 
-  #block-userlogin{
+  #block-userlogin,
+  #block-studiouserlogin{
     margin-bottom: 1em;
     pointer-events: all;
     margin-left: 0.2em;
@@ -2306,11 +2307,16 @@ footer{
       pointer-events:none;
       transition: all 0.5s ease-in-out;
       transition-property: height,opacity;
+      transition-delay: 2s;
       // &:hover{
       //   height:200px;
       //   opacity:1;
       //   pointer-events: auto;
       // }
+      span.studio-description{
+        font-size: 0.75em;
+        text-align: justify;
+      }
       form{
         font-size: 0.75em;
       }
@@ -2333,6 +2339,12 @@ footer{
         height:200px;
         opacity: 1;
         pointer-events:auto;
+        transition-delay: 0s;
+      }
+    }
+    &#block-studiouserlogin:hover{
+      .block-content{
+        height:300px;
       }
     }
   }

+ 41 - 0
web/themes/custom/edlptheme/templates/block/block--studiouserlogin.html.twig

@@ -0,0 +1,41 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display a block.
+ *
+ * Available variables:
+ * - plugin_id: The ID of the block implementation.
+ * - label: The configured label of the block if visible.
+ * - configuration: A list of the block's configuration values.
+ *   - label: The configured label for the block.
+ *   - label_display: The display settings for the label.
+ *   - provider: The module or other provider that provided this block plugin.
+ *   - Block plugin specific settings will also be stored here.
+ * - content: The content of this block.
+ * - attributes: array of HTML attributes populated by modules, intended to
+ *   be added to the main container tag of this template.
+ *   - id: A valid HTML ID and guaranteed unique.
+ * - title_attributes: Same as attributes, except applied to the main title
+ *   tag that appears in the template.
+ * - title_prefix: Additional output populated by modules, intended to be
+ *   displayed in front of the main title tag that appears in the template.
+ * - title_suffix: Additional output populated by modules, intended to be
+ *   displayed after the main title tag that appears in the template.
+ *
+ * @see template_preprocess_block()
+ *
+ * @ingroup themeable
+ */
+#}
+<div{{ attributes }}>
+  {{ title_prefix }}
+  {% if label %}
+    <h2{{ title_attributes }}>{{ label }}</h2>
+  {% endif %}
+  {{ title_suffix }}
+  <div class="block-content">
+    {% block content %}
+      {{ content }}
+    {% endblock %}
+  </div>
+</div>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff