smart_search 0.0.4 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/config/database.yml +6 -0
  3. data/config/routes.rb +3 -2
  4. data/lib/smart_search/smart_search_engine.rb +10 -0
  5. data/lib/smart_search.rb +156 -78
  6. data/lib/smart_search_history.rb +7 -0
  7. data/lib/smart_search_ignore_word.rb +30 -0
  8. data/lib/smart_search_tag.rb +16 -0
  9. data/lib/smart_similarity.rb +133 -0
  10. data/lib/tasks/smart_search.rake +58 -0
  11. data/lib/tasks/testing.rake +27 -0
  12. data/test/test_document_multi_line.txt +6 -0
  13. data/test/test_document_one_line.txt +1 -0
  14. data/test/test_helper.rb +77 -0
  15. data/test/unit/01_smart_search_test.rb +81 -0
  16. data/test/unit/02_smart_search_similarity_test.rb +32 -0
  17. data/test/unit/03_smart_search_boost_test.rb +60 -0
  18. metadata +92 -35
  19. data/app/controllers/search_controller.rb +0 -46
  20. data/app/views/search/_results_small.html.erb +0 -25
  21. data/app/views/search/all.html.erb +0 -15
  22. data/app/views/search/results/_ansprechpartner.html.erb +0 -8
  23. data/app/views/search/results/_calendar_entry.html.erb +0 -29
  24. data/app/views/search/results/_company.html.erb +0 -25
  25. data/app/views/search/results/_concept.html.erb +0 -26
  26. data/app/views/search/results/_customer.html.erb +0 -51
  27. data/app/views/search/results/_family.html.erb +0 -1
  28. data/app/views/search/results/_firma.html.erb +0 -1
  29. data/app/views/search/results/_product.html.erb +0 -37
  30. data/app/views/search/results/_smart_document.html.erb +0 -8
  31. data/app/views/search/results/_topic.html.erb +0 -8
  32. data/app/views/search/results/_umsatz.html.erb +0 -1
  33. data/app/views/search/results/_umsatz_refactor.html.erb +0 -4
  34. data/app/views/search/results/_umsatz_storno.html.erb +0 -1
  35. data/app/views/search/results/_user.html.erb +0 -3
  36. data/app/views/search/results/_wiki_page.html.erb +0 -9
  37. data/lib/add_search_tags.rb +0 -8
