aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'cgi')
-rwxr-xr-xcgi/user.cgi28
1 files changed, 13 insertions, 15 deletions
diff --git a/cgi/user.cgi b/cgi/user.cgi
index e1c4d70..7336a15 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.table(class: "toplinks") {
$cgi.tr {
- $cgi.td { llink("/" , "Home" ) } +
- $cgi.td { llink("/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
@@ -76,8 +72,10 @@ def page(title, jumbotitle = title)
$cgi.link(rel: "stylesheet", href: "styles.css")
} +
$cgi.body {
- $cgi.h1("class" => "jumbo") { jumbotitle } +
- $cgi.div { toplinks } +
+ $cgi.div(class: "pagetop") {
+ $cgi.h1(class: "jumbo") { jumbotitle } +
+ toplinks
+ } +
$page +
$cgi.div(id: "quote") { rquote }
}