Fixed showing package count on home and about pages
This commit is contained in:
parent
f34de8a386
commit
cd5f34ba0e
1 changed files with 10 additions and 5 deletions
|
|
@ -1,19 +1,24 @@
|
||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
def home
|
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
|
# TODO: Use the package with the actual newest uploaded screenshot
|
||||||
@newest_uploaded_package = Package.with_screenshots.first
|
@newest_uploaded_package = Package.with_screenshots.first
|
||||||
|
|
||||||
# TODO: Use the actually most popular package and not just a random one
|
# TODO: Use the actually most popular package and not just a random one
|
||||||
@most_popular_package = Package.with_screenshots.first
|
@most_popular_package = Package.with_screenshots.first
|
||||||
|
|
||||||
|
package_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def about
|
def about
|
||||||
@package_sources = Rails.configuration.package_sources
|
@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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue