From b718bbe15c1708ae83e7b2ade6492c3cfb382f73 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 12 Aug 2019 03:32:27 +0200 Subject: [PATCH] Fix profile website links --- public/style.css | 2 +- src/views/profile.nim | 2 +- src/views/renderutils.nim | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/style.css b/public/style.css index e6125b3..900fbb4 100644 --- a/public/style.css +++ b/public/style.css @@ -597,7 +597,7 @@ video { float: none; border-radius: 0; position: relative; - width: auto; + width: 100%; background-color: #0f0f0f !important; } diff --git a/src/views/profile.nim b/src/views/profile.nim index deecd22..1f55f79 100644 --- a/src/views/profile.nim +++ b/src/views/profile.nim @@ -33,7 +33,7 @@ proc renderProfileCard*(profile: Profile): VNode = tdiv(class="profile-website"): span: text "🔗 " - a(href=profile.website): text profile.website + linkText(profile.website) tdiv(class="profile-joindate"): span(title=getJoinDateFull(profile)): diff --git a/src/views/renderutils.nim b/src/views/renderutils.nim index 2f501f0..eab66cf 100644 --- a/src/views/renderutils.nim +++ b/src/views/renderutils.nim @@ -19,3 +19,8 @@ proc linkUser*(profile: Profile, class=""): VNode = proc genImg*(url: string; class=""): VNode = buildHtml(): img(src=url.getSigUrl("pic"), class=class, alt="Image") + +proc linkText*(text: string; class=""): VNode = + let url = if "http" notin text: "http://" & text else: text + buildHtml(): + a(href=url, class=class): text text