diff options
Diffstat (limited to 'cgi/user.cgi')
| -rwxr-xr-x | cgi/user.cgi | 79 |
1 files changed, 22 insertions, 57 deletions
diff --git a/cgi/user.cgi b/cgi/user.cgi index e1c4d70..b95034e 100755 --- a/cgi/user.cgi +++ b/cgi/user.cgi @@ -2,83 +2,44 @@ 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 { llink("/eamit.html" , "Eamit" ) } + - $cgi.td { rlink("https://git.4574.co.uk/", "Git" ) } + - $cgi.td { llink("/stuff-i-want" , "Stuff I Want") } - } + $cgi.ul(class: "toplinks") { + $cgi.li { link("/" , "Home" ) } + + $cgi.li { link("/bins" , "Bins" ) } + + $cgi.li { link("/shelf" , "Shelf" ) } + + $cgi.li { link("/eamit.html" , "eamit" , true) } + + $cgi.li { link("https://git.4574.co.uk/", "Git" , true) } + + $cgi.li { link("/stuff-i-want" , "Stuff I Want" ) } } end def rquote - [ - "~ sweet ~", - "User_4574 uses Linux, and loves life.", - "User_4574 shall arrange the blocks and toil, for ever and a day.", - "User_4574 likes the number 7.", - "ex scientia veritas", - "User_4574 will blow things up for money.", - "User_4574 dreams it possible.", - "(define (! ?) (? ?)) (! !)", - "User_4574 lets her pain fade down.", - "User_4574 maintains vigilance during disablement conditions.", - "User_4574 is established on the localiser.", - "Memetic Hazard.", - "Every six months User_4574 checks the oil level of the drive housing, and if necessary tops up with IBM 15 to the level of the inspection hole.", - "User_4574 remembers tomorrow.", - "User_4574 <3s OpenBSD", - "Expectation is directly proportional to performance.", - "User_4574 is taking hits! Hull strength falling.", - "User_4574 is not on fire.", - "User_4574 syncs on green.", - "User_4574 always reads the plaque.", - "User_4574's work ethic is IEFBR14.", - "User_4574 clears the link pack area.", - "vivat diu et prosperet.", - "The White Zone is for loading and unloading only.", - "User_4574 copies run start.", - "User_4574 shows standby brie.", - "All hail the glow cloud.", - "User_4574 tries at all times, without surrender, to be on good terms with all people.", - "This is Delta Team. All production is down, repeat, all production is down.", - "User_4574 glows in the dark turning dust to gold.", - "NAT is evil.", - "User_4574 chooses to have the ball in hand behind the headstring.", - "User_4574 likes to think she could make Knuth cry if she wanted to.", - "Due to a lack of interest, tomorrow has been cancelled. We apologize for any inconvenience caused.", - "This is the panic office: Section 9-17 may have been hit. Activate the following procedure.", - "Nothing, and everything, is possimpable." - ].sample + File.readlines("../inc/quotes.txt").sample.strip end def page(title, jumbotitle = title) load "#{title.downcase.gsub(?\s, ?-)}.cgi" $cgi.out { - $cgi.html { + $cgi.html(lang: "en") { $cgi.head { $cgi.title { "User_4574's Lair / #{title}" } + $cgi.link(rel: "stylesheet", href: "styles.css") } + $cgi.body { - $cgi.h1("class" => "jumbo") { jumbotitle } + - $cgi.div { toplinks } + - $page + + $cgi.div(class: "pagetop") { + $cgi.h1(class: "jumbo") { jumbotitle } + + toplinks + } + + $cgi.div { $page } + $cgi.div(id: "quote") { rquote } } } @@ -90,6 +51,10 @@ $cgi = CGI.new("html5") case $cgi.path_info when "/" page("Home", "User_4574's Lair") +when "/bins" + page("Bins") +when "/shelf" + page("Whisky Shelf") when /^\/stuff-i-want/ page("Stuff I Want") when /^\/bv/ |
