diff options
-rwxr-xr-x | cgi/user.cgi | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cgi/user.cgi b/cgi/user.cgi index 1f845ab..1d7ebea 100755 --- a/cgi/user.cgi +++ b/cgi/user.cgi @@ -2,25 +2,21 @@ require 'cgi' -def llink(href, text) - if $cgi.path_info == href - $cgi.a(href) { "[ #{text} ⇓ ]" } +def link(href, text, remote = false) + if remote + $cgi.a(href: href, target: "_blank") { "[ #{text} ] " } else - $cgi.a(href) { "[ #{text} ]" } + $cgi.a(href: href) { "[ #{text} ] " } end end -def rlink(href, text) - $cgi.a(href: href, target: "_blank") { "[ #{text} ⇗ ] " } -end - def toplinks $cgi.table(id: "toplinks") { $cgi.tr { - $cgi.td { llink("/" , "Home" ) } + - $cgi.td { rlink("/eamit.html" , "eamit" ) } + - $cgi.td { rlink("https://git.4574.co.uk/", "Git" ) } + - $cgi.td { llink("/stuff-i-want" , "Stuff I Want") } + $cgi.td { link("/" , "Home" ) } + + $cgi.td { link("/eamit.html" , "eamit" , true) } + + $cgi.td { link("https://git.4574.co.uk/", "Git" , true) } + + $cgi.td { link("/stuff-i-want" , "Stuff I Want" ) } } } end |