Django

Code

Changeset 1272

Show
Ignore:
Timestamp:
11/16/05 21:10:03 (3 years ago)
Author:
adrian
Message:

Fixed #822 -- Changed 500 view to use disclosure triangles instead of up/down arrows. Thanks, aaronsw

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/debug.py

    r1242 r1272  
    3434        }) 
    3535        tb = tb.tb_next 
    36      
    37     # Turn the settings module into a dict, filtering out anything that  
     36 
     37    # Turn the settings module into a dict, filtering out anything that 
    3838    # matches HIDDEN_SETTINGS along the way. 
    3939    settings_dict = {} 
     
    4444            else: 
    4545                settings_dict[k] = getattr(settings, k) 
    46                  
     46 
    4747    t = Template(TECHNICAL_500_TEMPLATE) 
    4848    c = Context({ 
     
    5454        'request_protocol' : os.environ.get("HTTPS") == "on" and "https" or "http", 
    5555        'settings' : settings_dict, 
    56          
     56 
    5757    }) 
    5858    return HttpResponseServerError(t.render(c)) 
     
    6767    except (IndexError, TypeError): 
    6868        tried = [] 
    69          
     69 
    7070    t = Template(TECHNICAL_404_TEMPLATE) 
    7171    c = Context({ 
     
    8181def _get_lines_from_file(filename, lineno, context_lines): 
    8282    """ 
    83     Returns context_lines before and after lineno from file.   
     83    Returns context_lines before and after lineno from file. 
    8484    Returns (pre_context_lineno, pre_context, context_line, post_context). 
    8585    """ 
     
    9292        context_line = source[lineno].strip('\n') 
    9393        post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]] 
    94          
     94 
    9595        return lower_bound, pre_context, context_line, post_context 
    9696    except (OSError, IOError): 
     
    148148    function getElementsByClassName(oElm, strTagName, strClassName){ 
    149149        // Written by Jonathan Snook, http://www.snook.ca/jon; Add-ons by Robert Nyman, http://www.robertnyman.com 
    150         var arrElements = (strTagName == "*" && document.all)? document.all :  
     150        var arrElements = (strTagName == "*" && document.all)? document.all : 
    151151        oElm.getElementsByTagName(strTagName); 
    152152        var arrReturnElements = new Array(); 
     
    155155        var oElement; 
    156156        for(var i=0; i<arrElements.length; i++){ 
    157             oElement = arrElements[i];       
     157            oElement = arrElements[i]; 
    158158            if(oRegExp.test(oElement.className)){ 
    159159                arrReturnElements.push(oElement); 
    160             }    
     160            } 
    161161        } 
    162162        return (arrReturnElements) 
    163163    } 
    164164    function hideAll(elems) { 
    165       for (var e = 0; e < elems.length; e++) {  
    166         elems[e].style.display = 'none';  
     165      for (var e = 0; e < elems.length; e++) { 
     166        elems[e].style.display = 'none'; 
    167167      } 
    168168    } 
     
    184184      toggle('v' + id); 
    185185      var s = link.getElementsByTagName('span')[0]; 
    186       var uarr = String.fromCharCode(0x2191); 
    187       var darr = String.fromCharCode(0x2193); 
     186      var uarr = String.fromCharCode(0x25b6); 
     187      var darr = String.fromCharCode(0x25bc); 
    188188      s.innerHTML = s.innerHTML == uarr ? darr : uarr; 
    189189      return false; 
     
    226226      <li class="frame"> 
    227227        <code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code> 
    228          
     228 
    229229        {% if frame.context_line %} 
    230230          <div class="context" id="c{{ frame.id }}"> 
     
    238238          </div> 
    239239        {% endif %} 
    240      
     240 
    241241        {% if frame.vars %} 
    242242          <div class="commands"> 
    243               <a href="#" onclick="return varToggle(this, '{{ frame.id }}')">Local vars <span>&darr;</span> </a> 
     243              <a href="#" onclick="return varToggle(this, '{{ frame.id }}')"><span>&#x25b6;</span> Local vars</a> 
    244244          </div> 
    245245          <table class="vars" id="v{{ frame.id }}"> 
     
    267267<div id="requestinfo"> 
    268268  <h2>Request information</h2> 
    269    
     269 
    270270  <h3 id="get-info">GET</h3> 
    271271  {% if request.GET %} 
     
    289289    <p>No GET data<p> 
    290290  {% endif %} 
    291    
     291 
    292292  <h3 id="post-info">POST</h3> 
    293293  {% if request.POST %} 
     
    311311    <p>No POST data<p> 
    312312  {% endif %} 
    313    
     313 
    314314  <h3 id="cookie-info">COOKIES</h3> 
    315315  {% if request.COOKIES %} 
     
    333333    <p>No cookie data<p> 
    334334  {% endif %} 
    335    
     335 
    336336  <h3 id="meta-info">META</h3> 
    337337  <table class="req"> 
     
    435435        {% endfor %} 
    436436      </ol> 
    437       <p>The current URL, <code>{{ request.path }}</code>, didn't match any of these.</p>  
     437      <p>The current URL, <code>{{ request.path }}</code>, didn't match any of these.</p> 
    438438    {% else %} 
    439439      <p>{{ reason|escape }}</p> 
    440440    {% endif %} 
    441441  </div> 
    442    
     442 
    443443  <div id="explanation"> 
    444444    <p>