Lint
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
688e10e230
commit
4651a4cb96
|
@ -72,9 +72,9 @@ class MemberData extends Data
|
||||||
return $this->zip . ' ' . $this->location;
|
return $this->zip . ' ' . $this->location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function age(): string
|
public function age(): int
|
||||||
{
|
{
|
||||||
return $this->birthday ? intval($this->birthday->diffInYears(now())) : '';
|
return intval($this->birthday->diffInYears(now()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function birthYear(): string
|
public function birthYear(): string
|
||||||
|
|
|
@ -3,14 +3,15 @@
|
||||||
namespace App\Contribution\Documents;
|
namespace App\Contribution\Documents;
|
||||||
|
|
||||||
use App\Contribution\Data\MemberData;
|
use App\Contribution\Data\MemberData;
|
||||||
|
use App\Contribution\Traits\FormatsDates;
|
||||||
use App\Contribution\Traits\HasPdfBackground;
|
use App\Contribution\Traits\HasPdfBackground;
|
||||||
use App\Country;
|
use App\Country;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
class RdpNrwDocument extends ContributionDocument
|
class RdpNrwDocument extends ContributionDocument
|
||||||
{
|
{
|
||||||
use HasPdfBackground;
|
use HasPdfBackground;
|
||||||
|
use FormatsDates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection<int, Collection<int, MemberData>> $members
|
* @param Collection<int, Collection<int, MemberData>> $members
|
||||||
|
@ -28,13 +29,6 @@ class RdpNrwDocument extends ContributionDocument
|
||||||
$this->setEventName($eventName);
|
$this->setEventName($eventName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dateRange(): string
|
|
||||||
{
|
|
||||||
return Carbon::parse($this->dateFrom)->format('d.m.Y')
|
|
||||||
. ' - '
|
|
||||||
. Carbon::parse($this->dateUntil)->format('d.m.Y');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@ -70,35 +64,6 @@ class RdpNrwDocument extends ContributionDocument
|
||||||
return $this->country->name;
|
return $this->country->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function memberShort(MemberData $member): string
|
|
||||||
{
|
|
||||||
return $member->isLeader ? 'L' : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function memberName(MemberData $member): string
|
|
||||||
{
|
|
||||||
return $member->separatedName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function memberAddress(MemberData $member): string
|
|
||||||
{
|
|
||||||
return $member->fullAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function memberGender(MemberData $member): string
|
|
||||||
{
|
|
||||||
if (!$member->gender) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return strtolower(substr($member->gender->name, 0, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function memberAge(MemberData $member): string
|
|
||||||
{
|
|
||||||
return $member->age();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getName(): string
|
public static function getName(): string
|
||||||
{
|
{
|
||||||
return 'RdP NRW';
|
return 'RdP NRW';
|
||||||
|
|
|
@ -16,4 +16,9 @@ trait FormatsDates
|
||||||
{
|
{
|
||||||
return Carbon::parse($this->dateUntil)->format('d.m.Y');
|
return Carbon::parse($this->dateUntil)->format('d.m.Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dateRange(): string
|
||||||
|
{
|
||||||
|
return implode(' - ', [$this->niceDateFrom(), $this->niceDateUntil()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
@foreach($chunk as $i => $member)
|
@foreach($chunk as $i => $member)
|
||||||
\node[anchor=base, text width=7.75mm, align=center] at ($(16.35mm, 76.6mm + 7mm * <<<$i % 17>>>)$) {<<<$i+1>>>};
|
\node[anchor=base, text width=7.75mm, align=center] at ($(16.35mm, 76.6mm + 7mm * <<<$i % 17>>>)$) {<<<$i+1>>>};
|
||||||
\node[anchor=base, text width=18mm, align=center] at ($(32.55mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$memberShort($member)>>>};
|
\node[anchor=base, text width=18mm, align=center] at ($(32.55mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$member->isLeader ? 'L' : ''>>>};
|
||||||
\node[anchor=base, text width=70mm, align=center] at ($(80.25mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$memberName($member)>>>};
|
\node[anchor=base, text width=70mm, align=center] at ($(80.25mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$member->separatedName()>>>};
|
||||||
\node[anchor=base, text width=118mm, align=center] at ($(178.25mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$memberAddress($member)>>>};
|
\node[anchor=base, text width=118mm, align=center] at ($(178.25mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$member->fullAddress()>>>};
|
||||||
\node[anchor=base, text width=16mm, align=center] at ($(249.50mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$memberGender($member)>>>};
|
\node[anchor=base, text width=16mm, align=center] at ($(249.50mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$member->genderLetter()>>>};
|
||||||
\node[anchor=base, text width=16mm, align=center] at ($(269.50mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$memberAge($member)>>>};
|
\node[anchor=base, text width=16mm, align=center] at ($(269.50mm, 76.6mm + 7mm * <<<$i%17>>>)$) {<<<$member->age()>>>};
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
\end{tikzpicture}
|
\end{tikzpicture}
|
||||||
|
|
Loading…
Reference in New Issue