Commit 5c7eff4827fb1e1991eb12b536b30a7521092107
Committed by
Macartur Sousa
1 parent
8e2631be
Exists in
elasticsearch_filter
and in
1 other branch
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 | 3 | } |
| 4 | 4 | |
| 5 | 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 | 13 | .controller-elasticsearch_plugin .search_form { |
| 14 | + margin-top: 5px; | |
| 10 | 15 | flex: 1; |
| 16 | + margin-left: 15px; | |
| 11 | 17 | } |
| 12 | 18 | |
| 13 | 19 | .controller-elasticsearch_plugin .search_form .search_field { |
| ... | ... | @@ -21,7 +27,6 @@ |
| 21 | 27 | .controller-elasticsearch_plugin .results-count { |
| 22 | 28 | margin-top: 7px; |
| 23 | 29 | margin-right: 15px; |
| 24 | - text-align: right; | |
| 25 | 30 | } |
| 26 | 31 | |
| 27 | 32 | .controller-elasticsearch_plugin ul { |
| ... | ... | @@ -30,7 +35,19 @@ |
| 30 | 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 | 49 | .controller-elasticsearch_plugin .select-search-type { |
| 50 | + text-decoration: none; | |
| 34 | 51 | padding: 10px; |
| 35 | 52 | margin: 10px; |
| 36 | 53 | font-weight: 900; |
| ... | ... | @@ -39,13 +56,19 @@ |
| 39 | 56 | margin-top: 0px; |
| 40 | 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 | 65 | .controller-elasticsearch_plugin .select-search-type.active { |
| 43 | 66 | padding: 10px; |
| 44 | - background: #ccc; | |
| 67 | + background: black; | |
| 45 | 68 | margin-left: 10px; |
| 46 | 69 | margin-right: 10px; |
| 47 | 70 | font-weight: 900; |
| 48 | - font-family: arial; | |
| 71 | + border: 1px solid #000; | |
| 49 | 72 | } |
| 50 | 73 | |
| 51 | 74 | .controller-elasticsearch_plugin .select-search-type a { |
| ... | ... | @@ -53,6 +76,10 @@ |
| 53 | 76 | color: black; |
| 54 | 77 | } |
| 55 | 78 | |
| 79 | +.controller-elasticsearch_plugin .select-search-type.active a { | |
| 80 | + color: white; | |
| 81 | +} | |
| 82 | + | |
| 56 | 83 | .controller-elasticsearch_plugin .search-item .model-label { |
| 57 | 84 | background: #ddd; |
| 58 | 85 | color: black; |
| ... | ... | @@ -61,8 +88,10 @@ |
| 61 | 88 | } |
| 62 | 89 | |
| 63 | 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 | 97 | .controller-elasticsearch_plugin .search-item .person-item { |
| ... | ... | @@ -74,6 +103,17 @@ |
| 74 | 103 | } |
| 75 | 104 | |
| 76 | 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 | 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 | 3 | </div> |
| 4 | 4 | <div class="body"> |
| 5 | - <h2><%= community.name %></h2> | |
| 5 | + <h2><%= link_to community.name, community.url %></h2> | |
| 6 | 6 | <p><%= community.description %></p> |
| 7 | 7 | </div> | ... | ... |
plugins/elasticsearch/views/elasticsearch_plugin/_event_display.html.erb
| 1 | 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 | 3 | </div> |
| 4 | 4 | |
| 5 | 5 | <div class="body"> |
| 6 | - <h2><%= event.name %></h2> | |
| 6 | + <h2><%= link_to event.name, event.url %></h2> | |
| 7 | 7 | <p><%= event.body %></p> |
| 8 | 8 | </div> | ... | ... |
plugins/elasticsearch/views/elasticsearch_plugin/_person_display.html.erb
| ... | ... | @@ -3,9 +3,9 @@ |
| 3 | 3 | <%= profile_image person %> |
| 4 | 4 | </div> |
| 5 | 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 | 7 | <div class="body"> |
| 8 | - <h2><%= person.name %></h2> | |
| 8 | + <h2><%= link_to person.name, person.url %></h2> | |
| 9 | 9 | <p><%= person.description %></p> |
| 10 | 10 | </div> |
| 11 | 11 | </div> | ... | ... |
plugins/elasticsearch/views/elasticsearch_plugin/search.html.erb
| 1 | 1 | <div class="wrapper"> |
| 2 | 2 | |
| 3 | 3 | <div class="sidebar"> |
| 4 | - <div class="results-count"> | |
| 5 | - <%= @results.total %> <%= _(" results by") %> : | |
| 6 | - </div> | |
| 4 | + <h3 class="box-title"><%= _("Results") %></h3> | |
| 7 | 5 | <ul> |
| 8 | 6 | <% for type,value in @searchable_types %> |
| 9 | 7 | <li class="select-search-type <%= "active" if type == @selected_type %>"> |
| ... | ... | @@ -13,7 +11,7 @@ |
| 13 | 11 | </ul> |
| 14 | 12 | |
| 15 | 13 | <div class="search-filter"> |
| 16 | - <h3><%= _("Filter by") %></h3> | |
| 14 | + <h3 class="box-title"><%= _("Sort by") %></h3> | |
| 17 | 15 | <ul> |
| 18 | 16 | <% for type in @search_filter_types.values %> |
| 19 | 17 | <li><a href="#"><%= type[:label] %></a></li> |
| ... | ... | @@ -23,14 +21,26 @@ |
| 23 | 21 | </div> |
| 24 | 22 | |
| 25 | 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 | 45 | <div class="results"> |
| 36 | 46 | <% for result in @results.to_a %> | ... | ... |