Show wikipage on login screen when present
This commit is contained in:
parent
1447b38bb3
commit
c59ee3a6a7
2 changed files with 11 additions and 0 deletions
|
@ -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')
|
||||
|
|
|
@ -28,6 +28,14 @@ class Page < ActiveRecord::Base
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue