Commit d11f9a632c19b6579bc9d0a676208c38a357fb57

Authored by Koen Punt
1 parent 9916e8d6

only show switch if from and to are set

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/views/compare/_form.html.haml
... ... @@ -13,7 +13,8 @@
13 13 = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge"
14 14 = "..."
15 15 = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge"
16   - = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
  16 + - if params[:to] && params[:from]
  17 + = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'}
17 18 - if @refs_are_same
18 19 .alert
19 20 %span Refs are the same
... ...