2023-03-14 15:22:52 +00:00
{{ define "header" }}
<!DOCTYPE html>
< html lang = "en" class = "h-full" >
< head >
< meta charset = "UTF-8" / >
2023-07-17 01:58:45 +00:00
{{ if .NoIndex }}
< meta name = "robots" content = "noindex, follow" >
{{ end }}
2024-01-02 04:11:49 +00:00
< base href = "{{ $.c.ExternalUrl }}" / >
2023-06-01 17:04:12 +00:00
< script >
2024-01-02 04:11:49 +00:00
window.opengist_base_url = "{{ $.c.ExternalUrl }}";
2024-05-04 22:24:25 +00:00
window.opengist_locale = "{{ .locale.Code }}".substring(0, 2);
2023-06-01 17:04:12 +00:00
const checkTheme = () => {
if (localStorage.theme === 'dark' || (!('theme' in localStorage) & & window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
}
checkTheme()
window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', ({matches}) => {
checkTheme()
}
)
< / script >
2024-01-20 22:46:47 +00:00
{{ if $.c.CustomFavicon }}
< link rel = "icon" type = "image/png" sizes = "32x32" href = "{{ custom $.c.CustomFavicon }}" >
{{ else }}
< link rel = "icon" type = "image/png" sizes = "32x32" href = "{{ asset " favicon-32 . png " } } " >
{{ end }}
2023-03-14 15:22:52 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
2023-09-05 13:22:09 +00:00
{{ if dev }}
< script type = "module" src = "{{ asset " @ vite / client " } } " > < / script >
2023-12-21 19:00:04 +00:00
< link rel = "stylesheet" href = "{{ asset " style . scss " } } " / >
2023-09-05 13:22:09 +00:00
< script type = "module" src = "{{ asset " main . ts " } } " > < / script >
{{ else }}
< link rel = "stylesheet" href = "{{ asset " main . css " } } " / >
< script type = "module" src = "{{ asset " main . ts " } } " > < / script >
{{ end }}
2023-03-14 15:22:52 +00:00
{{ if .htmlTitle }}
< title > {{ .htmlTitle }} - Opengist< / title >
{{ else }}
< title > Opengist< / title >
{{ end }}
< / head >
< body class = "h-full" >
2023-05-27 11:58:08 +00:00
< div id = "app" class = "text-gray-700 dark:text-white min-h-full bg-white dark:bg-gray-900" >
2023-03-14 15:22:52 +00:00
< div class = "min-h-full" >
2023-05-27 11:58:08 +00:00
< nav class = "dark:bg-gray-800 bg-gray-50" >
2023-09-06 21:36:44 +00:00
< div class = "max-w-5xl mx-auto px-2 sm:px-6 lg:px-8" >
2023-03-14 15:22:52 +00:00
< div class = "relative flex items-center justify-between h-16" >
< div class = "absolute inset-y-0 left-0 flex items-center sm:hidden" >
<!-- Mobile menu button -->
2023-05-27 11:58:08 +00:00
< button id = "main-menu-button" type = "button" class = "inline-flex items-center justify-center p-2 rounded-md text-slate-600 dark:text-slate-400 hover:text-black dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" aria-controls = "mobile-menu" aria-expanded = "false" >
2023-03-14 15:22:52 +00:00
< span class = "sr-only" > Open main menu< / span >
< svg id = "main-menu-open" class = "block h-6 w-6" xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" aria-hidden = "true" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M4 6h16M4 12h16M4 18h16" / >
< / svg >
< svg id = "main-menu-close" class = "hidden h-6 w-6" xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" aria-hidden = "true" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M6 18L18 6M6 6l12 12" / >
< / svg >
< / button >
< / div >
2023-09-19 13:48:19 +00:00
< div class = "flex-shrink-0 items-center hidden sm:flex" >
< a href = "{{ $.c.ExternalUrl }}/" >
2024-01-20 22:46:47 +00:00
{{ if $.c.CustomLogo }}
< img src = "{{ custom $.c.CustomLogo }}" class = "object-cover h-12" >
{{ else }}
< img src = "{{ asset " opengist . svg " } } " class = "object-cover h-12 w-12" >
{{ end }}
2023-09-19 13:48:19 +00:00
< / a >
< / div >
2023-03-14 15:22:52 +00:00
< div class = "flex-1 flex items-center justify-center sm:items-stretch sm:justify-start" >
2023-09-19 13:48:19 +00:00
< div class = "flex-shrink-0 items-center flex sm:hidden" >
2023-07-03 14:31:12 +00:00
< a href = "{{ $.c.ExternalUrl }}/" >
2024-01-20 22:46:47 +00:00
{{ if $.c.CustomLogo }}
< img src = "{{ custom $.c.CustomLogo }}" class = "object-cover h-12" >
{{ else }}
< img src = "{{ asset " opengist . svg " } } " class = "object-cover h-12 w-12" >
{{ end }}
2023-09-19 13:48:19 +00:00
< / a >
2023-03-14 15:22:52 +00:00
< / div >
< div class = "hidden sm:block sm:ml-6" >
< div class = "flex space-x-4" >
2023-09-22 15:26:09 +00:00
< a href = "{{ $.c.ExternalUrl }}/all" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white px-3 py-2 rounded-md text-sm font-medium" > {{ .locale.Tr "header.menu.all" }}< / a >
< a href = "{{ $.c.ExternalUrl }}/{{ if not .userLogged }}login{{ end }}" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white px-3 py-2 rounded-md text-sm font-medium" > {{ .locale.Tr "header.menu.new" }}< / a >
2023-06-21 16:19:17 +00:00
< div class = "flex flex-1 items-center justify-center px-2 lg:ml-6 lg:justify-end" >
< div class = "w-full max-w-lg lg:max-w-xs" >
2023-09-22 15:26:09 +00:00
< label for = "search" class = "sr-only" > {{ .locale.Tr "header.menu.search" }}< / label >
2023-06-21 16:19:17 +00:00
< div class = "relative" >
< div class = "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" >
< svg class = "h-5 w-5 text-gray-400" viewBox = "0 0 20 20" fill = "currentColor" aria-hidden = "true" >
< path fill-rule = "evenodd" d = "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule = "evenodd" / >
< / svg >
< / div >
2024-01-02 04:11:49 +00:00
< form action = "{{ $.c.ExternalUrl }}/search" method = "GET" >
2024-01-04 02:38:15 +00:00
< input id = "search" name = "q" autocomplete = "off" class = "bg-white dark:bg-gray-900 shadow-sm focus:ring-primary-500 focus:border-primary-500 block w-full sm:text-sm border-gray-200 dark:border-gray-700 rounded-md pl-10" placeholder = "{{if indexEnabled}}Code search{{else}}Search{{end}}" type = "search" value = "{{ .searchQuery }}" >
2023-06-21 16:19:17 +00:00
< input type = "submit" hidden = "hidden" >
< / form >
2024-01-04 02:38:15 +00:00
{{if indexEnabled}}
< div id = "search-help" class = "hidden absolute left-1/2 z-10 mt-5 w-screen max-w-max -translate-x-1/2 px-4" >
< div class = "flex-auto overflow-hidden rounded-md bg-white dark:bg-gray-800 text-sm leading-6 border-1 border-gray-100 dark:border-gray-700 ring-1 ring-gray-900/5" >
< div class = "p-4 text-xs space-y-1" >
< p class = "text-gray-400" > < code class = "text-slate-800 dark:text-slate-300 pr-1" > user:thomas< / code > {{ .locale.Tr "gist.search.help.user" }}< / p >
< p class = "text-gray-400" > < code class = "text-slate-800 dark:text-slate-300 pr-1" > title:mygist< / code > {{ .locale.Tr "gist.search.help.title" }}< / p >
< p class = "text-gray-400" > < code class = "text-slate-800 dark:text-slate-300 pr-1" > filename:myfile.txt< / code > {{ .locale.Tr "gist.search.help.filename" }}< / p >
< p class = "text-gray-400" > < code class = "text-slate-800 dark:text-slate-300 pr-1" > extension:yml< / code > {{ .locale.Tr "gist.search.help.extension" }}< / p >
< p class = "text-gray-400" > < code class = "text-slate-800 dark:text-slate-300 pr-1" > language:go< / code > {{ .locale.Tr "gist.search.help.language" }}< / p >
< / div >
< / div >
< / div >
{{end}}
2023-06-21 16:19:17 +00:00
< / div >
< / div >
< / div >
2023-03-14 15:22:52 +00:00
< / div >
< / div >
< / div >
< div class = "absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0" >
{{ if .userLogged }}
2023-06-21 16:19:17 +00:00
< div id = "user-btn" class = "hidden sm:flex items-center ml-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md px-3 py-2" >
< div class = "inline-flex" >
< p class = "hidden sm:block text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white rounded-md text-sm font-medium mr-2" > {{ .userLogged.Username }}< / p >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "h-5 w-5 inline-block" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M19.5 8.25l-7.5 7.5-7.5-7.5" / >
2023-03-14 15:22:52 +00:00
< / svg >
2023-06-21 16:19:17 +00:00
< / div >
< div class = "hidden relative sm:inline-block text-left" >
2023-11-20 17:28:13 +00:00
< div id = "user-menu" class = "hidden w-max font-medium absolute right-0 z-10 mt-12 origin-top-right divide-y dark:divide-gray-600 divide-gray-100 rounded-md dark:bg-gray-800 bg-white shadow-lg ring-1 ring-gray-50 dark:ring-gray-700 focus:outline-none" >
2023-06-21 16:19:17 +00:00
< div class = "py-1" role = "none" >
2023-11-20 17:28:13 +00:00
< a href = "{{ $.c.ExternalUrl }}/{{ .userLogged.Username }}" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 pr-6 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
2023-06-21 16:19:17 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.my-gists" }}
2023-06-21 16:19:17 +00:00
< / a >
2023-11-20 17:28:13 +00:00
< a href = "{{ $.c.ExternalUrl }}/{{ .userLogged.Username }}/liked" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 pr-6 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
2023-06-21 16:19:17 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" fill = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path d = "M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.liked" }}
2023-06-21 16:19:17 +00:00
< / a >
< / div >
{{ if .userLogged.IsAdmin }}
< div class = "py-1" role = "none" >
2023-11-20 17:28:13 +00:00
< a href = "{{ $.c.ExternalUrl }}/admin-panel" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 pr-6 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
2023-06-21 16:19:17 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.admin" }}
2023-06-21 16:19:17 +00:00
< / a >
< / div >
{{ end }}
< div class = "py-1" role = "none" >
2023-11-20 17:28:13 +00:00
< a href = "{{ $.c.ExternalUrl }}/settings" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 pr-6 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
2023-06-21 16:19:17 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z" / >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M15 12a3 3 0 11-6 0 3 3 0 016 0z" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.settings" }}
2023-06-21 16:19:17 +00:00
< / a >
2023-11-20 17:28:13 +00:00
< a href = "{{ $.c.ExternalUrl }}/logout" class = "dark:text-rose-400 text-rose-500 group flex items-center px-3 py-1.5 pr-6 text-sm w-full hover:text-rose-600 dark:hover:text-rose-500" role = "menuitem" tabindex = "-1" >
2023-06-21 16:19:17 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "1.5" stroke = "currentColor" class = "mr-3 h-5 w-5 dark:text-rose-400 text-rose-500 group-hover:text-rose-600 dark:group-hover:text-rose-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.logout" }}
2023-06-21 16:19:17 +00:00
< / a >
< / div >
< / div >
< / div >
< / div >
2023-03-14 15:22:52 +00:00
{{ else }}
2023-04-28 18:31:10 +00:00
{{ if not .DisableSignup }}
2024-04-28 00:54:18 +00:00
< a href = "{{ $.c.ExternalUrl }}/register" class = "hidden sm:inline-flex text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white px-3 py-2 rounded-md text-sm font-medium" >
2023-09-22 15:26:09 +00:00
< p class = "text-slate-700 dark:text-slate-300 mr-1" > {{ .locale.Tr "header.menu.register" }}< / p >
2023-03-14 15:22:52 +00:00
< / a >
{{ end }}
2024-04-28 00:54:18 +00:00
< a href = "{{ $.c.ExternalUrl }}/login" class = "hidden sm:inline-flex hidden-xs text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white px-3 py-2 rounded-md text-sm font-medium" >
2023-09-22 15:26:09 +00:00
< p class = "text-slate-700 dark:text-slate-300 mr-1" > {{ .locale.Tr "header.menu.login" }}< / p >
2023-03-14 15:22:52 +00:00
< / a >
{{ end }}
2023-05-27 18:20:20 +00:00
< div class = "hidden sm:block ml-2 border-l-1 border-gray-200 dark:border-gray-600 rounded-md" > < br / > < / div >
2024-02-24 17:08:59 +00:00
< div id = "theme-btn" class = "sm:flex items-center ml-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md px-3 py-2" >
2023-05-27 11:58:08 +00:00
< div >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "w-5 h-5 text-primary-500 dark:hidden" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" / >
< / svg >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "w-5 h-5 text-primary-500 hidden dark:block" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" / >
< / svg >
< / div >
2024-02-24 17:08:59 +00:00
< div class = "relative sm:inline-block text-left" >
2023-06-21 16:19:17 +00:00
< div id = "theme-menu" class = "hidden font-medium absolute right-0 z-10 mt-12 origin-top-right divide-y dark:divide-gray-600 divide-gray-100 rounded-md dark:bg-gray-800 bg-white shadow-lg ring-1 ring-gray-50 dark:ring-gray-700 focus:outline-none" >
2023-05-27 11:58:08 +00:00
< div class = "py-1" role = "none" >
<!-- Active: "bg - gray - 900 dark:bg - gray - 100 text - white dark:text - gray - 900", Not Active: "text - gray - 300 dark:text - gray - 700" -->
< button id = "light-mode" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.light" }}
2023-05-27 11:58:08 +00:00
< / button >
< button id = "dark-mode" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 text-sm w-full hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.dark" }}
2023-05-27 11:58:08 +00:00
< / button >
2023-12-15 00:57:56 +00:00
< button id = "system-mode" class = "dark:text-slate-300 text-slate-700 group flex items-center px-3 py-1.5 text-sm w-max hover:text-slate-500 dark:hover:text-slate-400" role = "menuitem" tabindex = "-1" >
2023-05-27 11:58:08 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" fill = "none" viewBox = "0 0 24 24" stroke-width = "2" stroke = "currentColor" class = "mr-3 h-5 w-5 text-slate-600 dark:text-slate-400 group-hover:text-slate-500" >
< path stroke-linecap = "round" stroke-linejoin = "round" d = "M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" / >
< / svg >
2023-09-22 15:26:09 +00:00
{{ .locale.Tr "header.menu.system" }}
2023-05-27 11:58:08 +00:00
< / button >
< / div >
< / div >
< / div >
2023-03-14 15:22:52 +00:00
2023-05-27 11:58:08 +00:00
< / div >
2023-03-14 15:22:52 +00:00
< / div >
< / div >
< / div >
<!-- Mobile menu -->
< div class = "sm:hidden hidden" id = "mobile-menu" >
2023-06-21 16:19:17 +00:00
< div class = "mx-2" >
2023-09-22 15:26:09 +00:00
< label for = "searchmobile" class = "sr-only" > {{ .locale.Tr "header.menu.search" }}< / label >
2023-06-21 16:19:17 +00:00
< div class = "relative" >
< div class = "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" >
< svg class = "h-5 w-5 text-gray-400" viewBox = "0 0 20 20" fill = "currentColor" aria-hidden = "true" >
< path fill-rule = "evenodd" d = "M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule = "evenodd" / >
< / svg >
< / div >
2024-01-02 04:11:49 +00:00
< form action = "{{ $.c.ExternalUrl }}/search" method = "GET" >
2023-06-23 11:59:07 +00:00
< input id = "searchmobile" name = "q" class = "bg-white dark:bg-gray-900 shadow-sm focus:ring-primary-500 focus:border-primary-500 block w-full sm:text-sm border-gray-200 dark:border-gray-700 rounded-md pl-10" placeholder = "Search" type = "search" value = "{{.searchQuery}}" >
2023-06-21 16:19:17 +00:00
< input type = "submit" hidden = "hidden" >
< / form >
< / div >
< / div >
2023-03-14 15:22:52 +00:00
< div class = "px-2 pt-2 pb-3 space-y-1" >
2023-09-22 15:26:09 +00:00
< a href = "{{ $.c.ExternalUrl }}/all" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.all" }}< / a >
< a href = "{{ $.c.ExternalUrl }}/{{ if not .userLogged }}login{{ end }}" class = " text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium " > {{ .locale.Tr "header.menu.new" }}< / a >
2023-03-14 15:22:52 +00:00
{{ if .userLogged }}
2023-09-22 15:26:09 +00:00
< a href = "{{ $.c.ExternalUrl }}/{{ .userLogged.Username }}" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.my-gists" }}< / a >
< a href = "{{ $.c.ExternalUrl }}/settings" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.settings" }}< / a >
2023-03-14 15:22:52 +00:00
2024-04-28 00:54:18 +00:00
{{ if .userLogged.IsAdmin }}
2023-09-22 15:26:09 +00:00
< a href = "{{ $.c.ExternalUrl }}/admin-panel" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.admin" }}< / a >
2023-03-14 15:22:52 +00:00
{{ end }}
2024-04-28 00:54:18 +00:00
< a href = "{{ $.c.ExternalUrl }}/logout" class = "dark:text-rose-400 text-rose-500 hover:text-rose-600 dark:hover:text-rose-500 hover:bg-gray-100 dark:hover:bg-gray-700 block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.logout" }}< / a >
{{ else }}
{{ if not .DisableSignup }}
< a href = "{{ $.c.ExternalUrl }}/register" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.register" }}< / a >
{{ end }}
< a href = "{{ $.c.ExternalUrl }}/login" class = "text-slate-700 dark:text-slate-300 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-black dark:hover:text-white block px-3 py-2 rounded-md text-base font-medium" > {{ .locale.Tr "header.menu.login" }}< / a >
2023-03-14 15:22:52 +00:00
{{ end }}
< / div >
< / div >
< / nav >
< / div >
2023-09-06 21:36:44 +00:00
< div class = "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 text-slate-700 dark:text-slate-300" >
2023-03-14 15:22:52 +00:00
< div >
{{range .flashErrors}}
2023-05-27 11:58:08 +00:00
< div class = "mt-4 rounded-md bg-gray-50 dark:bg-gray-800 border-l-4 border-rose-400 p-4" >
2023-03-14 15:22:52 +00:00
< div class = "flex" >
< div class = "flex-shrink-0" >
2023-05-27 11:58:08 +00:00
< svg class = "h-5 w-5 text-rose-600 dark:text-rose-400" xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 20 20" fill = "currentColor" aria-hidden = "true" >
2023-03-14 15:22:52 +00:00
< path fill-rule = "evenodd" d = "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule = "evenodd" / >
< / svg >
< / div >
< div class = "ml-3" >
2023-05-27 11:58:08 +00:00
< p class = "text-sm text-rose-600 dark:text-rose-400" > {{.}}< / p >
2023-03-14 15:22:52 +00:00
< / div >
< / div >
< / div >
{{end}}
{{range .flashSuccess}}
2023-05-27 11:58:08 +00:00
< div class = "mt-4 rounded-md bg-gray-50 dark:bg-gray-800 border-l-4 border-primary-500 dark:border-primary-400 p-4" >
2023-03-14 15:22:52 +00:00
< div class = "flex" >
< div class = "flex-shrink-0" >
2023-05-27 11:58:08 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" class = "h-5 w-5 text-primary-500 dark:text-primary-400" viewBox = "0 0 20 20" fill = "currentColor" >
2023-03-14 15:22:52 +00:00
< path fill-rule = "evenodd" d = "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule = "evenodd" / >
< / svg >
< / div >
< div class = "ml-3" >
2023-05-27 11:58:08 +00:00
< p class = "text-sm text-primary-500 dark:text-primary-400" > {{.}}< / p >
2023-03-14 15:22:52 +00:00
< / div >
< / div >
< / div >
{{end}}
< / div >
2023-05-27 11:58:08 +00:00
{{ end }}
{{ if false }}
{{/* prevent IDE errors */}}
< / div > < / div > < / body > < / html >
{{ end }}