aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/public_body_controller.rb33
-rw-r--r--app/controllers/request_controller.rb29
-rw-r--r--app/controllers/services_controller.rb6
-rw-r--r--app/models/info_request.rb13
-rw-r--r--app/models/public_body.rb41
-rw-r--r--app/models/request_mailer.rb37
-rw-r--r--app/models/user.rb11
-rw-r--r--app/views/admin_public_body/_form.rhtml3
-rw-r--r--app/views/admin_public_body/import_csv.rhtml2
-rw-r--r--app/views/admin_public_body/show.rhtml4
-rw-r--r--app/views/general/frontpage.rhtml11
-rw-r--r--app/views/layouts/default.rhtml2
-rw-r--r--app/views/public_body/show.rhtml3
-rw-r--r--app/views/request/_request_listing_via_event.rhtml10
14 files changed, 127 insertions, 78 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index b34e89b8d..8a4a65820 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -146,38 +146,7 @@ class PublicBodyController < ApplicationController
end
def list_all_csv
- public_bodies = PublicBody.find(:all, :order => 'url_name',
- :include => [:translations, :tags])
- report = FasterCSV.generate() do |csv|
- csv << [
- 'Name',
- 'Short name',
- # deliberately not including 'Request email'
- 'URL name',
- 'Tags',
- 'Home page',
- 'Publication scheme',
- 'Created at',
- 'Updated at',
- 'Version',
- ]
- public_bodies.each do |public_body|
- csv << [
- public_body.name,
- public_body.short_name,
- # DO NOT include request_email (we don't want to make it
- # easy to spam all authorities with requests)
- public_body.url_name,
- public_body.tag_string,
- public_body.calculated_home_page,
- public_body.publication_scheme,
- public_body.created_at,
- public_body.updated_at,
- public_body.version,
- ]
- end
- end
- send_data(report, :type=> 'text/csv; charset=utf-8; header=present',
+ send_data(PublicBody.export_csv, :type=> 'text/csv; charset=utf-8; header=present',
:filename => 'all-authorities.csv',
:disposition =>'attachment', :encoding => 'utf8')
end
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 396e6593a..3296db6b7 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -446,18 +446,19 @@ class RequestController < ApplicationController
return
end
+ calculated_status = @info_request.calculate_status
# Display advice for requester on what to do next, as appropriate
- if @info_request.calculate_status == 'waiting_response'
+ if calculated_status == 'waiting_response'
flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>
{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
redirect_to request_url(@info_request)
- elsif @info_request.calculate_status == 'waiting_response_overdue'
+ elsif calculated_status == 'waiting_response_overdue'
flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
redirect_to request_url(@info_request)
- elsif @info_request.calculate_status == 'waiting_response_very_overdue'
+ elsif calculated_status == 'waiting_response_very_overdue'
flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => Configuration::reply_very_late_after_days, :late_number_of_days => Configuration::reply_late_after_days)
redirect_to unhappy_url(@info_request)
- elsif @info_request.calculate_status == 'not_held'
+ elsif calculated_status == 'not_held'
flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p>
<ul>
<li>To send your request to another authority, first copy the text of your request below, then <a href=\"{{find_authority_url}}\">find the other authority</a>.</li>
@@ -472,37 +473,37 @@ class RequestController < ApplicationController
:complain_url => CGI.escapeHTML(unhappy_url(@info_request)),
:other_means_url => CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means")
redirect_to request_url(@info_request)
- elsif @info_request.calculate_status == 'rejected'
+ elsif calculated_status == 'rejected'
flash[:notice] = _("Oh no! Sorry to hear that your request was refused. Here is what to do now.")
redirect_to unhappy_url(@info_request)
- elsif @info_request.calculate_status == 'successful'
+ elsif calculated_status == 'successful'
flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>", :site_name=>site_name, :donation_url => "http://www.mysociety.org/donate/")
redirect_to request_url(@info_request)
- elsif @info_request.calculate_status == 'partially_successful'
+ elsif calculated_status == 'partially_successful'
flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>", :site_name=>site_name, :donation_url=>"http://www.mysociety.org/donate/")
redirect_to unhappy_url(@info_request)
- elsif @info_request.calculate_status == 'waiting_clarification'
+ elsif calculated_status == 'waiting_clarification'
flash[:notice] = _("Please write your follow up message containing the necessary clarifications below.")
redirect_to respond_to_last_url(@info_request)
- elsif @info_request.calculate_status == 'gone_postal'
+ elsif calculated_status == 'gone_postal'
redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
- elsif @info_request.calculate_status == 'internal_review'
+ elsif calculated_status == 'internal_review'
flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => Configuration.reply_late_after_days, :review_url => unhappy_url(@info_request) + "#internal_review")
redirect_to request_url(@info_request)
- elsif @info_request.calculate_status == 'error_message'
+ elsif calculated_status == 'error_message'
flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>")
redirect_to help_general_url(:action => 'contact')
- elsif @info_request.calculate_status == 'requires_admin'
+ elsif calculated_status == 'requires_admin'
flash[:notice] = _("Please use the form below to tell us more.")
redirect_to help_general_url(:action => 'contact')
- elsif @info_request.calculate_status == 'user_withdrawn'
+ elsif calculated_status == 'user_withdrawn'
flash[:notice] = _("If you have not done so already, please write a message below telling the authority that you have withdrawn your request. Otherwise they will not know it has been withdrawn.")
redirect_to respond_to_last_url(@info_request)
else
if @@custom_states_loaded
return self.theme_describe_state(@info_request)
else
- raise "unknown calculate_status " + @info_request.calculate_status
+ raise "unknown calculate_status " + calculated_status
end
end
end
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index ead5d73b7..38bf51772 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -9,13 +9,13 @@ class ServicesController < ApplicationController
iso_country_code = Configuration::iso_country_code.downcase
if country_from_ip.downcase != iso_country_code
found_country = WorldFOIWebsites.by_code(country_from_ip)
- found_country_name = !found_country.nil? && found_country[:country_name]
old_fgt_locale = FastGettext.locale
begin
FastGettext.locale = FastGettext.best_locale_in(request.env['HTTP_ACCEPT_LANGUAGE'])
- if found_country_name
- text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_country_name, :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
+ if found_country && found_country[:country_name] && found_country[:url] && found_country[:name]
+ text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}",
+ :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
else
current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name]
text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country)
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 74a67b9d9..47424e573 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -584,12 +584,11 @@ public
# waiting_classification
# waiting_response_overdue
# waiting_response_very_overdue
- def calculate_status
- if @@custom_states_loaded
- return self.theme_calculate_status
- else
- self.base_calculate_status
+ def calculate_status(cached_value_ok=false)
+ if cached_value_ok && @cached_calculated_status
+ return @cached_calculated_status
end
+ @cached_calculated_status = @@custom_states_loaded ? self.theme_calculate_status : self.base_calculate_status
end
def base_calculate_status
@@ -871,8 +870,8 @@ public
end
end
- def display_status
- InfoRequest.get_status_description(self.calculate_status)
+ def display_status(cached_value_ok=false)
+ InfoRequest.get_status_description(self.calculate_status(cached_value_ok))
end
# Completely delete this request and all objects depending on it
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index c3bc060a4..57fe27767 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -413,7 +413,7 @@ class PublicBody < ActiveRecord::Base
next
end
- field_list = ['name', 'short_name', 'request_email', 'notes', 'publication_scheme', 'home_page', 'tag_string']
+ field_list = ['name', 'short_name', 'request_email', 'notes', 'publication_scheme', 'disclosure_log', 'home_page', 'tag_string']
if public_body = bodies_by_name[name] # Existing public body
available_locales.each do |locale|
@@ -500,6 +500,45 @@ class PublicBody < ActiveRecord::Base
return [errors, notes]
end
+ # Returns all public bodies (except for the internal admin authority) as csv
+ def self.export_csv
+ public_bodies = PublicBody.visible.find(:all, :order => 'url_name',
+ :include => [:translations, :tags])
+ FasterCSV.generate() do |csv|
+ csv << [
+ 'Name',
+ 'Short name',
+ # deliberately not including 'Request email'
+ 'URL name',
+ 'Tags',
+ 'Home page',
+ 'Publication scheme',
+ 'Disclosure log',
+ 'Notes',
+ 'Created at',
+ 'Updated at',
+ 'Version',
+ ]
+ public_bodies.each do |public_body|
+ csv << [
+ public_body.name,
+ public_body.short_name,
+ # DO NOT include request_email (we don't want to make it
+ # easy to spam all authorities with requests)
+ public_body.url_name,
+ public_body.tag_string,
+ public_body.calculated_home_page,
+ public_body.publication_scheme,
+ public_body.disclosure_log,
+ public_body.notes,
+ public_body.created_at,
+ public_body.updated_at,
+ public_body.version,
+ ]
+ end
+ end
+ end
+
# Does this user have the power of FOI officer for this body?
def is_foi_officer?(user)
user_domain = user.email_domain
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 413e93e25..90c4c6b53 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -256,24 +256,47 @@ class RequestMailer < ApplicationMailer
def self.alert_overdue_requests()
info_requests = InfoRequest.find(:all,
:conditions => [
- "described_state = 'waiting_response' and awaiting_description = ? and user_id is not null", false
+ "described_state = 'waiting_response'
+ AND awaiting_description = ?
+ AND user_id is not null
+ AND (SELECT id
+ FROM user_info_request_sent_alerts
+ WHERE alert_type = 'very_overdue_1'
+ AND info_request_id = info_requests.id
+ AND user_id = info_requests.user_id
+ AND info_request_event_id = (SELECT max(id)
+ FROM info_request_events
+ WHERE event_type in ('sent',
+ 'followup_sent',
+ 'resent',
+ 'followup_resent')
+ AND info_request_id = info_requests.id)
+ ) IS NULL", false
],
:include => [ :user ]
)
for info_request in info_requests
alert_event_id = info_request.last_event_forming_initial_request.id
# Only overdue requests
- if ['waiting_response_overdue', 'waiting_response_very_overdue'].include?(info_request.calculate_status)
- if info_request.calculate_status == 'waiting_response_overdue'
+ calculated_status = info_request.calculate_status
+ if ['waiting_response_overdue', 'waiting_response_very_overdue'].include?(calculated_status)
+ if calculated_status == 'waiting_response_overdue'
alert_type = 'overdue_1'
- elsif info_request.calculate_status == 'waiting_response_very_overdue'
+ elsif calculated_status == 'waiting_response_very_overdue'
alert_type = 'very_overdue_1'
else
raise "unknown request status"
end
# For now, just to the user who created the request
- sent_already = UserInfoRequestSentAlert.find(:first, :conditions => [ "alert_type = ? and user_id = ? and info_request_id = ? and info_request_event_id = ?", alert_type, info_request.user_id, info_request.id, alert_event_id])
+ sent_already = UserInfoRequestSentAlert.find(:first, :conditions => [ "alert_type = ?
+ AND user_id = ?
+ AND info_request_id = ?
+ AND info_request_event_id = ?",
+ alert_type,
+ info_request.user_id,
+ info_request.id,
+ alert_event_id])
if sent_already.nil?
# Alert not yet sent for this user, so send it
store_sent = UserInfoRequestSentAlert.new
@@ -284,9 +307,9 @@ class RequestMailer < ApplicationMailer
# Only send the alert if the user can act on it by making a followup
# (otherwise they are banned, and there is no point sending it)
if info_request.user.can_make_followup?
- if info_request.calculate_status == 'waiting_response_overdue'
+ if calculated_status == 'waiting_response_overdue'
RequestMailer.deliver_overdue_alert(info_request, info_request.user)
- elsif info_request.calculate_status == 'waiting_response_very_overdue'
+ elsif calculated_status == 'waiting_response_very_overdue'
RequestMailer.deliver_very_overdue_alert(info_request, info_request.user)
else
raise "unknown request status"
diff --git a/app/models/user.rb b/app/models/user.rb
index 59f6c971c..4a68d60d1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -246,6 +246,11 @@ class User < ActiveRecord::Base
# Does the user magically gain powers as if they owned every request?
# e.g. Can classify it
def owns_every_request?
+ self.super?
+ end
+
+ # Does this user have extraordinary powers?
+ def super?
self.admin_level == 'super'
end
@@ -255,18 +260,18 @@ class User < ActiveRecord::Base
# Can the user see every request, even hidden ones?
def User.view_hidden_requests?(user)
- !user.nil? && user.admin_level == 'super'
+ !user.nil? && user.super?
end
# Should the user be kept logged into their own account
# if they follow a /c/ redirect link belonging to another user?
def User.stay_logged_in_on_redirect?(user)
- !user.nil? && user.admin_level == 'super'
+ !user.nil? && user.super?
end
# Does the user get "(admin)" links on each page on the main site?
def admin_page_links?
- self.admin_level == 'super'
+ self.super?
end
# Is it public that they are banned?
def public_banned?
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
index d854b53f5..0d6ae51e2 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -38,6 +38,9 @@
<p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/>
<%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p>
+ <p><label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL</label><br/>
+ <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale) %></p>
+
<p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/>
<%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p>
</div>
diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml
index 4a03d0665..62908ba52 100644
--- a/app/views/admin_public_body/import_csv.rhtml
+++ b/app/views/admin_public_body/import_csv.rhtml
@@ -51,7 +51,7 @@
</blockquote>
<p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n),
- publication_scheme (i18n), home_page, tag_string (tags separated by spaces).</p>
+ publication_scheme (i18n), disclosure_log (i18n), home_page, tag_string (tags separated by spaces).</p>
<p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without
actually altering the database. Choose <strong>upload</strong> to actually
diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml
index fa17d4027..094007c02 100644
--- a/app/views/admin_public_body/show.rhtml
+++ b/app/views/admin_public_body/show.rhtml
@@ -9,9 +9,9 @@
for column in columns %>
<b><%= column.human_name %>:</b>
- <% if column.name == 'home_page' and !column.name.empty? %>
+ <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column.name %>
<%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %>
- <% elsif column.name == 'request_email' and !column.name.empty? %>
+ <% elsif column.name == 'request_email' %>
<%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %>
<% if !@public_body.is_requestable? %>
(not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index 7f25cdd14..ec7b9bd8f 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -63,11 +63,18 @@
<ul>
<% for event in @request_events %>
<li>
- <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %>
+ <% if @request_events_all_successful %>
+ <%= _("{{public_body_link}} answered a request about",
+ :public_body_link => public_body_link(event.info_request.public_body)) %>
+ <% else %>
+ <%= _("{{public_body_link}} was sent a request about",
+ :public_body_link => public_body_link(event.info_request.public_body)) %>
+ <% end %>
+
<%=link_to h(event.info_request.title), request_url(event.info_request)%>
<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
<p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p>
- </li>
+ </li>
<% end %>
</ul>
<p><strong>
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index 0dd493fd0..7b4c0f6a1 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -139,7 +139,7 @@
<input type="text">
</div>
<%
- unless Configuration::ga_code.empty? %>
+ unless Configuration::ga_code.empty? || (@user && @user.super?) %>
<script>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index b56556d5d..e13f9d1c0 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -14,6 +14,9 @@
<% if !@public_body.publication_scheme.empty? %>
<%= link_to _('Publication scheme'), @public_body.publication_scheme %><br>
<% end %>
+ <% unless @public_body.disclosure_log.empty? %>
+ <%= link_to _('Disclosure log'), @public_body.disclosure_log %><br>
+ <% end %>
<% if @public_body.has_tag?("charity") %>
<% for tag_value in @public_body.get_tag_values("charity") %>
<% if tag_value.match(/^SC/) %>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index e3abfe393..ee1cc079a 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -17,13 +17,13 @@ end %>
</span>
<div class="requester">
<% if event.event_type == 'sent' %>
- <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
+ <%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'followup_sent' %>
<%=event.display_status %>
- <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
+ <%= _('sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'response' %>
<%=event.display_status %>
- <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
+ <%= _('by {{public_body_name}} to {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'comment' %>
<%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
<% else %>
@@ -35,12 +35,12 @@ end %>
</div>
<span class="bottomline icon_<%= info_request.calculate_status %>">
<strong>
- <%= info_request.display_status %>
+ <%= info_request.display_status(cached_value_ok=true) %>
</strong><br>
</span>
</div>
<div class="request_right">
- <span class="desc">
+ <span class="desc">
<%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
</span>
</div>