lib/milkode/cdweb/lib/command.rb in milkode-0.5.2 vs lib/milkode/cdweb/lib/command.rb in milkode-0.5.3
- old
+ new
@@ -12,28 +12,30 @@
require 'milkode/cdweb/lib/mkurl'
require 'milkode/common/util'
module Milkode
def view(record, params, before)
+ @setting = WebSetting.new
@title = record.shortpath
@path = record.shortpath
q = params[:query] && Query.new(params[:query])
if (Util::larger_than_oneline(record.content) and q and !q.keywords.empty?)
grep = Grep.new(record.content)
match_lines = grep.match_lines_and(q.keywords)
- @record_content = CodeRayWrapper.new(record.content, record.shortpath, match_lines).to_html_anchor
+ @record_content = CodeRayWrapper.new(record.content, record.shortpath, match_lines).to_html
else
@record_content = CodeRayWrapper.new(record.content, record.shortpath).to_html
end
@elapsed = Time.now - before
haml :view
end
def search(path, params, before)
+ @setting = WebSetting.new
@path = path
query = Query.new(params[:query])
@title = "'#{query.query_string}' in #{path_title(path)}"
if (query.keywords.size > 0)
@@ -49,9 +51,10 @@
@elapsed = Time.now - before
haml :search
end
def filelist(path, params, before)
+ @setting = WebSetting.new
@title = filelist_title(path)
@path = path
fileList = Database.instance.fileList(path)
@total_records = fileList.size
@record_content = fileList.map do |v|