From a2e4e0ab89910f85632ad231bbc2bdc01e69836b Mon Sep 17 00:00:00 2001 From: f Date: Fri, 8 Oct 2021 18:24:19 -0300 Subject: [PATCH] =?UTF-8?q?informar=20hace=20cu=C3=A1nto=20se=20actualizar?= =?UTF-8?q?on=20los=20datos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/stats_controller.rb | 5 +++++ app/views/stats/index.haml | 5 +++++ config/locales/en.yml | 4 +--- config/locales/es.yml | 4 +--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 07be68c..8d1575b 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -19,6 +19,7 @@ class StatsController < ApplicationController @chart_params = { interval: interval } hostnames + last_stat end # Genera un gráfico de visitas por dominio asociado a este sitio @@ -40,6 +41,10 @@ class StatsController < ApplicationController private + def last_stat + @last_stat ||= Stat.last + end + # TODO: Eliminar cuando mergeemos referer-origin def hostnames @hostnames ||= [@site.hostname, @site.alternative_hostnames].flatten diff --git a/app/views/stats/index.haml b/app/views/stats/index.haml index b594369..e77454b 100644 --- a/app/views/stats/index.haml +++ b/app/views/stats/index.haml @@ -2,6 +2,11 @@ .col %h1= t('.title') %p.lead= t('.help') + %p + %small + = t('.last_update') + %time{ datetime: @last_stat.created_at } + "#{time_ago_in_words @last_stat.created_at}." .mb-3 - StatsController::INTERVALS.each do |interval| diff --git a/config/locales/en.yml b/config/locales/en.yml index 9625030..623d8c2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -252,9 +252,7 @@ en: help: | These statistics show information about how your site is generated and how many resources it uses. - build: - average: 'Average building time' - maximum: 'Maximum building time' + last_update: 'Updated every hour. Last update on ' hour: 'Hourly' day: 'Daily' week: 'Weekly' diff --git a/config/locales/es.yml b/config/locales/es.yml index 7fcebcb..4085a86 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -257,9 +257,7 @@ es: help: | Las estadísticas visibilizan información sobre cómo se genera y cuántos recursos utiliza tu sitio. - build: - average: 'Tiempo promedio de generación' - maximum: 'Tiempo máximo de generación' + last_update: 'Actualizadas cada hora. Última actualización hace ' hour: 'Por hora' day: 'Diarias' week: 'Semanales'