Edgewall Software

Ticket #9282: t9282-indication-unchanged-when-filter-updated.patch

File t9282-indication-unchanged-when-filter-updated.patch, 2.1 KB (added by mrelbe, 2 years ago)

#9282: indication unchanged when filter updated, and minor changes to css. (Applies to previous patch.)

  • trac/htdocs/css/timeline.css

    #9282: indication unchanged when filter updated (and minor changes to css)
    
    diff --git a/trac/htdocs/css/timeline.css b/trac/htdocs/css/timeline.css
    a b  
    1515 margin-left: 1em; 
    1616} 
    1717dl.unread {  
    18  margin-left: 0.55em; 
    19  border-left: 0.2em solid #c0f0c0; 
     18 margin-left: 0.3em; 
     19 border-left: 0.35em solid #c0f0c0; 
    2020 padding-left: 0.35em; 
    2121} 
    2222 
     
    4343dt.highlight { background-color: #ffa; }  
    4444dd {  
    4545 font-size: 80%; 
    46  margin: 0 0 .75em 5.5em; 
     46 margin: 0 0 .75em 6em; 
    4747 padding: 0; 
    4848 color: #776; 
    4949} 
  • trac/timeline/templates/timeline.html

    diff --git a/trac/timeline/templates/timeline.html b/trac/timeline/templates/timeline.html
    a b  
    2626          <input type="checkbox" name="${filter.name}" 
    2727                 checked="${filter.enabled or None}"/> ${filter.label} 
    2828        </label> 
     29        <input type="hidden" name="lastread" value="$lastread" /> 
    2930       </fieldset> 
    3031       <div class="buttons"> 
    3132         <input type="submit" name="update" value="${_('Update')}" /> 
  • trac/timeline/web_ui.py

    diff --git a/trac/timeline/web_ui.py b/trac/timeline/web_ui.py
    a b  
    147147            filters = [f[0] for f in available_filters if test(f)] 
    148148 
    149149        # save the results of submitting the timeline form to the session 
     150        filter_updated = False 
    150151        if 'update' in req.args: 
    151152            for filter in available_filters: 
    152153                key = 'timeline.filter.%s' % filter[0] 
    153154                if filter[0] in req.args: 
     155                    filter_updated = filter_updated or key not in req.session 
    154156                    req.session[key] = '1' 
    155157                elif key in req.session: 
     158                    filter_updated = True 
    156159                    del req.session[key] 
    157160 
     161        # new events indication unchanged when any filter was changed 
     162        if filter_updated: 
     163            data['lastread'] = int(req.args.get('lastread')) 
     164 
    158165        stop = fromdate 
    159166        start = stop - timedelta(days=daysback + 1) 
    160167