Fix for "Download Diff" link and to only show button if review request has diffs

Review Request #3626 — Created Dec. 4, 2012 and submitted

Information

Review Board
master

Reviewers

Fix for "Download Diff" link and to only show if review request has diffs
Tested in Firefox and Chrome.
Description From Last Updated

According to IRC chat: 18:41 Michee: What should the path actually be? 18:42 ChipX86: {% url raw_diff review_request.display_id %} 18:43 …

mike_conleymike_conley
mike_conley
  1. 
      
  2. reviewboard/templates/reviews/ui/base.html (Diff revision 1)
     
     
     
     
    Show all issues
    According to IRC chat:
    
    18:41 Michee: What should the path actually be?
    18:42 ChipX86: {% url raw_diff review_request.display_id %}
    18:43 ChipX86: right now it's hard-coding "diff/raw/"
    
    Why the switch?
    1. From what ChipX86 suggested on IRC? I was trying to follow the convention on line 21. Should it be changed?
    2. Yeah, I think he wanted to clean it up by using {% url raw_diff review_request.display_id %} for the URLs instead of "{{review_request.get_absolute_url}}diff/raw"
      
      But looking around, I'm not seeing that template tag being defined anywhere. :/
      
      Maybe I'll wait for him to look at it.
    3. Would it mean that "{{review_request.get_absolute_url}}diff/#index_header" should be replaced with a template tag as well?
    4. Oh - I think raw_diff is a named url defined in reviews/urls.py.  Ok, I think I get it - here's an example:
      
      https://github.com/reviewboard/reviewboard/blob/master/reviewboard/templates/notifications/review_request_email.html#L81
      
      So yeah, use:
      
      <a href="{% url raw_diff review_request.display_id %}" >{% trans "Download Diff" %}</a>
  3. 
      
MI
david
  1. Ship It!
  2. 
      
MI
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.7.x (34156a9). Thanks!