forked from bofh/fetsite
Hot Fixes
This commit is contained in:
@@ -94,7 +94,7 @@ class DocumentsController < ApplicationController
|
||||
end
|
||||
@parent=@document.parent
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.html {render :edit}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module ApplicationHelper
|
||||
def cache_array_key(array)
|
||||
array.map{|c| c.id}.join('_')+"_"+array.max{|c|c.updated_at.to_i}.updated_at.try(:utc).to_s+"_"+I18n.locale.to_s
|
||||
return "empty_array" if array.nil? or array.empty?
|
||||
array.map{|c| c.id}.join('_')+"_"+array.max{|c|c.updated_at.to_i}.updated_at.try(:utc).to_s+"_"+I18n.locale.to_s
|
||||
# array.map{|c| c.id}.join('')+"_"+array.map{|c|c.try(:updated_at).try(:utc).to_s}.join('') +"_"+I18n.locale.to_s
|
||||
|
||||
end
|
||||
|
||||
@@ -82,7 +82,7 @@ class Document < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
def read_from_etherpad
|
||||
self.text=ApplicationController.helpers.strip_control_chars(self.ep_pad.html)
|
||||
self.text=ApplicationController.helpers.strip_control_chars( self.ep_pad.html)
|
||||
|
||||
end
|
||||
def ep_pad
|
||||
@@ -92,13 +92,17 @@ class Document < ActiveRecord::Base
|
||||
t= (self.typ.nil? || self.typ ==0) ? 1 : self.typ
|
||||
Document.ether.group(Document::TYPS[t])
|
||||
end
|
||||
def text_stripped
|
||||
ApplicationController.helpers.strip_control_chars(ApplicationController.helpers.strip_tags(text.to_s.gsub("<"," <").gsub(">","> ").to_s))
|
||||
|
||||
end
|
||||
searchable do
|
||||
text :text, stored: true
|
||||
text :name, :boost=>4.0, :stored=> true
|
||||
if typ = 10 || typ=11
|
||||
text :meeting, stored: true do
|
||||
parent.text unless parent.nil?
|
||||
end
|
||||
text :text, stored: true do |d|
|
||||
d.text_stripped
|
||||
end
|
||||
text :name, :boost=>4.0, :stored=> true
|
||||
text :meeting, stored: true do |d|
|
||||
(d.parent_type == "Meeting")? d.try(:parent).try(:text).to_s : ""
|
||||
end
|
||||
end
|
||||
def maketoc
|
||||
|
||||
@@ -104,6 +104,8 @@ class Lva < ActiveRecord::Base
|
||||
rescue OpenURI::HTTPError => e
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
|
||||
end
|
||||
url
|
||||
end
|
||||
|
||||
@@ -92,7 +92,8 @@ end
|
||||
File.extname(full_filename(file.file)).downcase
|
||||
end
|
||||
def pdf?(for_file)
|
||||
%w(.pdf).include?(File.extname(full_filename(for_file.file)).downcase)
|
||||
# %w(.pdf).include?(File.extname(full_filename(for_file.file)).downcase)
|
||||
false
|
||||
end
|
||||
def image?(for_file)
|
||||
%w(.jpg .png .jpeg).include?(File.extname(full_filename(for_file.file)).downcase)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<% unless search_results.nil? %>
|
||||
<%= search_results %>
|
||||
<ul>
|
||||
<% search_results.each_hit_with_result do |hit,result| %>
|
||||
<li> <%= link_to result.parent.title+": " + result.name, document_path(result) %>
|
||||
@@ -7,7 +8,7 @@
|
||||
<% end %>
|
||||
<% %>
|
||||
<% hit.highlights(:text).each do |hlgt| %>
|
||||
<%= "text:" + raw(hlgt.format {|word| "*#{word}*" })%>
|
||||
<%= "text:" + raw(hlgt.format {|word| raw("<b>#{word}</b>") })%>
|
||||
<% end %>
|
||||
<% hit.highlights(:meeting).each do |hlgt| %>
|
||||
<%= "text:" + raw(hlgt.format {|word| "*#{word}*" })%>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<% cache("calendar_" + @calentries.map{|c| c.id}.join('') + @calentries.max{|c|c.updated_at.to_i}.updated_at.to_i.to_s+"_"+I18n.locale.to_s+params[:month].to_s+params[:year].to_s) do %>
|
||||
<%= render 'calendars/calentries', :object=>@calentries %>
|
||||
<% end %>
|
||||
<% if current_user.has_role?(:fetuser) %>
|
||||
<% if !current_user.nil? and current_user.has_role?(:fetuser) %>
|
||||
<%= link_to calendars_url(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid) , calendars_path(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid)%>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<%= render 'calendars/calentries', :object=>@calentries %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if current_user.has_role?(:fetuser) %>
|
||||
<% if !current_user.nil? and current_user.has_role?(:fetuser) %>
|
||||
<%= link_to calendar_url(@rubrik.calendar,:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid) , calendars_path(:format=>:ics, :key=>Key.find_or_create(current_user,1).uuid)%>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ Fetsite::Application.configure do
|
||||
# config.force_ssl = true
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
config.log_level = :debug
|
||||
|
||||
# Prepend all log lines with the following tags
|
||||
# config.log_tags = [ :subdomain, :uuid ]
|
||||
config.log_tags = [ :remote_ip , :uuid ]
|
||||
|
||||
# Use a different logger for distributed setups
|
||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||
|
||||
Reference in New Issue
Block a user