Skip to content

Commit

Permalink
Merge pull request #446 from alexandergraul/download-controller-cleanup
Browse files Browse the repository at this point in the history
Small cleanup of download controller
  • Loading branch information
agraul committed Dec 19, 2018
2 parents a3b1364 + 4406369 commit c3f684d
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions app/controllers/download_controller.rb
Expand Up @@ -38,7 +38,7 @@ def appliance
nil
end
end
set_flavours
set_flavors
@page_title = format(_("Download appliance from %s"), @project)
render_page :appliance
end
Expand Down Expand Up @@ -80,7 +80,7 @@ def package
nil
end
end
set_flavours
set_flavors
@page_title = format(_("Install package %s / %s"), @project, @package)
render_page :package
end
Expand Down Expand Up @@ -122,7 +122,7 @@ def pattern
nil
end
end
set_flavours
set_flavors
@page_title = format(_("Install pattern %s / %s"), @project, @pattern)
render_page :package
end
Expand All @@ -145,10 +145,6 @@ def ymp_without_arch_and_version

private

def set_parameters
@hide_search_box = true
end

def render_page page_template
@box_title = @page_title
respond_to do |format|
Expand Down Expand Up @@ -195,13 +191,9 @@ def set_distro_flavor distro
end
end

def set_flavours
if @data.nil?
head :forbidden
else
# collect distro types from @data
@flavors = @data.values.collect { |i| i[:flavor] }.uniq.sort { |x, y| x.downcase <=> y.downcase }
end
def set_flavors
return head :forbidden unless @data
@flavors = @data.values.collect { |i| i[:flavor] }.uniq.sort_by(&:downcase)
end

def get_image_type filename
Expand Down

0 comments on commit c3f684d

Please sign in to comment.