@@ -0,0 +1,77 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ require 'test/unit'
5
+ require 'active_support'
6
+ require 'active_record'
7
+ require 'active_model'
8
+
9
+ require "smart_search"
10
+ require "smart_search/smart_search_engine"
11
+
12
+
13
+ ActiveRecord::Base.establish_connection(:adapter => "mysql2", :database => "smart_search_test")
14
+
15
+ ActiveRecord::Schema.define(:version => 1) do
16
+ create_table :users do |t|
17
+ t.string :first_name
18
+ t.string :last_name
19
+ t.integer :office_id
20
+ t.date :birthday
21
+ t.timestamps
22
+ end
23
+
24
+ create_table :customers do |t|
25
+ t.string :first_name
26
+ t.string :last_name
27
+ t.integer :user_id
28
+ t.date :birthday
29
+ t.timestamps
30
+ end
31
+
32
+ create_table :offices do |t|
33
+ t.string :name
34
+ t.timestamps
35
+ end
36
+
37
+
38
+ end
39
+ #
40
+ # def drop_db
41
+ # ActiveRecord::Base.connection.tables.each do |table|
42
+ # ActiveRecord::Base.connection.drop_table(table)
43
+ # end
44
+ # end
45
+ #
46
+ class User < ActiveRecord::Base
47
+
48
+ belongs_to :office, :class_name => "Office", :foreign_key => "office_id"
49
+
50
+ smart_search :on => [:full_name, 'office.name']
51
+
52
+ def full_name
53
+ "#{self.first_name} #{self.last_name}"
54
+ end
55
+ end
56
+
57
+ class Customer < ActiveRecord::Base
58
+ smart_search :on => [:first_name, :last_name, 'user.full_name', 'user.office.name', :birthday]
59
+
60
+ def user
61
+ User.find(self.user_id)
62
+ end
63
+
64
+ end
65
+
66
+ # This one has not included smart-search yet
67
+ class Office < ActiveRecord::Base
68
+ smart_search :on => [:name, :user_names]
69
+
70
+ def user_names
71
+ self.users.map {|u| u.full_name }.join(" ")
72
+ end
73
+
74
+ def users
75
+ User.find_all_by_office_id(self.id)
76
+ end
77
+ end
@@ -0,0 +1,81 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require "test_helper"
3
+ class SmartSearchTest < Test::Unit::TestCase
4
+
5
+ def test_simple_search_tags_should_be_saved
6
+ office_name = "Office1"
7
+ office = Office.create(:name => office_name)
8
+
9
+ Office.enable_similarity = false
10
+
11
+ assert_equal office, Office.find_by_tags(office_name).first
12
+ end
13
+
14
+ def test_search_tags_should_cross_reference
15
+
16
+ office_name = "Office2"
17
+
18
+ office = Office.create(:name => office_name)
19
+ user = User.create(:first_name => "My", :last_name => "User", :office_id => office.id)
20
+
21
+ assert_equal user, User.find_by_tags("My User").first
22
+ assert_equal user, User.find_by_tags(office_name).first
23
+
24
+ # test that all is linked correctly
25
+ assert_equal user.office, office
26
+ assert_equal user.office_id, office.id
27
+ assert_equal 1, office.users.size
28
+
29
+ # test for loading user names to office
30
+ office.save
31
+
32
+ assert_equal office, Office.find_by_tags("My User").first
33
+
34
+ end
35
+
36
+ def test_should_use_default_conditions
37
+ office_id_ok = 4
38
+ office_id_nok = 5
39
+
40
+ User.smart_search :on => [:full_name], :conditions => "office_id <> #{office_id_nok}", :force => true
41
+ User.enable_similarity = false
42
+
43
+ user = User.create(:first_name => "Unknown", :last_name => "User", :office_id => office_id_nok)
44
+ user = User.create(:first_name => "Public", :last_name => "User", :office_id => office_id_ok)
45
+
46
+ assert_equal User.find_by_tags("unknown").size, 0
47
+ assert_equal User.find_by_tags("public").size, 1
48
+ end
49
+
50
+ def test_should_use_default_order_and_order_should_be_overwriteable
51
+ User.smart_search :on => [:full_name], :order => :first_name, :force => true
52
+ User.enable_similarity = false
53
+
54
+ user_c = User.create(:first_name => "C", :last_name => "Test1")
55
+ user_a = User.create(:first_name => "A", :last_name => "Test3")
56
+ user_b = User.create(:first_name => "B", :last_name => "Test2")
57
+
58
+
59
+ assert_equal user_a, User.find_by_tags("test").first
60
+ assert_equal user_c, User.find_by_tags("test").last
61
+
62
+ assert_equal user_c, User.find_by_tags("test", :order => :last_name).first
63
+ assert_equal user_a, User.find_by_tags("test", :order => :last_name).last
64
+ end
65
+
66
+ def test_search_tags_should_work_with_array_of_strings
67
+ User.smart_search :on => %w(first_name last_name office.name), :force => true
68
+ o = Office.create(:name => "Neandertal")
69
+ u = User.create(:first_name => "Homo", :last_name => "Sapiens", :office_id => o.id)
70
+
71
+ end
72
+
73
+
74
+ def test_should_create_search_history
75
+ User.find_by_tags("XXXYYY")
76
+
77
+ assert_not_equal 0, SmartSearchHistory.where(:query => "XXXYYY").size
78
+ end
79
+
80
+
81
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require "test_helper"
3
+ class SmartSearchSimilartyTest < Test::Unit::TestCase
4
+
5
+ def test_similarity_should_load_from_file
6
+ testfile_1 = File.expand_path("../../test_document_one_line.txt", __FILE__)
7
+ testfile_2 = File.expand_path("../../test_document_multi_line.txt", __FILE__)
8
+ SmartSimilarity.connection.execute "Truncate table #{SmartSimilarity.table_name}"
9
+
10
+ assert_equal 0, SmartSimilarity.count
11
+ SmartSimilarity.load_file(testfile_2)
12
+ new_count = SmartSimilarity.count
13
+ assert_not_equal 0, new_count
14
+
15
+ SmartSimilarity.load_file(testfile_1)
16
+ assert_not_equal new_count, SmartSimilarity.count
17
+ end
18
+
19
+ def test_similarity_should_load_from_url
20
+ count = SmartSimilarity.count
21
+ SmartSimilarity.load_url("https://github.com/florianeck/smart_search")
22
+ assert_not_equal count, SmartSimilarity.count
23
+ end
24
+
25
+ def test_similarity_should_load_from_history
26
+ count = SmartSimilarity.count
27
+ User.find_by_tags("this is history now")
28
+ SmartSimilarity.load_from_query_history
29
+ assert_not_equal count, SmartSimilarity.count
30
+ end
31
+
32
+ end
@@ -0,0 +1,60 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require "test_helper"
3
+ class SmartSearchBoostTest < Test::Unit::TestCase
4
+
5
+ def test_boost_search_index_cols_should_be_created
6
+ SmartSearchTag.connection.execute("TRUNCATE #{SmartSearchTag.table_name}")
7
+ Customer.smart_search :on => [
8
+ {:field_name => :first_name, :boost => 1},
9
+ {:field_name => :last_name, :boost => 2},
10
+ {:field_name => "user.full_name", :boost => 0.5},
11
+ ], :force => true
12
+
13
+ user = User.create(:first_name => "Pi", :last_name => "Pa")
14
+
15
+ Customer.create(:first_name => "Lorem", :last_name => "Ipsum", :user_id => user.id)
16
+
17
+ assert_equal 1, SmartSearchTag.where(:field_name => "first_name", :boost => 1).count
18
+ assert_equal 1, SmartSearchTag.where(:field_name => "last_name", :boost => 2).count
19
+ assert_equal 1, SmartSearchTag.where(:field_name => "user.full_name", :boost => 0.5).count
20
+ end
21
+
22
+ def test_boost_search__results_should_order_by_score
23
+ Customer.smart_search :on => [
24
+ {:field_name => :first_name, :boost => 1},
25
+ {:field_name => :last_name, :boost => 2},
26
+ {:field_name => "user.full_name", :boost => 0.5},
27
+ ], :force => true
28
+
29
+ user = User.create(:first_name => "Rudi", :last_name => "Piff")
30
+
31
+ c1 = Customer.create(:first_name => "Rudi", :last_name => "Rolle", :user_id => user.id)
32
+ c2 = Customer.create(:first_name => "Rolle", :last_name => "Rudi", :user_id => user.id)
33
+ c3 = Customer.create(:first_name => "Jackie", :last_name => "Brown", :user_id => user.id)
34
+
35
+ results = Customer.find_by_tags("Rudi")
36
+
37
+ assert_equal c1, results[1]
38
+ assert_equal c2, results[0]
39
+ assert_equal c3, results[2]
40
+ end
41
+
42
+
43
+ def test_same_boost_search_index_cols_should_be_grouped
44
+
45
+ Customer.smart_search :on => [
46
+ {:field_name => :first_name, :boost => 2},
47
+ {:field_name => :last_name, :boost => 2},
48
+ {:field_name => "user.full_name", :boost => 0.5},
49
+ ], :force => true
50
+
51
+ user = User.create(:first_name => "Pipi", :last_name => "Papa")
52
+
53
+ customer = Customer.create(:first_name => "Lorem", :last_name => "Ipsum", :user_id => user.id)
54
+
55
+ assert_equal 2, SmartSearchTag.where(:table_name => Customer.table_name, :entry_id => customer.id).count
56
+ end
57
+
58
+
59
+
60
+ end
metadata CHANGED
@@ -1,66 +1,123 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Florian Eck
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-11 00:00:00.000000000 Z
13
- dependencies: []
14
- description: Adds easy to use full-text search to ActiveRecord models, based the attributes
15
- you want to search. Including Controllers
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.9
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.9
27
+ - !ruby/object:Gem::Dependency
28
+ name: amatch
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: friendly_extensions
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.61
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.61
55
+ - !ruby/object:Gem::Dependency
56
+ name: mysql2
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: SmartSearch adds full-text search functions to ActiveRecord running with
70
+ MySQL, including search for similiar words. Its fast, simple, and works with almost
71
+ zero-config!
16
72
  email: it-support@friends-systems.de
