Skip to content

Commit

Permalink
Improved the layout on empty searches/things
Browse files Browse the repository at this point in the history
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
  • Loading branch information
mssola committed Mar 14, 2024
1 parent 64e2bca commit 873e46e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 11 additions & 2 deletions app/views/searches/_search.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<div id="items">
<% items.values.flatten.each do |item| %>
<%= render item %>
<% els = items.values.flatten %>
<% if els.empty? %>
<% if current_user.last_search_id.nil? %>
<p><%= I18n.t('things.none') %> <%= link_to I18n.t('license.here'), new_thing_path %>.</p>
<% else %>
<p><%= I18n.t('searches.none') %>.</p>
<% end %>
<% else %>
<% els.each do |item| %>
<%= render item %>
<% end %>
<% end %>
</div>
5 changes: 4 additions & 1 deletion config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ ca:
home: Tot
save: guarda cerca
public: Públic
none: 'No hi ha cap resultat per a aquesta cerca'

shared:
title: Cerques públiques
Expand All @@ -109,10 +110,12 @@ ca:

things:
object: font
destroy-success: Font esborrada correctament
none: Encara no hi ha cap font. Pots crear-ne una fent click

create-another: Afegeix-ne una altra
create-success: Nova font creada correctament
update-success: Font actualitzada correctament
destroy-success: Font esborrada correctament

status:
read: Llegit
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ en:
home: Home
save: save search
public: Public
none: There are no items for this search

shared:
title: Public searches
Expand All @@ -111,6 +112,7 @@ en:
things:
object: source
create-another: Create another one
none: There are no sources yet. You can add a new one by clicking

create-success: New source was successfully created
update-success: Source was successfully updated
Expand Down

0 comments on commit 873e46e

Please sign in to comment.