mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-27 07:26:21 +00:00
Merge branch 'production.panel.sutty.nl' into panel.testing.sutty.nl
This commit is contained in:
commit
1ee31055bf
28 changed files with 79 additions and 47 deletions
|
@ -15,6 +15,13 @@ class SitesController < ApplicationController
|
||||||
fresh_when @sites
|
fresh_when @sites
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Genera la caja del estado para HTMX
|
||||||
|
def status
|
||||||
|
authorize site
|
||||||
|
|
||||||
|
render('sites/status', layout: false) if stale? site
|
||||||
|
end
|
||||||
|
|
||||||
# No tenemos propiedades de un sitio aún, así que vamos al listado de
|
# No tenemos propiedades de un sitio aún, así que vamos al listado de
|
||||||
# artículos
|
# artículos
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -34,4 +34,4 @@ Rails.start()
|
||||||
Turbolinks.start()
|
Turbolinks.start()
|
||||||
ActiveStorage.start()
|
ActiveStorage.start()
|
||||||
|
|
||||||
// force ci
|
window.htmx = require('htmx.org/dist/htmx.js')
|
||||||
|
|
|
@ -194,6 +194,12 @@ class Site
|
||||||
git_sh('git', 'lfs', 'push', remote.name, default_branch)
|
git_sh('git', 'lfs', 'push', remote.name, default_branch)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Hace limpieza de LFS
|
||||||
|
def lfs_cleanup
|
||||||
|
git_sh("git", "lfs", "prune")
|
||||||
|
git_sh("git", "lfs", "dedup")
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# @deprecated
|
# @deprecated
|
||||||
|
@ -260,10 +266,5 @@ class Site
|
||||||
|
|
||||||
r&.success?
|
r&.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
def lfs_cleanup
|
|
||||||
git_sh("git", "lfs", "prune")
|
|
||||||
git_sh("git", "lfs", "dedup")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,3 @@
|
||||||
.row.justify-content-center
|
.row.justify-content-center
|
||||||
.col-12.col-lg-8
|
.col-12.col-lg-8
|
||||||
- if policy(@site).edit?
|
= render 'posts/form', site: @site, post: @post
|
||||||
= render 'layouts/details', summary: t('posts.edit.post') do
|
|
||||||
= render 'posts/form', site: @site, post: @post
|
|
||||||
= render 'layouts/details', summary: t('posts.edit.moderation_queue') do
|
|
||||||
= render 'posts/moderation_queue', site: @site, post: @post, moderation_queue: @moderation_queue
|
|
||||||
- else
|
|
||||||
= render 'posts/form', site: @site, post: @post
|
|
||||||
|
|
|
@ -1,21 +1,24 @@
|
||||||
- link = nil
|
- cache site do
|
||||||
- if site.not_published_yet?
|
- link = nil
|
||||||
- message = t('.not_published_yet')
|
- if site.not_published_yet?
|
||||||
- elsif site.awaiting_publication?
|
- message = t('.not_published_yet')
|
||||||
- message = t('.awaiting_publication')
|
- elsif site.awaiting_publication?
|
||||||
- elsif site.building?
|
- message = t('.awaiting_publication')
|
||||||
- if site.average_publication_time_calculable?
|
- elsif site.building?
|
||||||
- average_building_time = site.average_publication_time
|
- if site.average_publication_time_calculable?
|
||||||
- elsif !site.similar_sites?
|
- average_building_time = site.average_publication_time
|
||||||
- average_building_time = 60
|
- 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
|
- else
|
||||||
- average_building_time = site.average_publication_time_for_similar_sites
|
- message = t('.available')
|
||||||
|
- link = true
|
||||||
|
|
||||||
- average_publication_time_human = distance_of_time_in_words average_building_time
|
-# TODO: Calcular cada cuanto sería óptimo recargar
|
||||||
- message = t('.building', average_time: average_publication_time_human, seconds: average_building_time)
|
%div{ 'hx-get': site_status_path(site), 'hx-trigger': 'every 10s', 'hx-swap': 'outerHTML' }
|
||||||
- else
|
= render 'bootstrap/alert' do
|
||||||
- message = t('.available')
|
= link_to_if link, message.html_safe, site_build_stats_path(site), class: 'alert-link'
|
||||||
- link = true
|
|
||||||
|
|
||||||
= render 'bootstrap/alert' do
|
|
||||||
= link_to_if link, message.html_safe, site_build_stats_path(site), class: 'alert-link'
|
|
||||||
|
|
1
app/views/sites/status.haml
Normal file
1
app/views/sites/status.haml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
= render 'sites/status', site: @site
|
|
@ -578,7 +578,7 @@ en:
|
||||||
static_file_migration: 'File migration'
|
static_file_migration: 'File migration'
|
||||||
find_and_replace: 'Search and replace'
|
find_and_replace: 'Search and replace'
|
||||||
status:
|
status:
|
||||||
building: "Your site is building, refresh this page in <time datetime=\"PT%{seconds}S\">%{average_time}</time>."
|
building: "Your site is building, it will be ready in <time datetime=\"PT%{seconds}S\">%{average_time}</time>."
|
||||||
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 find all the different ways to visit it."
|
available: "Your site is available! Click here to find all the different ways to visit it."
|
||||||
awaiting_publication: "There are unpublished changes. Click the button below and wait a moment to find them on your site."
|
awaiting_publication: "There are unpublished changes. Click the button below and wait a moment to find them on your site."
|
||||||
|
|
|
@ -582,7 +582,7 @@ es:
|
||||||
static_file_migration: 'Migración de archivos'
|
static_file_migration: 'Migración de archivos'
|
||||||
find_and_replace: 'Búsqueda y reemplazo'
|
find_and_replace: 'Búsqueda y reemplazo'
|
||||||
status:
|
status:
|
||||||
building: "Tu sitio se está publicando, recargá esta página en <time datetime=\"PT%{seconds}S\">%{average_time}</time>."
|
building: "Tu sitio se está publicando, estará listo en <time datetime=\"PT%{seconds}S\">%{average_time}</time>."
|
||||||
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! Cliqueá aquí para encontrar todas las formas en que podés visitarlo."
|
available: "¡Tu sitio está disponible! Cliqueá aquí para encontrar todas las formas en que podés visitarlo."
|
||||||
awaiting_publication: "Hay cambios sin publicar, cliqueá el botón debajo y espera un momento para encontrarlos en tu sitio."
|
awaiting_publication: "Hay cambios sin publicar, cliqueá el botón debajo y espera un momento para encontrarlos en tu sitio."
|
||||||
|
|
|
@ -52,6 +52,8 @@ Rails.application.routes.draw do
|
||||||
get 'pull', to: 'sites#fetch'
|
get 'pull', to: 'sites#fetch'
|
||||||
post 'pull', to: 'sites#merge'
|
post 'pull', to: 'sites#merge'
|
||||||
|
|
||||||
|
get 'status', to: 'sites#status'
|
||||||
|
|
||||||
# Gestionar usuaries
|
# Gestionar usuaries
|
||||||
get 'usuaries/invite', to: 'usuaries#invite'
|
get 'usuaries/invite', to: 'usuaries#invite'
|
||||||
post 'usuaries/invite', to: 'usuaries#send_invitations'
|
post 'usuaries/invite', to: 'usuaries#send_invitations'
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
"commonmark": "^0.29.0",
|
"commonmark": "^0.29.0",
|
||||||
"fork-awesome": "^1.1.7",
|
"fork-awesome": "^1.1.7",
|
||||||
"fork-ts-checker-webpack-plugin": "^6.1.0",
|
"fork-ts-checker-webpack-plugin": "^6.1.0",
|
||||||
|
"htmx.org": "^1.9.11",
|
||||||
"input-map": "git+https://0xacab.org/sutty/input-map.git",
|
"input-map": "git+https://0xacab.org/sutty/input-map.git",
|
||||||
"input-tag": "git+https://0xacab.org/sutty/input-tag.git",
|
"input-tag": "git+https://0xacab.org/sutty/input-tag.git",
|
||||||
"leaflet": "^1.7.1",
|
"leaflet": "^1.7.1",
|
||||||
|
|
BIN
public/assets/.sprockets-manifest-a1cbb907961024fc033716a7d30668dd.json
(Stored with Git LFS)
BIN
public/assets/.sprockets-manifest-a1cbb907961024fc033716a7d30668dd.json
(Stored with Git LFS)
Binary file not shown.
BIN
public/assets/application-5c98ae5b7e5b4444349f4c0175aa88fb76292284e1c68bfc4724151ceaf5113a.css.gz
(Stored with Git LFS)
BIN
public/assets/application-5c98ae5b7e5b4444349f4c0175aa88fb76292284e1c68bfc4724151ceaf5113a.css.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/assets/application-df0385d47e55aa7c5b39fafd98674b63637ac6f38a896dbb79597f51adfbfdd1.css
(Stored with Git LFS)
Normal file
BIN
public/assets/application-df0385d47e55aa7c5b39fafd98674b63637ac6f38a896dbb79597f51adfbfdd1.css
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/assets/application-df0385d47e55aa7c5b39fafd98674b63637ac6f38a896dbb79597f51adfbfdd1.css.gz
(Stored with Git LFS)
Normal file
BIN
public/assets/application-df0385d47e55aa7c5b39fafd98674b63637ac6f38a896dbb79597f51adfbfdd1.css.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/assets/application-e103c526f0f1ddba4b6d570ac1bc4318f0e84d522fe2c02eb6fbb594ece6f7a5.css
(Stored with Git LFS)
BIN
public/assets/application-e103c526f0f1ddba4b6d570ac1bc4318f0e84d522fe2c02eb6fbb594ece6f7a5.css
(Stored with Git LFS)
Binary file not shown.
BIN
public/assets/application-e103c526f0f1ddba4b6d570ac1bc4318f0e84d522fe2c02eb6fbb594ece6f7a5.css.gz
(Stored with Git LFS)
BIN
public/assets/application-e103c526f0f1ddba4b6d570ac1bc4318f0e84d522fe2c02eb6fbb594ece6f7a5.css.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/assets/dark-591813c5ed25b766eda449e80715f9e51238c5defc9e38e60f02c31e11207839.css.gz
(Stored with Git LFS)
BIN
public/assets/dark-591813c5ed25b766eda449e80715f9e51238c5defc9e38e60f02c31e11207839.css.gz
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map.br
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map.br
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map.gz
(Stored with Git LFS)
Normal file
BIN
public/packs/js/application-8ce9779d857bfff53532.js.map.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
public/packs/manifest.json
(Stored with Git LFS)
BIN
public/packs/manifest.json
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/manifest.json.br
(Stored with Git LFS)
BIN
public/packs/manifest.json.br
(Stored with Git LFS)
Binary file not shown.
BIN
public/packs/manifest.json.gz
(Stored with Git LFS)
BIN
public/packs/manifest.json.gz
(Stored with Git LFS)
Binary file not shown.
|
@ -4548,6 +4548,11 @@ html-entities@^1.3.1:
|
||||||
resolved "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz"
|
resolved "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz"
|
||||||
integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==
|
integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==
|
||||||
|
|
||||||
|
htmx.org@^1.9.11:
|
||||||
|
version "1.9.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/htmx.org/-/htmx.org-1.9.11.tgz#00192041ee682d6ca7146d0fbd901169ffe72d87"
|
||||||
|
integrity sha512-WlVuICn8dfNOOgYmdYzYG8zSnP3++AdHkMHooQAzGZObWpVXYathpz/I37ycF4zikR6YduzfCvEcxk20JkIUsw==
|
||||||
|
|
||||||
http-deceiver@^1.2.7:
|
http-deceiver@^1.2.7:
|
||||||
version "1.2.7"
|
version "1.2.7"
|
||||||
resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz"
|
resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz"
|
||||||
|
|
Loading…
Reference in a new issue