5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-17 10:46:23 +00:00

feat: indicar que se puede publicar el sitio #13178

This commit is contained in:
f 2023-04-20 18:22:00 -03:00
parent 29f4c7a847
commit 7e8bcc55a1
4 changed files with 11 additions and 0 deletions

View file

@ -40,6 +40,13 @@ class Site
def not_published_yet? def not_published_yet?
build_stats.jekyll.where(status: true).count.zero? build_stats.jekyll.where(status: true).count.zero?
end end
# Hubo cambios desde la última publicación?
#
# @return [Boolean]
def awaiting_publication?
updated_at > (build_stats.jekyll.where(status: true).last&.created_at || updated_at)
end
end end
end end
end end

View file

@ -1,6 +1,8 @@
- link = nil - link = nil
- if site.not_published_yet? - if site.not_published_yet?
- message = t('.not_published_yet') - message = t('.not_published_yet')
- elsif site.awaiting_publication?
- message = t('.awaiting_publication')
- if site.building? - if site.building?
- if site.average_publication_time_calculable? - if site.average_publication_time_calculable?
- average_building_time = site.average_publication_time - average_building_time = site.average_publication_time

View file

@ -365,6 +365,7 @@ en:
building: "Your site is building, please wait <time datetime=\"PT%{seconds}S\">%{average_time}</time> to refresh this page..." building: "Your site is building, please wait <time datetime=\"PT%{seconds}S\">%{average_time}</time> to refresh this page..."
not_published_yet: "Your site is being published for the first time, please wait up to 1 minute..." not_published_yet: "Your site is being published for the first time, please wait up to 1 minute..."
available: "Your site is available! Click here to visit it." available: "Your site is available! Click here to visit it."
awaiting_publication: "There are unpublished changes. Click the button below and wait a moment to find them on your site."
index: index:
title: 'My Sites' title: 'My Sites'
pull: 'Upgrade' pull: 'Upgrade'

View file

@ -370,6 +370,7 @@ es:
building: "Tu sitio se está publicando, por favor espera <time datetime=\"PT%{seconds}S\">%{average_time}</time> para recargar esta página..." building: "Tu sitio se está publicando, por favor espera <time datetime=\"PT%{seconds}S\">%{average_time}</time> para recargar esta página..."
not_published_yet: "Tu sitio se está publicando por primera vez, por favor espera hasta un minuto..." not_published_yet: "Tu sitio se está publicando por primera vez, por favor espera hasta un minuto..."
available: "¡Tu sitio está disponible! Cliquea aquí para visitarlo." available: "¡Tu sitio está disponible! Cliquea aquí para visitarlo."
awaiting_publication: "Hay cambios sin publicar, cliqueá el botón debajo y espera un momento para encontrarlos en tu sitio."
index: index:
title: 'Mis sitios' title: 'Mis sitios'
pull: 'Actualizar' pull: 'Actualizar'