17
73
  executables: []
18
74
  extensions: []
19
75
  extra_rdoc_files: []
20
76
  files:
21
- - lib/add_search_tags.rb
22
- - lib/smart_search.rb
23
- - app/controllers/search_controller.rb
24
- - app/views/search/_results_small.html.erb
25
- - app/views/search/all.html.erb
26
- - app/views/search/results/_ansprechpartner.html.erb
27
- - app/views/search/results/_calendar_entry.html.erb
28
- - app/views/search/results/_company.html.erb
29
- - app/views/search/results/_concept.html.erb
30
- - app/views/search/results/_customer.html.erb
31
- - app/views/search/results/_family.html.erb
32
- - app/views/search/results/_firma.html.erb
33
- - app/views/search/results/_product.html.erb
34
- - app/views/search/results/_smart_document.html.erb
35
- - app/views/search/results/_topic.html.erb
36
- - app/views/search/results/_umsatz.html.erb
37
- - app/views/search/results/_umsatz_refactor.html.erb
38
- - app/views/search/results/_umsatz_storno.html.erb
39
- - app/views/search/results/_user.html.erb
40
- - app/views/search/results/_wiki_page.html.erb
77
+ - config/database.yml
41
78
  - config/routes.rb
42
- homepage: https://rubygems.org/gems/smart_search
79
+ - lib/smart_search.rb
80
+ - lib/smart_search/smart_search_engine.rb
81
+ - lib/smart_search_history.rb
82
+ - lib/smart_search_ignore_word.rb
83
+ - lib/smart_search_tag.rb
84
+ - lib/smart_similarity.rb
85
+ - lib/tasks/smart_search.rake
86
+ - lib/tasks/testing.rake
87
+ - test/test_document_multi_line.txt
88
+ - test/test_document_one_line.txt
89
+ - test/test_helper.rb
90
+ - test/unit/01_smart_search_test.rb
91
+ - test/unit/02_smart_search_similarity_test.rb
92
+ - test/unit/03_smart_search_boost_test.rb
93
+ homepage: https://github.com/florianeck/smart_search
43
94
  licenses: []
