Commit c42085c9 authored by Oleksandr Horbatiuk's avatar Oleksandr Horbatiuk 🧩 Committed by serhii.myronets
Browse files

Issue #3275984 by chmez: As a LU I want to have an information rich profile preview

parent 6b29e871
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
 * The primary PHP file for the Social base theme.
 */

use Drupal\Core\Session\AnonymousUserSession;
use Drupal\Core\Language\LanguageInterface;
use Drupal\node\NodeInterface;
use Drupal\Component\Utility\Html;
@@ -188,17 +187,6 @@ function _socialbase_node_get_like_count($type, $id) {

}

/**
 * Implements theme_preprocess_username().
 */
function socialbase_preprocess_username(&$variables) {
  $account = $variables['account'] ?: new AnonymousUserSession();

  // Override the default drupal truncate function for all user names,
  // so the whole name will be displayed.
  $variables['name'] = $account->getDisplayName();
}

/**
 * Implements hook_theme().
 */
+5 −4
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@
 * - attributes: HTML attributes for the wrapper.
 * - profile: The profile object.
 * - url: The profile URL.
 * - link_attributes: HTML attributes for the link.
 * - avatar_attributes: HTML attributes for the link with an avatar.
 * - link_attributes: HTML attributes for the link with a username.
 *
 * @ingroup themeable
 */
@@ -24,14 +25,14 @@

<div class="card__block card__block--list teaser--small">

  <div class='card__text list-item'>
    <a href="{{ profile_home }}" {{ link_attributes }} title={% trans %} profile avatar {% endtrans %}>
  <div class="card__text list-item">
    <a href="{{ profile_home }}" {{ avatar_attributes }} title="{% trans %} profile avatar {% endtrans %}">
      <span class="list-item__avatar list-item__avatar--medium">
        {{ content.field_profile_image }}
      </span>
    </a>

    <a href="{{ profile_home }}" {{ link_attributes }} title={% trans %} profile information {% endtrans %}>
    <a href="{{ profile_home }}" {{ link_attributes }} title="{% trans %} profile information {% endtrans %}">
      <span class="list-item__text">
        <span class="teaser--small__title">
          {{ profile_name }}