key = query_string.keyword if (query_string.keyword and !query_string.keyword.empty?) status = query_string.status if (query_string.status and !query_string.status.empty?) results = Kaya::API::Results.show() results_list = results["results"] if key keyword = key.downcase results_list.select! do |result_data| result_data["execution_name"].downcase.include? keyword or result_data["summary"].downcase.include? keyword or result_data["suite"].inspect.downcase.include? keyword or result_data["command"].downcase.include? keyword or result_data["execution_data"].inspect.downcase.include? keyword or result_data["custom_params"].inspect.downcase.include? keyword end results_list.select!{|result_data| result_data["_id"]==key} if key.is_a? Fixnum end if status results_list.select! do |res| res["status"].downcase==status.downcase or (res["summary"].split("step").first.downcase.include? status.downcase and res["summary"].split("step").first.scan(/\(\d.+\)/).first.scan(/[a-z]+/).first == status ) end end results_size_text = if (key or status) "#{results_list.size} result#{'s' if results_list.size>1} found" else "Showing #{results_list.size} results." end ?>
{{results_size_text}}