Fix page_for_archive_file.
This commit is contained in:
1 parent
f020221a47
commit
18d4162c7e
3 files changed
+9
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
module Admin::ArchiveFilesHelper
|
||||
def page_for_archive_file(archive_file)
|
||||
def page_for_archive_file(archive_file, full_url=false)
|
||||
archive_file_page = nil
|
||||
pages = Page.where(:module=>'archive').select{|page| page.enabled_for.include?(I18n.locale.to_s)}
|
||||
|
||||
@@ -18,8 +18,12 @@ module Admin::ArchiveFilesHelper
|
||||
end
|
||||
break if !archive_file_page.nil?
|
||||
end
|
||||
archive_file_page = pages.first if archive_file_page.nil?
|
||||
end
|
||||
if full_url
|
||||
request.protocol+(request.host_with_port+archive_file_page.url+'/'+archive_file.to_param).gsub('//','/') rescue "#"
|
||||
else
|
||||
"#{archive_file_page.url}?title=#{archive_file.title}"
|
||||
end
|
||||
archive_file_page = pages.first if archive_file_page.nil?
|
||||
request.protocol+(request.host_with_port+archive_file_page.url+'/'+archive_file.to_param).gsub('//','/') rescue "#"
|
||||
end
|
||||
end
|
||||
@@ -113,7 +113,7 @@
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/admin/archive_files/show?title=<%= archive.title %>" target="_blank"><%= archive.title %></a>
|
||||
<a href="<%= page_for_archive_file(archive) %>" target="_blank"><%= archive.title %></a>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills">
|
||||
<% if is_editable %>
|
||||
|
||||
@@ -9,7 +9,7 @@ xml.rss :version => "2.0" do
|
||||
xml.title archive_file.title
|
||||
xml.description archive_file.description
|
||||
xml.pubDate archive_file.created_at.to_s(:rfc822)
|
||||
xml.link page_for_archive_file(archive_file)
|
||||
xml.link page_for_archive_file(archive_file, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user