Ver Fonte

fix user av class in index.tx

George Baugh há 2 anos atrás
pai
commit
be3ec5024f
2 ficheiros alterados com 7 adições e 1 exclusões
  1. 6 0
      lib/Trog/Routes/HTML.pm
  2. 1 1
      www/templates/html/index.tx

+ 6 - 0
lib/Trog/Routes/HTML.pm

@@ -282,6 +282,12 @@ sub index ( $query, $content = '', $i_styles = [] ) {
     my $categorybar = Trog::Renderer->render( template => $categorybar, data => { %$query, categories => \@series }, component => 1, contenttype => 'text/html' );
     return $categorybar if ref $categorybar eq 'ARRAY';
 
+	# Grab the avatar class for the logged in user
+	if ($query->{user}) {
+		$query->{user_class} = Trog::Auth::username2display($query->{user});
+		$query->{user_class} =~ tr/ /_/;
+	}
+
     return finish_render(
         $tmpl,
         {

+ 1 - 1
www/templates/html/index.tx

@@ -24,7 +24,7 @@
         </span>
     </div>
     : if ($user) {
-    <a href="/config" title="Preferences" class="topbar topbarimg usericon <: $user :>"></a>
+    <a href="/config" title="Preferences" class="topbar topbarimg usericon <: $user_class :>"></a>
     : } else {
     <a href="/login?to=<: $route :>" title="Login" class="topbar usericon" style="font-size: 1.5rem;">🔑</a>
     : }