Modify

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#13216 closed defect (fixed)

Logged in label not processing text correctly

Reported by: Kevin Shea Owned by: Ryan J Ollos
Priority: normal Component: BlueFlatTheme
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

The "Logged in user" label in the top right is interpreting the text incorrectly and escaping html as entities:

<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                      logged in as &lt;span class="trac-author-user"&gt;admin&lt;/span&gt;
                      <span class="caret"></span>
                    </a>

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by gwh

Is there any chance that this bug will be fixed?

comment:2 Changed 7 years ago by Ryan J Ollos

I'm unsure why there is conditional handling for the children of first_metanav.

The following seems to fix the issue in Trac 1.2-stable and 1.0-stable:

  • blueflattheme/templates/blueflat_theme.html

     
    1 <?python
    2 
    3 first_metanav = chrome['nav']['metanav'][0]['label']
    4 if hasattr(first_metanav, 'children'):
    5   user_menu_text = first_metanav.children
    6 else:
    7   user_menu_text = first_metanav
    8 
    9 ?>
    101<!DOCTYPE html
    112    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    123    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
    7465
    7566                 <div class="collapse navbar-collapse">
    7667                  <div class="btn-group pull-right" id="metanav">
    77                     <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
    78                       ${user_menu_text}
     68                    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"
     69                       py:with="first_metanav = chrome['nav']['metanav'][0]['label'];">
     70                      ${first_metanav}
    7971                      <span class="caret"></span>
    8072                    </a>
    8173                    <ul class="dropdown-menu" py:if="chrome.nav['metanav']">
Last edited 7 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 7 years ago by Ryan J Ollos

Owner: changed from Cinc-th to Ryan J Ollos
Status: newaccepted

comment:4 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 17017:

BlueFlatTheme 1.0.1: Fix logged-in label displaying incorrectly

Fixes #13216.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.