One-Click S5 Template
Make it yet-easier to create S5 slideshows.
This commit is contained in:
parent
675df6b6c5
commit
5506f87f17
4 changed files with 36 additions and 1 deletions
|
@ -80,7 +80,17 @@ class WikiReference < ActiveRecord::Base
|
|||
row = connection.select_one(sanitize_sql([query, page_name]))
|
||||
row['name'].as_utf8 if row
|
||||
end
|
||||
|
||||
|
||||
def self.page_categories(web, page_name)
|
||||
query =
|
||||
"SELECT referenced_name FROM wiki_references JOIN pages " +
|
||||
"ON wiki_references.page_id = pages.id " +
|
||||
"WHERE pages.name = ? " +
|
||||
"AND wiki_references.link_type = '#{CATEGORY}' " +
|
||||
"AND pages.web_id = '#{web.id}'"
|
||||
names = connection.select_all(sanitize_sql([query, page_name])).map { |row| row['referenced_name'].as_utf8 }
|
||||
end
|
||||
|
||||
def self.pages_in_category(web, category)
|
||||
query =
|
||||
"SELECT name FROM pages JOIN wiki_references " +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue