5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 12:36:22 +00:00
panel/app/views/sites/_status.haml
f 88e9434248
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Merge branch 'rails' of 0xacab.org:sutty/sutty into issue-13178
2023-05-13 11:37:41 -03:00

21 lines
805 B
Text

- 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
- 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
= render 'bootstrap/alert' do
= link_to_if link, message.html_safe, site_build_stats_path(site), class: 'alert-link'