2024-03-22 21:34:24 +00:00
|
|
|
- cache site do
|
|
|
|
- link = nil
|
|
|
|
- if site.not_published_yet?
|
|
|
|
- message = t('.not_published_yet')
|
|
|
|
- elsif site.awaiting_publication?
|
|
|
|
- message = t('.awaiting_publication')
|
|
|
|
- elsif site.building?
|
|
|
|
- if site.average_publication_time_calculable?
|
|
|
|
- average_building_time = site.average_publication_time
|
|
|
|
- elsif !site.similar_sites?
|
|
|
|
- average_building_time = 60
|
|
|
|
- else
|
|
|
|
- average_building_time = site.average_publication_time_for_similar_sites
|
2023-03-31 22:32:36 +00:00
|
|
|
|
2024-03-22 21:34:24 +00:00
|
|
|
- average_publication_time_human = distance_of_time_in_words average_building_time
|
|
|
|
- message = t('.building', average_time: average_publication_time_human, seconds: average_building_time)
|
|
|
|
- else
|
|
|
|
- message = t('.available')
|
|
|
|
- link = true
|
2023-03-31 22:32:36 +00:00
|
|
|
|
2024-03-22 21:34:24 +00:00
|
|
|
-# TODO: Calcular cada cuanto sería óptimo recargar
|
|
|
|
%div{ 'hx-get': site_status_path(site), 'hx-trigger': 'every 10s', 'hx-swap': 'outerHTML' }
|
|
|
|
= render 'bootstrap/alert' do
|
|
|
|
= link_to_if link, message.html_safe, site_build_stats_path(site), class: 'alert-link'
|
2024-04-10 14:49:30 +00:00
|
|
|
|
|
|
|
= render 'sites/build', site: site, class: 'btn-block'
|