Upgraded to rails 3.1.8. Fixed various bugs in wiki.

This commit is contained in:
benni 2012-09-30 21:15:55 +02:00
parent cd91436f7f
commit 29a6cd8b62
106 changed files with 430 additions and 22436 deletions

View file

@ -1,13 +0,0 @@
<%%= simple_form_for(@<%= singular_name %>) do |f| %>
<%%= f.error_notification %>
<div class="inputs">
<%- attributes.each do |attribute| -%>
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
<%- end -%>
</div>
<div class="actions">
<%%= f.button :submit %>
</div>
<%% end %>

View file

@ -0,0 +1,10 @@
= simple_form_for(@<%= singular_table_name %>) do |f|
= f.error_notification
.form-inputs
<%- attributes.each do |attribute| -%>
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
<%- end -%>
.form-actions
= f.button :submit

View file

@ -1,5 +1,4 @@
class Wikilink < WikiCloth::WikiLinkHandler
include ActionController::UrlWriter # To use named routes
def link_attributes_for(page)
permalink = Page.permalink(page)
@ -7,15 +6,17 @@ class Wikilink < WikiCloth::WikiLinkHandler
url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port]
if Page.exists?(:permalink => permalink)
{ :href => url_for(url_options.merge({:controller => "pages", :action => "show",
:permalink => permalink, :use_route => :wiki_page})) }
{ :href => url_for(:wiki_page_path, permalink: permalink, use_route: :wiki_page) }
else
{ :href => url_for(url_options.merge({:controller => "pages", :action => "new",
:title => page, :parent => params[:referer]})), :class => "new_wiki_link"}
{ href: url_for(:new_page_path, title: page, parent: params[:referer]), class: 'new_wiki_link' }
end
end
def section_link(section)
""
end
def url_for(path_name, options = {})
Rails.application.routes.url_helpers.send path_name, options.merge({foodcoop: FoodsoftConfig.scope})
end
end