Skip to content

Commit

Permalink
Show wikipage on login screen when present
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Jan 19, 2015
1 parent f6c83fb commit 89486d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/sessions/new.html.haml
Expand Up @@ -10,6 +10,9 @@
.alert.alert-error
!= t '.nojs', link: link_to(t('.noscript'), "http://noscript.net/")

- if defined?(FoodsoftWiki) && (page = Page.public_front_page)
= wikified_body page.body, page.title

= form_tag sessions_path, class: 'form-horizontal' do
.control-group
%label(for='nick' class='control-label')
Expand Down
8 changes: 8 additions & 0 deletions plugins/wiki/app/models/page.rb
Expand Up @@ -28,6 +28,14 @@ def homepage?
permalink == "Home"
end

def public_front_page?
permalink == "Public_frontpage"
end

def self.public_front_page
where(permalink: "Public_frontpage").first
end

def set_permalink
unless title.blank?
self.permalink = Page.count == 0 ? "Home" : Page.permalink(title)
Expand Down

0 comments on commit 89486d8

Please sign in to comment.