From 52453748c5957590e746f69bba52fd77d517ba23 Mon Sep 17 00:00:00 2001 From: Anastasiya Shamray Date: Thu, 6 Jul 2023 15:26:21 +0300 Subject: [PATCH] [#5] Update table look Signed-off-by: Anastasiya Shamray --- layouts/shortcodes/proposals_table.html | 108 ++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 8 deletions(-) diff --git a/layouts/shortcodes/proposals_table.html b/layouts/shortcodes/proposals_table.html index 8bd0d53..ea36b08 100644 --- a/layouts/shortcodes/proposals_table.html +++ b/layouts/shortcodes/proposals_table.html @@ -12,12 +12,12 @@ {{ end }} {{ if eq $is_exists 1 }} - +
- - - + + + @@ -25,12 +25,104 @@ {{ if gt (len (findRE $active_status $page.Params.status)) 0 }} {{ if gt (len (findRE (print "/" $active_category "/") $page.File)) 0 }} - - + - - + {{ end }} {{ end }}
StatusPEPAuthorsStatusPEPAuthors
{{ $page.Params.status }} + {{ substr $page.Params.status 0 1 }}{{ substr $page.Params.type 0 1 }} + {{ $page.Params.status }}, {{ $page.Params.type }} + {{ $page.Title }} {{ $page.Params.author }} +
+ {{ 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))) " " }} + + + {{ if $initialEmail }} + {{ $nameWithoutEmail }} + + {{ $email := slicestr $initialEmail 1 (sub (len $initialEmail) 1) }} +
+ + {{ $email }} +
+
+ {{ else if ($initialLogin) }} + {{ $nameWithoutLogin }} + + {{ $login := slicestr $initialLogin 1 (sub (len $initialLogin) 1) }} + {{ $linkLogin := trim $login "@" }} +
+ + {{ $login }} +
+
+ {{ else if ($initialLink) }} + {{ $nameWithoutLink }} + + {{ $link := slicestr $initialLink 1 (sub (len $initialLink) 1) }} +
+ + {{ $link }} +
+
+ {{ else }} + {{ $elem_val }} + {{ end }} +
+ {{ if gt (sub (len $page.Params.author) 1) $elem_index }} + , + {{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))) " " }} + + + {{ if $initialEmail }} + {{ $nameWithoutEmail }} + + {{ $email := slicestr $initialEmail 1 (sub (len $initialEmail) 1) }} +
+ + {{ $email }} +
+
+ {{ else if ($initialLogin) }} + {{ $nameWithoutLogin }} + + {{ $login := slicestr $initialLogin 1 (sub (len $initialLogin) 1) }} + {{ $linkLogin := trim $login "@" }} +
+ + {{ $login }} +
+
+ {{ else if ($initialLink) }} + {{ $nameWithoutLink }} + + {{ $link := slicestr $initialLink 1 (sub (len $initialLink) 1) }} +
+ + {{ $link }} +
+
+ {{ else }} + {{ $page.Params.author }} + {{ end }} +
+ {{ end }} +
+