From 1aa94292dba808a9c8f7e2d685a43331a7d03291 Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Sun, 28 Apr 2024 02:54:18 +0200 Subject: [PATCH] Frontend fixes (#267) * Fix mermaid display * Move Login/Register buttons on mobile * Min width on avatar --- Dockerfile | 2 ++ public/gist.ts | 3 +++ templates/base/base_header.html | 12 +++++++++--- templates/partials/_gist_preview.html | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c71a3e..3b97440 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,8 @@ FROM base AS dev EXPOSE 6157 2222 16157 VOLUME /opengist +RUN git config --global --add safe.directory /opengist + CMD ["make", "watch"] diff --git a/public/gist.ts b/public/gist.ts index 38ecc57..d81c98f 100644 --- a/public/gist.ts +++ b/public/gist.ts @@ -21,6 +21,9 @@ document.querySelectorAll('.table-code').forEach((el) => { let copybtnhtml = ``; document.querySelectorAll('.markdown-body pre').forEach((el) => { + if (el.classList.contains("mermaid")) { + return; + } el.innerHTML = copybtnhtml + `` + el.innerHTML + ``; }); diff --git a/templates/base/base_header.html b/templates/base/base_header.html index 2292087..a77ec19 100644 --- a/templates/base/base_header.html +++ b/templates/base/base_header.html @@ -179,11 +179,11 @@ {{ else }} {{ if not .DisableSignup }} - + {{ end }} - + {{ end }} @@ -252,9 +252,15 @@ {{ .locale.Tr "header.menu.my-gists" }} {{ .locale.Tr "header.menu.settings" }} - {{ if .userLogged.IsAdmin }} + {{ if .userLogged.IsAdmin }} {{ .locale.Tr "header.menu.admin" }} {{ end }} + {{ .locale.Tr "header.menu.logout" }} + {{ else }} + {{ if not .DisableSignup }} + {{ .locale.Tr "header.menu.register" }} + {{ end }} + {{ .locale.Tr "header.menu.login" }} {{ end }} diff --git a/templates/partials/_gist_preview.html b/templates/partials/_gist_preview.html index f4956de..5a435d2 100644 --- a/templates/partials/_gist_preview.html +++ b/templates/partials/_gist_preview.html @@ -5,7 +5,7 @@