5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 23:36:21 +00:00

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? '/' next u unless u.end_with? '/'
"#{u}index.html" "#{u}index.html"
end&.uniq || [] end&.uniq || [@site.url, @site.urls].flatten.uniq
end end
def normalized_paths def normalized_paths

View file

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