now directly downloadable from widget if has only one file
This commit is contained in:
parent
212a7e22de
commit
381e9e620b
|
@ -136,9 +136,10 @@ class ArchivesController < ApplicationController
|
||||||
end
|
end
|
||||||
cats = @categories.collect do |cat|
|
cats = @categories.collect do |cat|
|
||||||
archives = ArchiveFile.can_display.where(:category_id => cat["id"]).collect do |archive|
|
archives = ArchiveFile.can_display.where(:category_id => cat["id"]).collect do |archive|
|
||||||
|
url = archive.archive_file_multiples.count > 1 ? OrbitHelper.widget_more_url : "/xhr/archive/download?file=#{archive.archive_file_multiples.first.id}"
|
||||||
{
|
{
|
||||||
"archive-title" => archive.title,
|
"archive-title" => archive.title,
|
||||||
"archive_url" => "/xhr/archive/download?file=#{archive.id}"
|
"archive_url" => url
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue