Replaced links to static resources with appropriate Rails helpers
This commit is contained in:
parent
e5f34fd1db
commit
cf3cebb589
4 changed files with 14 additions and 15 deletions
|
@ -44,9 +44,12 @@ module ApplicationHelper
|
||||||
# Creates a hyperlink to a Wiki page, or to a "new page" form if the page doesn't exist yet
|
# Creates a hyperlink to a Wiki page, or to a "new page" form if the page doesn't exist yet
|
||||||
def link_to_page(page_name, web = @web, text = nil, options = {})
|
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||||
raise 'Web not defined' if web.nil?
|
raise 'Web not defined' if web.nil?
|
||||||
home_page_url = url_for :web => web.address, :action => 'show', :id => 'HomePage', :only_path => true
|
web.make_link(page_name, text, options.merge(:base_url => "#{base_url}/#{web.address}"))
|
||||||
base_url = home_page_url.sub(%r-/show/HomePage/?$-, '')
|
end
|
||||||
web.make_link(page_name, text, options.merge(:base_url => base_url))
|
|
||||||
|
def base_url
|
||||||
|
home_page_url = url_for :controller => 'admin', :action => 'create_system', :only_path => true
|
||||||
|
home_page_url.sub(%r-/create_system/?$-, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates a menu of categories
|
# Creates a menu of categories
|
||||||
|
|
|
@ -135,5 +135,4 @@ TODO Enable these input elements again after release 0.10
|
||||||
</p>
|
</p>
|
||||||
<%= end_form_tag %>
|
<%= end_form_tag %>
|
||||||
|
|
||||||
<script type="text/javascript" src="/javascripts/edit_web.js" />
|
<%= javascript_include_tag 'edit_web' %>
|
||||||
<script type="text/javascript">overrideAutocomplete()</script>
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
|
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link rel="Stylesheet" href="/stylesheets/instiki.css" type="text/css" media="screen" />
|
<%= stylesheet_link_tag 'instiki' unless @inline_style %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<%= @style_additions %>
|
<%= @style_additions %>
|
||||||
|
@ -34,14 +34,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<% if @web %>
|
<% if @web %>
|
||||||
<link rel="alternate" type="application/rss+xml" title="<%= h @web.name %> - Headlines RSS"
|
<%= auto_discovery_link_tag(:rss, :controller => 'wiki', :web => @web.address, :action => 'rss_with_headlines') %>
|
||||||
href="<%= url_for :controller => 'wiki', :web => @web.address,
|
<%= auto_discovery_link_tag(:rss, :controller => 'wiki', :web => @web.address, :action => 'rss_with_content') %>
|
||||||
:action => 'rss_with_headlines' %>"
|
|
||||||
/>
|
|
||||||
<link rel="alternate" type="application/rss+xml" title="<%= h @web.name %> - Full Pages RSS"
|
|
||||||
href="<%= url_for :controller => 'wiki', :web => @web.address,
|
|
||||||
:action => 'rss_with_content' %>"
|
|
||||||
/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -50,3 +50,6 @@ function overrideAutocomplete() {
|
||||||
}//loop thru input elements
|
}//loop thru input elements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This line is executed when the script is loaded
|
||||||
|
overrideAutocomplete();
|
||||||
|
|
Loading…
Add table
Reference in a new issue