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
|
||||
def link_to_page(page_name, web = @web, text = nil, options = {})
|
||||
raise 'Web not defined' if web.nil?
|
||||
home_page_url = url_for :web => web.address, :action => 'show', :id => 'HomePage', :only_path => true
|
||||
base_url = home_page_url.sub(%r-/show/HomePage/?$-, '')
|
||||
web.make_link(page_name, text, options.merge(:base_url => base_url))
|
||||
web.make_link(page_name, text, options.merge(:base_url => "#{base_url}/#{web.address}"))
|
||||
end
|
||||
|
||||
def base_url
|
||||
home_page_url = url_for :controller => 'admin', :action => 'create_system', :only_path => true
|
||||
home_page_url.sub(%r-/create_system/?$-, '')
|
||||
end
|
||||
|
||||
# Creates a menu of categories
|
||||
|
|
|
@ -135,5 +135,4 @@ TODO Enable these input elements again after release 0.10
|
|||
</p>
|
||||
<%= end_form_tag %>
|
||||
|
||||
<script type="text/javascript" src="/javascripts/edit_web.js" />
|
||||
<script type="text/javascript">overrideAutocomplete()</script>
|
||||
<%= javascript_include_tag 'edit_web' %>
|
||||
|
|
|
@ -26,22 +26,16 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|||
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_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_additions %>
|
||||
<%= @web ? @web.additional_style : '' %>
|
||||
</style>
|
||||
|
||||
|
||||
<% if @web %>
|
||||
<link rel="alternate" type="application/rss+xml" title="<%= h @web.name %> - Headlines RSS"
|
||||
href="<%= url_for :controller => 'wiki', :web => @web.address,
|
||||
: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' %>"
|
||||
/>
|
||||
<%= auto_discovery_link_tag(:rss, :controller => 'wiki', :web => @web.address, :action => 'rss_with_headlines') %>
|
||||
<%= auto_discovery_link_tag(:rss, :controller => 'wiki', :web => @web.address, :action => 'rss_with_content') %>
|
||||
<% end %>
|
||||
</head>
|
||||
|
||||
|
|
|
@ -50,3 +50,6 @@ function overrideAutocomplete() {
|
|||
}//loop thru input elements
|
||||
}
|
||||
}
|
||||
|
||||
// This line is executed when the script is loaded
|
||||
overrideAutocomplete();
|
||||
|
|
Loading…
Reference in a new issue