[#5] Update table look

Signed-off-by: Anastasiya Shamray <a.shamray@yadro.com>
This commit is contained in:
Anastasiya Shamray 2023-07-06 15:26:21 +03:00
parent d35dd93c22
commit 52453748c5

View file

@ -12,12 +12,12 @@
{{ end }} {{ end }}
{{ if eq $is_exists 1 }} {{ if eq $is_exists 1 }}
<table> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Status</th> <th class="table-th">Status</th>
<th>PEP</th> <th class="table-th">PEP</th>
<th>Authors</th> <th class="table-th">Authors</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -25,12 +25,104 @@
{{ if gt (len (findRE $active_status $page.Params.status)) 0 }} {{ if gt (len (findRE $active_status $page.Params.status)) 0 }}
{{ if gt (len (findRE (print "/" $active_category "/") $page.File)) 0 }} {{ if gt (len (findRE (print "/" $active_category "/") $page.File)) 0 }}
<tr> <tr>
<th>{{ $page.Params.status }}</th> <th class="table-th status">{{ substr $page.Params.status 0 1 }}{{ substr $page.Params.type 0 1 }}
<th> <span class="tooltiptext">{{ $page.Params.status }}, {{ $page.Params.type }}</span>
</th>
<th class="table-th">
<a href="{{ $page.Permalink }}">{{ $page.Title }}</a> <a href="{{ $page.Permalink }}">{{ $page.Title }}</a>
</th> </th>
<th>{{ $page.Params.author }}</th> <th class="table-th">
<!-- <th>{{ $page.Lastmod }}</th> --> <div class="authors">
{{ if (isset $page.Params.author 0) }}
{{ range $elem_index, $elem_val := $page.Params.author }}
{{ $initialEmail := delimit (findRE `<.*@.*>` $elem_val) "" }}
{{ $initialLogin := delimit (findRE `\(@.*\)` $elem_val) "" }}
{{ $initialLink := delimit (findRE `\([^@].*\)` $elem_val) "" }}
{{ $nameWithoutEmail := trim (substr $elem_val 0 (sub (len $elem_val) (len $initialEmail))) " " }}
{{ $nameWithoutLogin := trim (substr $elem_val 0 (sub (len $elem_val) (len $initialLogin))) " " }}
{{ $nameWithoutLink := trim (substr $elem_val 0 (sub (len $elem_val) (len $initialLink))) " " }}
<span class="author-name">
{{ if $initialEmail }}
{{ $nameWithoutEmail }}
<span class="tooltiptext">
{{ $email := slicestr $initialEmail 1 (sub (len $initialEmail) 1) }}
<div class="author-contact">
<i class="ti-email"></i>
<a href="mailto:{{ $email }}">{{ $email }}</a>
</div>
</span>
{{ else if ($initialLogin) }}
{{ $nameWithoutLogin }}
<span class="tooltiptext">
{{ $login := slicestr $initialLogin 1 (sub (len $initialLogin) 1) }}
{{ $linkLogin := trim $login "@" }}
<div class="author-contact">
<i class="ti-link"></i>
<a href="https://git.frostfs.info/{{ $linkLogin }}" target="_blank">{{ $login }}</a>
</div>
</span>
{{ else if ($initialLink) }}
{{ $nameWithoutLink }}
<span class="tooltiptext">
{{ $link := slicestr $initialLink 1 (sub (len $initialLink) 1) }}
<div class="author-contact">
<i class="ti-new-window"></i>
<a href="https://{{ $link }}" target="_blank">{{ $link }}</a>
</div>
</span>
{{ else }}
{{ $elem_val }}
{{ end }}
</span>
{{ if gt (sub (len $page.Params.author) 1) $elem_index }}
<span class="author-delimiter">, </span>
{{end}}
{{ end }}
{{ else }}
{{ $initialEmail := delimit (findRE `<.*@.*>` $page.Params.author) "" }}
{{ $initialLogin := delimit (findRE `\(@.*\)` $page.Params.author) "" }}
{{ $initialLink := delimit (findRE `\([^@].*\)` $page.Params.author) "" }}
{{ $nameWithoutEmail := trim (substr $page.Params.author 0 (sub (len $page.Params.author) (len $initialEmail))) " " }}
{{ $nameWithoutLogin := trim (substr $page.Params.author 0 (sub (len $page.Params.author) (len $initialLogin))) " " }}
{{ $nameWithoutLink := trim (substr $page.Params.author 0 (sub (len $page.Params.author) (len $initialLink))) " " }}
<span class="author-name">
{{ if $initialEmail }}
{{ $nameWithoutEmail }}
<span class="tooltiptext">
{{ $email := slicestr $initialEmail 1 (sub (len $initialEmail) 1) }}
<div class="author-contact">
<i class="ti-email"></i>
<a href="mailto:{{ $email }}">{{ $email }}</a>
</div>
</span>
{{ else if ($initialLogin) }}
{{ $nameWithoutLogin }}
<span class="tooltiptext">
{{ $login := slicestr $initialLogin 1 (sub (len $initialLogin) 1) }}
{{ $linkLogin := trim $login "@" }}
<div class="author-contact">
<i class="ti-link"></i>
<a href="https://git.frostfs.info/{{ $linkLogin }}" target="_blank">{{ $login }}</a>
</div>
</span>
{{ else if ($initialLink) }}
{{ $nameWithoutLink }}
<span class="tooltiptext">
{{ $link := slicestr $initialLink 1 (sub (len $initialLink) 1) }}
<div class="author-contact">
<i class="ti-new-window"></i>
<a href="https://{{ $link }}" target="_blank">{{ $link }}</a>
</div>
</span>
{{ else }}
{{ $page.Params.author }}
{{ end }}
</span>
{{ end }}
</div>
</th>
</tr> </tr>
{{ end }} {{ end }}
{{ end }} {{ end }}