Commit b8e774f153002b1498788a9c96693c4008ec178f
Committed by
Macartur Sousa
1 parent
4ae80bab
Exists in
fix_sign_up_form
Elasticsearch: Fixed views and translations
Fixes minor bugs in style, adds link-to to search results, and translations
Showing
5 changed files
with
76 additions
and
26 deletions
Show diff stats
plugins/elasticsearch/public/style.css
@@ -3,11 +3,17 @@ | @@ -3,11 +3,17 @@ | ||
3 | } | 3 | } |
4 | 4 | ||
5 | .controller-elasticsearch_plugin .sidebar { | 5 | .controller-elasticsearch_plugin .sidebar { |
6 | - width: 150px; | 6 | + width: 175px; |
7 | +} | ||
8 | + | ||
9 | +.controller-elasticsearch_plugin .sidebar ul { | ||
10 | + margin-top: 0px; | ||
7 | } | 11 | } |
8 | 12 | ||
9 | .controller-elasticsearch_plugin .search_form { | 13 | .controller-elasticsearch_plugin .search_form { |
14 | + margin-top: 5px; | ||
10 | flex: 1; | 15 | flex: 1; |
16 | + margin-left: 15px; | ||
11 | } | 17 | } |
12 | 18 | ||
13 | .controller-elasticsearch_plugin .search_form .search_field { | 19 | .controller-elasticsearch_plugin .search_form .search_field { |
@@ -21,7 +27,6 @@ | @@ -21,7 +27,6 @@ | ||
21 | .controller-elasticsearch_plugin .results-count { | 27 | .controller-elasticsearch_plugin .results-count { |
22 | margin-top: 7px; | 28 | margin-top: 7px; |
23 | margin-right: 15px; | 29 | margin-right: 15px; |
24 | - text-align: right; | ||
25 | } | 30 | } |
26 | 31 | ||
27 | .controller-elasticsearch_plugin ul { | 32 | .controller-elasticsearch_plugin ul { |
@@ -30,7 +35,19 @@ | @@ -30,7 +35,19 @@ | ||
30 | padding-left: 0px; | 35 | padding-left: 0px; |
31 | } | 36 | } |
32 | 37 | ||
38 | +.controller-elasticsearch_plugin #content h3.box-title { | ||
39 | + background: #ccc; | ||
40 | + color: black; | ||
41 | + padding: 10px; | ||
42 | + border: 1px solid #948b8b; | ||
43 | + margin-left: 10px; | ||
44 | + margin-right: 10px; | ||
45 | + margin-bottom: 0px; | ||
46 | +} | ||
47 | + | ||
48 | +.controller-elasticsearch_plugin .search-filter ul li, | ||
33 | .controller-elasticsearch_plugin .select-search-type { | 49 | .controller-elasticsearch_plugin .select-search-type { |
50 | + text-decoration: none; | ||
34 | padding: 10px; | 51 | padding: 10px; |
35 | margin: 10px; | 52 | margin: 10px; |
36 | font-weight: 900; | 53 | font-weight: 900; |
@@ -39,13 +56,19 @@ | @@ -39,13 +56,19 @@ | ||
39 | margin-top: 0px; | 56 | margin-top: 0px; |
40 | margin-bottom: 0px; | 57 | margin-bottom: 0px; |
41 | } | 58 | } |
59 | + | ||
60 | +.controller-elasticsearch_plugin .search-filter ul li a { | ||
61 | + text-decoration: none; | ||
62 | + color: black; | ||
63 | +} | ||
64 | + | ||
42 | .controller-elasticsearch_plugin .select-search-type.active { | 65 | .controller-elasticsearch_plugin .select-search-type.active { |
43 | padding: 10px; | 66 | padding: 10px; |
44 | - background: #ccc; | 67 | + background: black; |
45 | margin-left: 10px; | 68 | margin-left: 10px; |
46 | margin-right: 10px; | 69 | margin-right: 10px; |
47 | font-weight: 900; | 70 | font-weight: 900; |
48 | - font-family: arial; | 71 | + border: 1px solid #000; |
49 | } | 72 | } |
50 | 73 | ||
51 | .controller-elasticsearch_plugin .select-search-type a { | 74 | .controller-elasticsearch_plugin .select-search-type a { |
@@ -53,6 +76,10 @@ | @@ -53,6 +76,10 @@ | ||
53 | color: black; | 76 | color: black; |
54 | } | 77 | } |
55 | 78 | ||
79 | +.controller-elasticsearch_plugin .select-search-type.active a { | ||
80 | + color: white; | ||
81 | +} | ||
82 | + | ||
56 | .controller-elasticsearch_plugin .search-item .model-label { | 83 | .controller-elasticsearch_plugin .search-item .model-label { |
57 | background: #ddd; | 84 | background: #ddd; |
58 | color: black; | 85 | color: black; |
@@ -61,8 +88,10 @@ | @@ -61,8 +88,10 @@ | ||
61 | } | 88 | } |
62 | 89 | ||
63 | .controller-elasticsearch_plugin .search-item { | 90 | .controller-elasticsearch_plugin .search-item { |
64 | - margin-bottom: 25px; | ||
65 | - margin-top: 25px; | 91 | + padding: 10px; |
92 | + margin-bottom: 15px; | ||
93 | + margin-top: 15px; | ||
94 | + padding-left: 0px; | ||
66 | } | 95 | } |
67 | 96 | ||
68 | .controller-elasticsearch_plugin .search-item .person-item { | 97 | .controller-elasticsearch_plugin .search-item .person-item { |
@@ -74,6 +103,17 @@ | @@ -74,6 +103,17 @@ | ||
74 | } | 103 | } |
75 | 104 | ||
76 | .controller-elasticsearch_plugin .left-side { | 105 | .controller-elasticsearch_plugin .left-side { |
77 | - margin-left: 25px; | ||
78 | - width: 100px; | 106 | + width: 80px; |
107 | +} | ||
108 | + | ||
109 | +.controller-elasticsearch_plugin .search-item .body { | ||
110 | + overflow: hidden; | ||
111 | + text-overflow: ellipsis; | ||
112 | + width: 600px; | ||
79 | } | 113 | } |
114 | + | ||
115 | +.controller-elasticsearch_plugin .search-item .body h2 a { | ||
116 | + color: #888a85; | ||
117 | + text-decoration: none; | ||
118 | +} | ||
119 | + |
plugins/elasticsearch/views/elasticsearch_plugin/_community_display.html.erb
1 | <div class="community-header"> | 1 | <div class="community-header"> |
2 | - <%= community.created_at.strftime("%d %B %Y at %H:%M") %> - <span class="model-label">COMUNIDADE</span> | 2 | + <%= community.created_at.strftime("%d %B %Y at %H:%M") %> - <span class="model-label"><%= _("Community") %></span> |
3 | </div> | 3 | </div> |
4 | <div class="body"> | 4 | <div class="body"> |
5 | - <h2><%= community.name %></h2> | 5 | + <h2><%= link_to community.name, community.url %></h2> |
6 | <p><%= community.description %></p> | 6 | <p><%= community.description %></p> |
7 | </div> | 7 | </div> |
plugins/elasticsearch/views/elasticsearch_plugin/_event_display.html.erb
1 | <div class="event-header"> | 1 | <div class="event-header"> |
2 | - <%= event.created_at.strftime("%d %B %Y at %H:%M") %> - <span class="model-label">EVENT</span> | 2 | + <%= event.created_at.strftime("%d %B %Y at %H:%M") %> - <span class="model-label"><%= _("Event") %></span> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <div class="body"> | 5 | <div class="body"> |
6 | - <h2><%= event.name %></h2> | 6 | + <h2><%= link_to event.name, event.url %></h2> |
7 | <p><%= event.body %></p> | 7 | <p><%= event.body %></p> |
8 | </div> | 8 | </div> |
plugins/elasticsearch/views/elasticsearch_plugin/_person_display.html.erb
@@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
3 | <%= profile_image person %> | 3 | <%= profile_image person %> |
4 | </div> | 4 | </div> |
5 | <div class="right-side"> | 5 | <div class="right-side"> |
6 | - <%= person.created_at.strftime("%d %B %Y at %H:%M") %> - <%= person.name %> <span class="model-label"><%= _("PERSON") %></span> | 6 | + <%= person.created_at.strftime("%d %B %Y at %H:%M") %> - <%= person.name %> <span class="model-label"><%= _("Person") %></span> |
7 | <div class="body"> | 7 | <div class="body"> |
8 | - <h2><%= person.name %></h2> | 8 | + <h2><%= link_to person.name, person.url %></h2> |
9 | <p><%= person.description %></p> | 9 | <p><%= person.description %></p> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
plugins/elasticsearch/views/elasticsearch_plugin/search.html.erb
1 | <div class="wrapper"> | 1 | <div class="wrapper"> |
2 | 2 | ||
3 | <div class="sidebar"> | 3 | <div class="sidebar"> |
4 | - <div class="results-count"> | ||
5 | - <%= @results.total %> <%= _(" results by") %> : | ||
6 | - </div> | 4 | + <h3 class="box-title"><%= _("Results") %></h3> |
7 | <ul> | 5 | <ul> |
8 | <% for type,value in @searchable_types %> | 6 | <% for type,value in @searchable_types %> |
9 | <li class="select-search-type <%= "active" if type == @selected_type %>"> | 7 | <li class="select-search-type <%= "active" if type == @selected_type %>"> |
@@ -13,7 +11,7 @@ | @@ -13,7 +11,7 @@ | ||
13 | </ul> | 11 | </ul> |
14 | 12 | ||
15 | <div class="search-filter"> | 13 | <div class="search-filter"> |
16 | - <h3><%= _("Filter by") %></h3> | 14 | + <h3 class="box-title"><%= _("Sort by") %></h3> |
17 | <ul> | 15 | <ul> |
18 | <% for type in @search_filter_types.values %> | 16 | <% for type in @search_filter_types.values %> |
19 | <li><a href="#"><%= type[:label] %></a></li> | 17 | <li><a href="#"><%= type[:label] %></a></li> |
@@ -23,14 +21,26 @@ | @@ -23,14 +21,26 @@ | ||
23 | </div> | 21 | </div> |
24 | 22 | ||
25 | <div class="search_form"> | 23 | <div class="search_form"> |
26 | - <div class="search_field"> | ||
27 | - <%= form_tag '/plugin/elasticsearch/search', method: :get do %> | ||
28 | - <%= hidden_field_tag "selected_type", @selected_type %> | ||
29 | - <%= hidden_field_tag "selected_filter_field", @selected_filter_field %> | ||
30 | - <%= text_field_tag :query, @query %> | ||
31 | - <%= submit_tag _("Send") %> | ||
32 | - <% end %> | ||
33 | - </div> | 24 | + <div class="search_field"> |
25 | + <%= form_tag '/plugin/elasticsearch/search', method: :get do %> | ||
26 | + <%= hidden_field_tag "selected_type", @selected_type %> | ||
27 | + <%= hidden_field_tag "selected_filter_field", @selected_filter_field %> | ||
28 | + <%= text_field_tag :query, @query %> | ||
29 | + <%= submit_tag _("Send") %> | ||
30 | + <% end %> | ||
31 | + </div> | ||
32 | + <div class="results-count"> | ||
33 | + <% if not @query.blank? %> | ||
34 | + <p> | ||
35 | + <strong><%= @results.total %></strong><%= _(" results for ") %><%= @query %> | ||
36 | + </p> | ||
37 | + <% else %> | ||
38 | + <p> | ||
39 | + <strong><%= @results.total %></strong><%= _(" total results") %> | ||
40 | + </p> | ||
41 | + <% end %> | ||
42 | + </div> | ||
43 | + | ||
34 | 44 | ||
35 | <div class="results"> | 45 | <div class="results"> |
36 | <% for result in @results.to_a %> | 46 | <% for result in @results.to_a %> |