sugerir algunas URLs

This commit is contained in:
f 2021-10-09 18:27:42 -03:00
parent 810f71e9c1
commit ec775847b9
2 changed files with 2 additions and 4 deletions

View file

@ -102,7 +102,7 @@ class StatsController < ApplicationController
next u unless u.end_with? '/'
"#{u}index.html"
end&.uniq || []
end&.uniq || [@site.url, @site.urls].flatten.uniq
end
def normalized_paths

View file

@ -18,15 +18,13 @@
= line_chart site_stats_host_path(@chart_params), **@chart_options
.mb-5
- original_urls = params[:urls]&.split("\n")&.map(&:strip)
- rows = original_urls.size.zero? ? 3 : original_urls.size
%h2= t('.urls.title')
%p.lead= t('.urls.description')
%form
%input{ type: 'hidden', name: 'interval', value: @interval }
.form-group
%label{ for: 'urls' }= t('.urls.label')
%textarea#urls.form-control{ name: 'urls', autocomplete: 'on', required: true, rows: rows, aria_describedby: 'help-urls' }= params[:urls]
%textarea#urls.form-control{ name: 'urls', autocomplete: 'on', required: true, rows: @normalized_urls.size, aria_describedby: 'help-urls' }= @normalized_urls.join("\n")
%small#help-urls.feedback.form-text.text-muted= t('.urls.help')
.form-group
%button.btn{ type: 'submit' }= t('.urls.submit')