From 991b229c1cf6f25af11b7219e001aa655ad5dbfb Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 14 Mar 2024 14:30:43 +0100 Subject: Improved the layout on empty searches/things MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- .github/workflows/ci.yml | 9 +++++---- app/views/searches/_search.html.erb | 13 +++++++++++-- config/locales/ca.yml | 5 ++++- config/locales/en.yml | 2 ++ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e024ff9..9e154d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,11 +78,12 @@ jobs: # The server provides a small script named `service-restart` which will do # the right thing to pull the new image of the desired service and re-run # it. - - name: Restart service with the new code - uses: garygrossgarten/github-action-ssh@release + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@v1.0.3 with: - command: infra-restart operum host: ${{ secrets.REMOTE_HOST }} username: ${{ secrets.REMOTE_USERNAME }} + password: ${{ secrets.REMOTE_PASSPHRASE }} + key: ${{ secrets.PRIVATE_KEY }} passphrase: ${{ secrets.REMOTE_PASSPHRASE }} - privateKey: ${{ secrets.PRIVATE_KEY}} + script: infra-restart operum diff --git a/app/views/searches/_search.html.erb b/app/views/searches/_search.html.erb index a717a22..310988e 100644 --- a/app/views/searches/_search.html.erb +++ b/app/views/searches/_search.html.erb @@ -1,5 +1,14 @@
- <% items.values.flatten.each do |item| %> - <%= render item %> + <% els = items.values.flatten %> + <% if els.empty? %> + <% if current_user.last_search_id.nil? %> +

<%= I18n.t('things.none') %> <%= link_to I18n.t('license.here'), new_thing_path %>.

+ <% else %> +

<%= I18n.t('searches.none') %>.

+ <% end %> + <% else %> + <% els.each do |item| %> + <%= render item %> + <% end %> <% end %>
diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ae9983c..de2c95a 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -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 @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index f00d7e5..ce11b3b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -89,6 +89,7 @@ en: home: Home save: save search public: Public + none: There are no items for this search shared: title: Public searches @@ -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 -- cgit v1.2.3