From e6f0e39b641d90c6a75b65818eb1fe42e30ea9fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@x2.cz>
Date: Thu, 8 Aug 2024 15:57:04 +0200
Subject: [PATCH] Fix pozvanek

---
 VERSION                           |  2 +-
 lib/SeMeet.pm                     |  3 ++-
 lib/SeMeet/Controller/Invites.pm  |  1 -
 templates/layouts/default.html.ep | 24 +++++++++++-------------
 4 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/VERSION b/VERSION
index 930e300..e815b86 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.14.1
+0.15.1
diff --git a/lib/SeMeet.pm b/lib/SeMeet.pm
index 3b47aa6..5e27dcb 100644
--- a/lib/SeMeet.pm
+++ b/lib/SeMeet.pm
@@ -130,6 +130,8 @@ sub startup( $self ) {
     $r->get('/login')->to('Auth#callback');
     $r->get('/logout')->to('Auth#do_logout');
 
+    $r->get('/guest/:token')->to('Invites#meet');
+
     $r->get('/')->requires(authenticated => 1)->to(cb => sub { shift->render('meets'); });
     $r->get('/')->to(cb => sub { shift->render('index'); });
 
@@ -139,7 +141,6 @@ sub startup( $self ) {
         $c->session->{id} = $c->stash->{id};
         $c->render('index');
     });
-    $r->get('/guest/:token')->to('Invites#meet');
 
     $r->websocket('/ws')->to('Websockets#main');
 }
diff --git a/lib/SeMeet/Controller/Invites.pm b/lib/SeMeet/Controller/Invites.pm
index a2335d1..0b7152d 100644
--- a/lib/SeMeet/Controller/Invites.pm
+++ b/lib/SeMeet/Controller/Invites.pm
@@ -51,7 +51,6 @@ sub create($c) {
 }
 
 sub meet($c) {
-
     my $invite = $c->schema->resultset('Invite')->search({
         token  => uc($c->stash->{token}),
 #        expire => {'>' => \'now()'}, # zatim nebudeme limitovat casove
diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep
index 650d102..1d44c24 100644
--- a/templates/layouts/default.html.ep
+++ b/templates/layouts/default.html.ep
@@ -10,9 +10,7 @@
       <div>
         <div class="container container--wide navbar__content" :class="{'navbar__content--initialized': true}">
           <div class="navbar__brand my-4 flex items-center lg:pr-8 lg:my-0">
-            <a href="/">
-              <img src="<%= config->{styleguide} %>/images/logo-round-white.svg" class="w-8" />
-            </a>
+            <a href="/"><img src="<%= config->{styleguide} %>/images/logo-round-white.svg" class="w-8" /></a>
             <span class="pl-4 font-bold text-xl lg:pr-8"><a href="/"><%= config->{name} %> - <%= config->{description} %></a></span>
           </div>
           <div class="navbar__menutoggle my-4 flex justify-end lg:hidden">
@@ -21,18 +19,18 @@
             </a>
           </div>
           <div v-if="show || isLgScreenSize" class="navbar__main navbar__section navbar__section--expandable container-padding--zero lg:container-padding--auto flex items-center">
-           <div class="flex-grow">
-
-            </div>
+            <div class="flex-grow"></div>
+% if (current_user) {
             <div class="flex items-center space-x-4">
-            <div class="flex items-center space-x-4">
-              <span class="head-heavy-2xs"><%= current_user->{displayname} %></span>
-              <div class="avatar avatar--2xs">
-                <img src="<%= config->{piratar}%>64/<%= current_user->{username} %>.jpg" alt="<%= current_user->{displayname} %>" />
-               </div>
-              <a href="/logout"><button class="text-grey-200 hover:text-white"><i class="ico--log-out"></i></button></a>
-            </div>
+              <div class="flex items-center space-x-4">
+                <span class="head-heavy-2xs"><%= current_user->{displayname} %></span>
+                <div class="avatar avatar--2xs">
+                  <img src="<%= config->{piratar}%>64/<%= current_user->{username} %>.jpg" alt="<%= current_user->{displayname} %>" />
+                </div>
+                <a href="/logout"><button class="text-grey-200 hover:text-white"><i class="ico--log-out"></i></button></a>
+              </div>
             </div>
+% }
           </div>
         </div>
       </div>
-- 
GitLab