Skip to content
Snippets Groups Projects
Commit ef972b3c authored by pabois's avatar pabois
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents a6620f67 3a61892f
No related branches found
No related tags found
No related merge requests found
......@@ -73,12 +73,13 @@ module Admin::ApplicationHelper
sanitize text
end
def prepare_text_for_static(text)
indentation = ' ' # Beware, it works only at level one, with 2 spaces
def prepare_text_for_static(text, depth = 1)
indentation = ' ' * depth # Beware, it works only at level one, with 2 spaces
text = text.to_s.dup
text = strip_tags text
text = text.strip
text = text.gsub "\r\n", "\n" # Remove useless \r
text = text.gsub "\r", "\n" # Replace lonely \r
text = text.gsub "\n", "\n#{indentation}" # Indent properly to avoid broken frontmatter
text = text.chomp # Remove extra newlines
CGI.unescapeHTML text
......
......@@ -53,6 +53,10 @@ module Communication::Website::WithDependencies
about.teachers
end
def people_in_blocks
[] # TODO
end
def people
@people ||= begin
people = []
......@@ -60,6 +64,7 @@ module Communication::Website::WithDependencies
people += teachers if has_teachers?
people += administrators if has_administrators?
people += researchers if has_researchers?
people += people_in_blocks if has_people_in_blocks?
people.uniq.compact
end
end
......@@ -104,6 +109,11 @@ module Communication::Website::WithDependencies
authors.compact.any?
end
def has_people_in_blocks?
# TODO
people_in_blocks.compact.any?
end
def has_persons?
has_authors? || has_administrators? || has_researchers? || has_teachers?
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment