diff --git a/app/frontend/scss/components/checks.scss b/app/frontend/scss/components/checks.scss index 6c24b24..26f3f5d 100644 --- a/app/frontend/scss/components/checks.scss +++ b/app/frontend/scss/components/checks.scss @@ -2,8 +2,4 @@ .action a { color: black; } - - .kind .octicon { - vertical-align: middle; - } } diff --git a/app/helpers/checks_helper.rb b/app/helpers/checks_helper.rb index 5976d8e..0eec22c 100644 --- a/app/helpers/checks_helper.rb +++ b/app/helpers/checks_helper.rb @@ -9,17 +9,24 @@ module ChecksHelper end def checks_sort_links(field) + %i[asc desc].map { |direction| + checks_sort_link(field, direction) + }.join + end + + def checks_sort_link(field, direction) + classes = "btn btn-light btn-sm mx-1 mx-1 px-1 py-0" current_sort_str = current_sort.to_a.join("_") - %i[asc desc].map { |direction| - sort = "#{field}_#{direction}" + sort = "#{field}_#{direction}" - icon = direction == :asc ? "chevron-up" : "chevron-down" - html = Octicons::Octicon.new(icon, class: "mx-1").to_svg.html_safe + icon = direction == :asc ? "chevron-up" : "chevron-down" + html = Octicons::Octicon.new(icon).to_svg.html_safe - filter_params = current_criterias.merge(sort: sort) - link_to_unless sort == current_sort_str, html, checks_path(filter_params) - }.join + filter_params = current_criterias.merge(sort: sort) + link_to_unless sort == current_sort_str, html, checks_path(filter_params), class: classes do + content_tag(:span, html, class: classes + " active") + end end def current_criterias diff --git a/app/views/checks/_table.html.erb b/app/views/checks/_table.html.erb index e164399..776d1de 100644 --- a/app/views/checks/_table.html.erb +++ b/app/views/checks/_table.html.erb @@ -4,18 +4,19 @@ - <%= t(".domain") %> - + <%= t(".th.domain") %> + <%== checks_sort_links(:domain) %> - <%= t(".expiry_date") %> - + <%= t(".th.expiry_date") %> + <%= t(".th.expiry_date_short") %> + <%== checks_sort_links(:domain_expires_at) %> - <%= t(".edit") %> + <%= t(".th.edit") %> @@ -23,19 +24,19 @@ <%= t(".kind_labels.#{check.kind}") %> + + <%- if check.in_error? %> <%== content_tag( :span, Octicons::Octicon.new("alert", class: "ml-1").to_svg.html_safe, - class: "text-danger", + class: "in-error text-danger", data: { toggle: "tooltip", - placement: "right", + placement: "bottom", title: check_last_success_title(check) }) %> <% end %> - - <%= check.domain %> @@ -44,7 +45,7 @@ <%= content_tag :span, format_date(check.domain_expires_at, format: :short), class: "d-inline d-md-none" %> <% end %> - + <%= link_to edit_check_path(check) do %> <%== Octicons::Octicon.new("pencil").to_svg %> <% end %> diff --git a/app/views/checks/index.html.erb b/app/views/checks/index.html.erb index 642c41d..ae8d626 100644 --- a/app/views/checks/index.html.erb +++ b/app/views/checks/index.html.erb @@ -1,6 +1,6 @@
-
+
<% if @checks.empty? && current_scopes.blank? %>
<%= t(".no_check_yet_html", new_domain_path: new_check_path(kind: :domain), new_ssl_path: new_check_path(kind: :ssl)) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index bd4ab70..b146f5f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -103,9 +103,11 @@ en: expiration date is coming. The time is set in number of days. table: - domain: Name - expiry_date: Expiration - edit: Edit + th: + domain: Name + expiry_date: "Expiration date" + expiry_date_short: "Exp." + edit: Edit kind_labels: domain: Domain ssl: SSL diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5c76b55..799126a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -138,9 +138,11 @@ fr: que la date d'expiration approche. Le délai est indiqué ennombre de jours. table: - domain: Nom - expiry_date: "Expiration" - edit: Modifier + th: + domain: Nom + expiry_date: "Date d'expiration" + expiry_date_short: "Exp." + edit: Modifier kind_labels: domain: Domaine ssl: SSL