Fixed showing package count on home and about pages

This commit is contained in:
Christoph Haas 2016-03-04 11:27:18 +01:00
parent f34de8a386
commit cd5f34ba0e

View file

@ -1,19 +1,24 @@
class WelcomeController < ApplicationController
def home
# TODO: show count depending on virtual host
#@package_count = cache_or_set("debian_pkgcount", :expires => 10 * 60) do
Package.count
#end
# TODO: Use the package with the actual newest uploaded screenshot
@newest_uploaded_package = Package.with_screenshots.first
# TODO: Use the actually most popular package and not just a random one
@most_popular_package = Package.with_screenshots.first
package_count
end
def about
@package_sources = Rails.configuration.package_sources
package_count
end
private
# TODO: show count depending on virtual host
def package_count
@package_count = Package.count
end
end