95
+ metadata: {}
44
96
  post_install_message:
45
97
  rdoc_options: []
46
98
  require_paths:
47
99
  - lib
48
100
  required_ruby_version: !ruby/object:Gem::Requirement
49
- none: false
50
101
  requirements:
51
- - - ! '>='
102
+ - - ">="
52
103
  - !ruby/object:Gem::Version
53
104
  version: '0'
54
105
  required_rubygems_version: !ruby/object:Gem::Requirement
55
- none: false
56
106
  requirements:
57
- - - ! '>='
107
+ - - ">="
58
108
  - !ruby/object:Gem::Version
59
109
  version: '0'
60
110
  requirements: []
61
111
  rubyforge_project:
62
- rubygems_version: 1.8.25
112
+ rubygems_version: 2.2.1
63
113
  signing_key:
64
- specification_version: 3
65
- summary: Simple, easy to use search.
66
- test_files: []
114
+ specification_version: 4
115
+ summary: Simple, easy to use search MySQL based search for ActiveRecord
116
+ test_files:
117
+ - test/test_document_multi_line.txt
118
+ - test/test_document_one_line.txt
119
+ - test/test_helper.rb
120
+ - test/unit/01_smart_search_test.rb
121
+ - test/unit/02_smart_search_similarity_test.rb
122
+ - test/unit/03_smart_search_boost_test.rb
123
+ has_rdoc:
@@ -1,46 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- class SearchController < ApplicationController
3
-
4
- def all
5
-
6
- if params[:search]
7
- @query = params[:search][:query]
8
- else
9
- @query = params[:query]
10
- end
11
-
12
- unless @query.blank?
13
- team = current_user.get_team_tree(:get_ids => true )
14
- @results = []
15
- SmartSearch::Config.get_search_models.each do |m|
16
- if params[:only].nil? || params[:only] == m.to_s.split("::").last
17
- #if (admin? || backoffice? || controller? || backoffice_vertrieb?) || !m.column_names.include?("user_id") || SmartSearch::Config.get_public_models.include?(m)
18
-
19
- if SmartSearch::Config.get_public_models.include?(m)
20
- @results << m.find_by_tags(@query)
21
- elsif m.column_names.include?("user_id")
22
- @results << m.find_by_tags(@query, {:user_id => team})
23
- elsif m.column_names.include?("account_id")
24
- @results << m.find_by_tags(@query, {:account_id => current_user.account_id})
25
- else
26
-
27
- end
28
- end
29
- end
30
-
31
- @empty = @results.flatten.empty?
32
-
33
- if request.xhr?
34
- render :partial => "/search/results_small", :locals => {:results => @results, :no_limit => !params[:only].nil?}, :layout => params[:layout]
35
- end
36
- else
37
- render :text => "Bitte geben Sie einen Suchbegriff ein"
38
- end
39
-
40
- end
41
-
42
- end
43
-
44
-
45
-
46
- # (admin? || backoffice? || controller? || backoffice_vertrieb?) ||
@@ -1,25 +0,0 @@
1
- <div id="smartsearch-results-container-small">
2
- <div class="bold teaser">
3
- <%= "keine " if @empty %>Suchergebnisse für
4
- <%= form_for :search, :url => {:controller => "search", :action => "all", :layout => "info_overlay"}, :html => default_ajax_link(:update => FOOTER_SEARCH_RESULTS_ID).merge!(:style => "display: inline;") do |f| %>
5
- <%= f.text_field :query, :value => "Suchbegriff eingeben", :value => @query, :style => "width: 25%" %>
6
- <% end %>
7
- </div>
8
- <% @results.each do |results| %>
9
- <% limit = no_limit ? results.size : 5 %>
10
- <% unless results.empty? %>
11
- <h3 class="result-small-header cf"><%= "Suchergebnisse in #{(results[0].class.name+'_results').to_label}" %> <%= " - Zeige #{limit} von #{results.size}" if (results.size > limit) %> <%#= link_to_if(results.size > limit, "Alle (#{results.size})", ) %>
12
- <% if (results.size > limit) %>
13
- <span class="metainfo"><%= link_to "Zeige alle Ergebnisse", { :controller => "/search", :action => "all", :only => results[0].class.name, :query => (params[:search][:query] rescue params[:query]), :layout => params[:layout]}, default_ajax_link(:update => FOOTER_SEARCH_RESULTS_ID, :load_message => true, :class => "next-link") %></span>
14
- <% elsif no_limit %>
15
- <span class="metainfo"><%= link_to "zurück", { :controller => "/search", :action => "all", :query => (params[:search][:query] rescue params[:query]), :layout => params[:layout]}, default_ajax_link(:update => FOOTER_SEARCH_RESULTS_ID, :load_message => true, :class => "prev-link") %></span>
16
- <% end %>
17
- </h3>
18
- <% results.first(limit).each do |r| %>
19
- <div class="result-block-small"><%= render :partial => r.result_template_path, :locals => {:result => r, :small => true} %></div>
20
- <% end %>
21
- <div class="seperator small">&nbsp;</div>
22
- <% end %>
23
- <% end %>
24
-
25
- </div>
@@ -1,15 +0,0 @@
1
- <div class="search-">
2
- <%= page_title "Suchergebnisse für '#{@query}'" %>
3
-
4
- <div id="smartsearch-results-container">
5
- <% @results.each do |results| %>
6
- <% if results.empty? %>
7
- <% else %>
8
- <h3>Suchergebnisse in <%= "#{results[0].class.name}_results".to_label %> (<%= results.size %>)</h3>
9
- <% results.each do |r| %>
10
- <%= render :partial => r.result_template_path, :locals => {:result => r } %>
11
- <% end %>
12
- <%= seperator %>
13
- <% end %>
14
- <% end %>
15
- </div>
@@ -1,8 +0,0 @@
1
- <div class="spacer highlighter">
2
- <div class="field-container-4-cols cf">
3
- <div class="container"><%= link_to result.company.name, {:controller => "/companies", :action => "show", :id => result.company.id}, default_ajax_link() %><br /></div>
4
- <div class="center-left"><%= result.name %> (<%= result.art %>)</div>
5
- <div class="center-right"><%= result.phone %></div>
6
- <div class="container"><%= email_link(result.email) %></div>
7
- </div>
8
- </div>
@@ -1,29 +0,0 @@
1
- <% small ||= false %>
2
-
3
- <% if small == false %>
4
- <div class="highlighter <%= cycle('odd', 'even', :name => "customer_results") %> <%= result.css_class %>">
5
- <b><%= link_to result.name, {} %></b><br />
6
- <div class="field-container-4-cols cf">
7
- <div class="container">
8
- <div class="metainfo">Status</div>
9
- <div><%= result.type(:name) %></div>
10
- <div><%= result.status %></div>
11
- </div>
12
- <div class="center-left">
13
- <div class="metainfo">Beginn/Ende</div>
14
- <div>von <%= result.starts_at.to_de %></div>
15
- <div>bis <%= result.ends_at.to_de %></div>
16
- </div>
17
- <div class="center-right">
18
- <div class="metainfo">Berater</div>
19
- <div><%= result.user.full_name %></div>
20
- </div>
21
- <div class="container">
22
- </div>
23
- </div>
24
- </div>
25
- <% else %>
26
- <%= link_to result.name, {} %> (<span class="metainfo"><%= result.user.full_name rescue "-" %></span>)
27
- <br />
28
- <%= result.type(:name) %> | <%= result.status %> | <%= result.starts_at.to_de %>
29
- <% end %>
@@ -1,25 +0,0 @@
1
- <% small ||= false %>
2
-
3
- <% if small == false %>
4
- <div class="highlighter <%= cycle('odd', 'even', :name => "company_results") %>">
5
- <b><%= link_to result.name, {} %></b><br />
6
- <div class="field-container-4-cols cf">
7
- <div class="container">
8
- <div class="metainfo">Anbindung</div>
9
- <div><%= result.direct ? "Direktanbindung" : "keine Direktanbindung" %></div>
10
- </div>
11
- <div class="center-left">
12
- <div class="metainfo">VP-Nr</div>
13
- <div><%= result.direct ? result.vp_nr : "keine VP-Nummer" %></div>
14
- </div>
15
- <div class="center-right">
16
-
17
- </div>
18
- <div class="container">
19
- </div>
20
- </div>
21
- </div>
22
- <% else %>
23
- <%= link_to result.name, {:controller => "/companies", :action => "show", :id => result.id}, default_ajax_link() %><br />
24
- <%#= result.direct ? "Direktanbindung" : "keine Direktanbindung" %> / <%#= result.direct ? "VP-Nr: #{result.vp_nr}" : "keine VP-Nummer" %>
25
- <% end %>
@@ -1,26 +0,0 @@
1
- <div class="highlighter <%= cycle('odd', 'even', :name => "customer_results") %>">
2
- <b><%= link_to result.customer.full_name, :controller => "/concepts", :action => "data_form", :concept_id => result.id %></b><br />
3
- <div class="field-container-4-cols cf">
4
- <div class="container">
5
- <div class="metainfo">Status</div>
6
- <div>
7
- <% if result.firma_concept %>
8
- Firmenkonzept
9
- <% elsif result.family_concept %>
10
- Familienkonzept
11
- <% else %>
12
- Standardkonzept
13
- <% end %>
14
- <%= progress_bar(result.ist_concept.progress_percent) %>
15
- </div>
16
- </div>
17
- <div class="center-left">
18
- <div class="metainfo">Datum</div>
19
- <div>erstellt: <%= result.created_at.to_de %></div>
20
- </div>
21
- <div class="center-right">
22
- </div>
23
- <div class="container">
24
- </div>
25
- </div>
26
- </div>
@@ -1,51 +0,0 @@
1
- <% small ||= false %>
2
-
3
- <% if small == false %>
4
- <div class="highlighter <%= cycle('odd', 'even', :name => "customer_results") %>">
5
- <b><%= link_to result.full_name, :controller => "/customers", :action => "show", :id => result.id %></b><br />
6
- <div><%= result.notes.clear_html rescue nil %></div>
7
- <div class="field-container-4-cols cf">
8
- <div class="container">
9
- <div class="metainfo">Kontaktdaten</div>
10
- <div><%= result.personal_data.phone %></div>
11
- <div><%= result.personal_data.mobile %></div>
12
- <div><%= result.personal_data.email %></div>
13
- </div>
14
- <div class="center-left">
15
- <div class="metainfo">Anschrift</div>
16
- <div><%= result.personal_data.adress %></div>
17
- </div>
18
- <div class="center-right">
19
- <div class="metainfo">Persönliches</div>
20
- <div>geb. <%= result.personal_data.birthday %></div>
21
- </div>
22
- <div class="container">
23
- <div class="metainfo">
24
- <% if result.concepts.empty? %>
25
- keine Konzepte
26
- <% else %>
27
- <%= result.ist_concepts.size %> Konzept(e)
28
- <% end %>
29
- </div>
30
- <% result.ist_concepts.each do |concept| %>
31
- <% if concept.firma_concept %>
32
- Firmenkonzept
33
- <% elsif concept.family_concept %>
34
- Familienkonzept
35
- <% else %>
36
- Standardkonzept
37
- <% end %> (<%= concept.created_at.to_de %>)
38
- <%= progress_bar(concept.progress_percent, :size => :small) %>
39
- <% end %>
40
- </div>
41
- </div>
42
- </div>
43
- <% else %>
44
- <div class="field-container-4-cols highlighter cf">
45
- <div class="container"><%= link_to(result.full_name, {:controller => "/customers", :action => "customer_detail_ajax", :id => result.id, :layout => "ajax_overlay"}, default_ajax_link()) %> </div>
46
- <div class="center-left metainfo"><%= result.user.full_name rescue "-" %></div>
47
- <div class="center-right"></div>
48
- <div class="container"></div>
49
- </div>
50
-
51
- <% end %>
@@ -1 +0,0 @@
1
- <%= render :partial => "/smart/search/results/customer", :locals => {:result => result, :small => small} %>
@@ -1 +0,0 @@
1
- <%= render :partial => "/smart/search/results/customer", :locals => {:result => result} %>