Commit 05228f86 authored by Stefan Busemann's avatar Stefan Busemann

Merge branch '91-list-view-for-user-profiles' into 'develop'

Resolve "List view for user profiles"

Closes #91

See merge request !130
parents f6148666 a931463d
Pipeline #6250 passed with stages
in 2 minutes and 28 seconds
File added
<?php
declare(strict_types = 1);
namespace T3o\T3omy\ViewHelpers;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Class IsSlackOnlineViewhelper
*/
class IsSlackOnlineViewhelper extends AbstractViewHelper
{
/**
* @var \T3o\T3oSlack\Domain\Repository\SlackUserRepository
* @inject
*/
public $slackUserRepository;
/**
* @var \T3o\T3oSlack\Domain\Repository\SlackFrontendUserRepository
* @inject
*/
public $slackFrontendUserRepository;
/**
* Checks if the user is online in slack
*
* @param int $frontendUserUID
* @return string
*/
public function render($frontendUserUID)
{
$feUser = $this->slackFrontendUserRepository->findByUid($frontendUserUID);
$slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId());
if ($slackUser) {
$slackUser->getPresence();
if ($slackUser->getPresence() === 'active') {
$status = 'slack-online';
} else {
$status = 'slack-offline';
}
} else {
$status = 'no-slack';
}
return $status;
}
}
......@@ -3,6 +3,9 @@ plugin.tx_userprofile {
templateRootPaths {
20 = EXT:t3omy/Resources/Private/Templates/UserProfile/
}
partialRootPaths {
20 = EXT:t3omy/Resources/Private/Partials/UserProfile/
}
}
settings {
privacy {
......
{namespace userprofile=In2code\Userprofile\ViewHelpers}
{namespace t3omy=T3o\T3omy\ViewHelpers}
<f:comment>
<f:debug>{frontendUser.uid}</f:debug>
<f:debug title="FE USer:{frontendUser.uid}">{t3omy:isSlackOnline(frontendUserUID:'{frontendUser.uid}')}</f:debug>
</f:comment>
<f:link.action class="user-box" controller="UserProfile" action="show" arguments="{user:frontendUser}">
<div class="user-box-image ">
<f:if condition="{frontendUser.image} AND {userprofile:isPropertyVisible(propertyName: 'image', user: '{frontendUser}')}">
<f:then>
<f:for each="{frontendUser.image}" as="file" iteration="iter">
<f:if condition="{iter.isFirst}">
<f:media class="img-fluid rounded-circle"
file="{file}"
width="150px"
height="150px"
alt="{file.alternative}"
title="{file.title}" />
</f:if>
</f:for>
</f:then>
<f:else>
<f:image class="img-fluid rounded-circle"
src="EXT:t3omy/Resources/Public/Images/UserProfile/UserProfile-Blank.svg"
width="150px"
height="150px"
alt="User Image Placeholder"/>
</f:else>
</f:if>
</div>
<div class="user-box-text ">
<f:if condition="{frontendUser.name} AND {userprofile:isPropertyVisible(propertyName: 'name', user: '{frontendUser}')}">
<h4 class="user-box-text__name text-uppercase text-large">{frontendUser.name}</h4>
{f:variable(name:"hasHeading", value:"1")}
</f:if>
<f:if condition="{frontendUser.company} AND {userprofile:isPropertyVisible(propertyName: 'company', user: '{frontendUser}')}">
<h5 class="user-box-text__company text-large">{frontendUser.company}</h5>
{f:variable(name:"hasHeading", value:"1")}
</f:if>
<f:if condition="{hasHeading} == 1">
<hr class="hr">
</f:if>
<f:if condition="{frontendUser.email} AND {userprofile:isPropertyVisible(propertyName: 'email', user: '{frontendUser}')}">
<div class="user-box-text__icon">
<i class="fa fa-envelope"></i>
<span>{frontendUser.email}</span>
</div>
</f:if>
<f:if condition="{frontendUser.telephone} AND {userprofile:isPropertyVisible(propertyName: 'telephone', user: '{frontendUser}')}">
<div class="user-box-text__icon">
<i class="fa fa-phone"></i>
<span>{frontendUser.telephone}</span>
</div>
</f:if>
</div>
<div class="user-box-badge {t3omy:isSlackOnline(frontendUserUID:'{frontendUser.uid}')}">
<i class="fa fa-2x fa-slack" aria-hidden="true"></i>
</div>
</f:link.action>
<section class="container">
<h1>Our community</h1>
<f:debug>{frontendUsers}</f:debug>
<table>
<div class="row">
<f:for each="{frontendUsers}" as="frontendUser">
<f:if condition="{frontendUser.publicProfile}">
<tr>
<td><f:link.action controller="UserProfile" action="show" arguments="{user:frontendUser}">{frontendUser.username}</f:link.action></td>
</tr>
<div class="col-lg-6">
<f:render partial="ListUser" arguments="{_all}"/>
</div>
</f:if>
</f:for>
</table>
</div>
</section>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 53 (72520) - https://sketchapp.com -->
<title>Shape</title>
<desc>Created with Sketch.</desc>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="member-list/box/no-member-picture" transform="translate(-19.000000, -18.000000)" fill="#515151" fill-rule="nonzero">
<g id="picture" transform="translate(19.000000, 18.000000)">
<g id="user-circle">
<path d="M60,0 C26.8548387,0 0,26.8548387 0,60 C0,93.1451613 26.8548387,120 60,120 C93.1451613,120 120,93.1451613 120,60 C120,26.8548387 93.1451613,0 60,0 Z M60,23.2258065 C71.7580645,23.2258065 81.2903226,32.7580645 81.2903226,44.516129 C81.2903226,56.2741935 71.7580645,65.8064516 60,65.8064516 C48.2419355,65.8064516 38.7096774,56.2741935 38.7096774,44.516129 C38.7096774,32.7580645 48.2419355,23.2258065 60,23.2258065 Z M60,106.451613 C45.7983871,106.451613 33.0725806,100.016129 24.5564516,89.9516129 C29.1048387,81.3870968 38.0080645,75.483871 48.3870968,75.483871 C48.9677419,75.483871 49.5483871,75.5806452 50.1048387,75.75 C53.25,76.766129 56.5403226,77.4193548 60,77.4193548 C63.4596774,77.4193548 66.7741935,76.766129 69.8951613,75.75 C70.4516129,75.5806452 71.0322581,75.483871 71.6129032,75.483871 C81.9919355,75.483871 90.8951613,81.3870968 95.4435484,89.9516129 C86.9274194,100.016129 74.2016129,106.451613 60,106.451613 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment