mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 05:06:22 +00:00
fix: más lints #16436
This commit is contained in:
parent
70528aa602
commit
827667215a
16 changed files with 78 additions and 49 deletions
|
@ -2,5 +2,9 @@
|
||||||
- id = "#{field.object_name}_#{name}"
|
- id = "#{field.object_name}_#{name}"
|
||||||
- name = "#{field.object_name}[#{name}]"
|
- name = "#{field.object_name}[#{name}]"
|
||||||
|
|
||||||
= render 'bootstrap/custom_checkbox', id: id, name: name, content: content, required: local_assigns[:required], value: '1' do
|
= render 'bootstrap/custom_checkbox', id: id,
|
||||||
|
name: name,
|
||||||
|
content: content,
|
||||||
|
required: local_assigns[:required],
|
||||||
|
value: '1' do
|
||||||
= yield
|
= yield
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
%main.row
|
%main.row
|
||||||
%aside.menu.col-12.col-lg-3
|
%aside.menu.col-12.col-lg-3
|
||||||
= render 'sites/header', site: @site
|
= render 'sites/header', site: @site, filter_params: @filter_params
|
||||||
.col
|
.col
|
||||||
%h1= t('.title')
|
%h1= t('.title')
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@
|
||||||
- row[:urls].each do |url|
|
- row[:urls].each do |url|
|
||||||
%tr
|
%tr
|
||||||
%th{ scope: 'row' }= row[:title]
|
%th{ scope: 'row' }= row[:title]
|
||||||
%td= link_to_if (url.present? && url.scheme.present?), url.to_s, url.to_s, class: 'word-break-all'
|
%td= link_to_if (url.present? && url.scheme.present?),
|
||||||
|
url.to_s,
|
||||||
|
url.to_s,
|
||||||
|
class: 'word-break-all'
|
||||||
%td
|
%td
|
||||||
%time{ datetime: row[:seconds][:machine] }= row[:seconds][:human]
|
%time{ datetime: row[:seconds][:machine] }= row[:seconds][:human]
|
||||||
%td= row[:size]
|
%td= row[:size]
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
|
|
||||||
- if @resource.needs_invitation_link?
|
- if @resource.needs_invitation_link?
|
||||||
%p= link_to t('devise.mailer.invitation_instructions.accept'),
|
%p= link_to t('devise.mailer.invitation_instructions.accept'),
|
||||||
accept_invitation_url(@resource, invitation_token: @token, change_locale_to: @resource.lang)
|
accept_invitation_url(@resource,
|
||||||
|
invitation_token: @token,
|
||||||
|
change_locale_to: @resource.lang)
|
||||||
|
|
||||||
- if @resource.invitation_due_at
|
- if @resource.invitation_due_at
|
||||||
%p= t('devise.mailer.invitation_instructions.accept_until',
|
%p= t('devise.mailer.invitation_instructions.accept_until',
|
||||||
|
@ -19,6 +21,9 @@
|
||||||
|
|
||||||
%p= t('devise.mailer.invitation_instructions.ignore')
|
%p= t('devise.mailer.invitation_instructions.ignore')
|
||||||
- elsif !@resource.confirmed? && @resource.confirmation_token
|
- elsif !@resource.confirmed? && @resource.confirmation_token
|
||||||
= confirmation_url(@resource, confirmation_token: @resource.confirmation_token, change_locale_to: @resource.lang)
|
= confirmation_url(@resource,
|
||||||
|
confirmation_token: @resource.confirmation_token,
|
||||||
|
change_locale_to: @resource.lang)
|
||||||
- else
|
- else
|
||||||
%p= link_to t('devise.mailer.invitation_instructions.sign_in'), root_url(change_locale_to: @resource.lang)
|
%p= link_to t('devise.mailer.invitation_instructions.sign_in'),
|
||||||
|
root_url(change_locale_to: @resource.lang)
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :password
|
= f.label :password
|
||||||
= f.password_field :password, autocomplete: 'new-password',
|
= f.password_field :password, autocomplete: 'new-password',
|
||||||
class: 'form-control', aria: { describedby: 'password-help' }
|
class: 'form-control',
|
||||||
|
aria: { describedby: 'password-help' }
|
||||||
%small.text-muted.form-text#password-help
|
%small.text-muted.form-text#password-help
|
||||||
= t('.leave_blank_if_you_don_t_want_to_change_it')
|
= t('.leave_blank_if_you_don_t_want_to_change_it')
|
||||||
- if @minimum_password_length
|
- if @minimum_password_length
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :password, class: 'sr-only'
|
= f.label :password, class: 'sr-only'
|
||||||
= f.password_field :password, autocomplete: 'new-password',
|
= f.password_field :password, autocomplete: 'new-password',
|
||||||
class: 'form-control', min: @minimum_password_length,
|
class: 'form-control',
|
||||||
|
min: @minimum_password_length,
|
||||||
aria: { describedby: 'minimum-password-length' },
|
aria: { describedby: 'minimum-password-length' },
|
||||||
placeholder: t(password)
|
placeholder: t(password)
|
||||||
- if @minimum_password_length
|
- if @minimum_password_length
|
||||||
|
@ -47,7 +48,12 @@
|
||||||
- content = t(".#{field}.label")
|
- content = t(".#{field}.label")
|
||||||
- href = t(".#{field}.href", default: '')
|
- href = t(".#{field}.href", default: '')
|
||||||
- help_content = t(".#{field}.help")
|
- help_content = t(".#{field}.help")
|
||||||
= render 'bootstrap/custom_checkbox', id: id, name: name, content: content, required: required, value: '1' do
|
= render 'bootstrap/custom_checkbox',
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
content: content,
|
||||||
|
required: required,
|
||||||
|
value: '1' do
|
||||||
- if href.present?
|
- if href.present?
|
||||||
= link_to help_content, href, target: '_blank', rel: 'noopener'
|
= link_to help_content, href, target: '_blank', rel: 'noopener'
|
||||||
- else
|
- else
|
||||||
|
|
|
@ -28,8 +28,10 @@
|
||||||
placeholder: t('login.password')
|
placeholder: t('login.password')
|
||||||
- if devise_mapping.rememberable?
|
- if devise_mapping.rememberable?
|
||||||
.form-group
|
.form-group
|
||||||
= render 'bootstrap/custom_checkbox_for_field', field: f, name: :remember_me do
|
= render 'bootstrap/custom_checkbox_for_field',
|
||||||
= t('login.remember_me', remember_for: distance_of_time_in_words(Usuarie.remember_for))
|
field: f, name: :remember_me do
|
||||||
|
= t('login.remember_me',
|
||||||
|
remember_for: distance_of_time_in_words(Usuarie.remember_for))
|
||||||
.actions
|
.actions
|
||||||
= f.submit t('.sign_in'),
|
= f.submit t('.sign_in'),
|
||||||
class: 'btn btn-secondary btn-lg btn-block'
|
class: 'btn btn-secondary btn-lg btn-block'
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
%nav.navbar.flex-md-nowrap.px-0
|
%nav.navbar.flex-md-nowrap.px-0
|
||||||
%a.navbar-brand.order-0{ href: '/' }
|
%a.navbar-brand.order-0{ href: '/' }
|
||||||
= inline_svg_tag 'sutty.svg', class: 'black', aria: true,
|
= inline_svg_tag 'sutty.svg', class: 'black', aria: true,
|
||||||
title: t('svg.sutty.title'), desc: t('svg.sutty.desc')
|
title: t('svg.sutty.title'),
|
||||||
|
desc: t('svg.sutty.desc')
|
||||||
|
|
||||||
- if breadcrumbs?
|
- if breadcrumbs?
|
||||||
%nav.flex-grow-1.order-2.order-md-1{ aria: { label: t('.title') } }
|
%nav.flex-grow-1.order-2.order-md-1{ aria: { label: t('.title') } }
|
||||||
|
@ -13,11 +14,11 @@
|
||||||
- else
|
- else
|
||||||
= link_to crumb.name, crumb.url, class: 'line-clamp-1'
|
= link_to crumb.name, crumb.url, class: 'line-clamp-1'
|
||||||
|
|
||||||
- if @current_usuarie || current_usuarie
|
- if usuarie || current_usuarie
|
||||||
%ul.navbar-nav.order-1.order-md-2
|
%ul.navbar-nav.order-1.order-md-2
|
||||||
- if @site&.tienda?
|
- if site&.tienda?
|
||||||
%li.nav-item
|
%li.nav-item
|
||||||
= link_to t('.tienda'), @site.tienda_url,
|
= link_to t('.tienda'), site.tienda_url,
|
||||||
role: 'button', class: 'btn btn-secondary'
|
role: 'button', class: 'btn btn-secondary'
|
||||||
|
|
||||||
%li.nav-item
|
%li.nav-item
|
||||||
|
@ -33,4 +34,5 @@
|
||||||
- next if locale == I18n.locale
|
- next if locale == I18n.locale
|
||||||
|
|
||||||
%li.nav-item
|
%li.nav-item
|
||||||
= link_to t("switch_locale.#{locale}"), params.to_h.merge(change_locale_to: locale)
|
= link_to t("switch_locale.#{locale}"),
|
||||||
|
params.to_h.merge(change_locale_to: locale)
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
- local_assigns[:closed] ||= '▶'.html_safe
|
- local_assigns[:closed] ||= '▶'.html_safe
|
||||||
- local_assigns[:open] ||= '▼'.html_safe
|
- local_assigns[:open] ||= '▼'.html_safe
|
||||||
|
|
||||||
%details.details.py-2{ id: local_assigns[:id], data: { controller: 'details', action: 'toggle->details#store' }, class: local_assigns[:details_class] }
|
%details.details.py-2{ id: local_assigns[:id],
|
||||||
|
data: { controller: 'details',
|
||||||
|
action: 'toggle->details#store' },
|
||||||
|
class: local_assigns[:details_class] }
|
||||||
%summary.d-flex.flex-row.align-items-center.justify-content-between{ class: local_assigns[:summary_class] }
|
%summary.d-flex.flex-row.align-items-center.justify-content-between{ class: local_assigns[:summary_class] }
|
||||||
%span= summary
|
%span= summary
|
||||||
%span.hide-when-open{ class: local_assigns[:open_class] }= local_assigns[:closed]
|
%span.hide-when-open{ class: local_assigns[:open_class] }= local_assigns[:closed]
|
||||||
|
|
|
@ -13,16 +13,27 @@
|
||||||
|
|
||||||
%script{ type: 'text/javascript', src: '/env.js' }
|
%script{ type: 'text/javascript', src: '/env.js' }
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
|
= stylesheet_link_tag 'application',
|
||||||
= stylesheet_link_tag 'dark', rel: 'alternate stylesheet', media: 'all', 'data-turbolinks-track': 'reload', title: t('dark')
|
media: 'all',
|
||||||
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload', defer: true
|
'data-turbolinks-track': 'reload'
|
||||||
= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload'
|
= stylesheet_link_tag 'dark',
|
||||||
= favicon_link_tag 'sutty_cuadrada.png', rel: 'apple-touch-icon', type: 'image/png'
|
rel: 'alternate stylesheet',
|
||||||
|
media: 'all',
|
||||||
|
'data-turbolinks-track': 'reload',
|
||||||
|
title: t('dark')
|
||||||
|
= javascript_pack_tag 'application',
|
||||||
|
'data-turbolinks-track': 'reload',
|
||||||
|
defer: true
|
||||||
|
= stylesheet_pack_tag 'application',
|
||||||
|
'data-turbolinks-track': 'reload'
|
||||||
|
= favicon_link_tag 'sutty_cuadrada.png',
|
||||||
|
rel: 'apple-touch-icon',
|
||||||
|
type: 'image/png'
|
||||||
= render 'layouts/link_rel_alternate'
|
= render 'layouts/link_rel_alternate'
|
||||||
|
|
||||||
%body{ class: yield(:body) }
|
%body{ class: yield(:body) }
|
||||||
.container-fluid#sutty
|
.container-fluid#sutty
|
||||||
= render 'layouts/breadcrumb'
|
= render 'layouts/breadcrumb', usuarie: @current_usuarie, site: @site
|
||||||
= render 'layouts/flash'
|
= render 'layouts/flash'
|
||||||
|
|
||||||
= yield
|
= yield
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
%th= post_label_t(attribute, post: post)
|
%th= post_label_t(attribute, post: post)
|
||||||
%td
|
%td
|
||||||
%ul{ dir: dir, lang: locale }
|
%ul{ dir: dir, lang: locale }
|
||||||
- site.indexed_posts.where(locale: post.lang.value, post_id: metadata.value).find_each do |p|
|
- site.indexed_posts.where(locale: post.lang.value,
|
||||||
|
post_id: metadata.value).find_each do |p|
|
||||||
-#
|
-#
|
||||||
XXX: Ignorar todos los posts no encontrados (ej: fueron
|
XXX: Ignorar todos los posts no encontrados (ej: fueron
|
||||||
borrados o el uuid cambió)
|
borrados o el uuid cambió)
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
- if !@site.invitade?(cuenta) # esto ta mal
|
|
||||||
.form-check
|
|
||||||
= hidden_field_tag "#{base}[#{attribute}]", '0', id: ''
|
|
||||||
.custom-control.custom-switch
|
|
||||||
= check_box_tag "#{base}[#{attribute}]", '1', metadata.value,
|
|
||||||
class: "custom-control-input #{invalid(post, attribute)}",
|
|
||||||
aria: { describedby: id_for_help(attribute) },
|
|
||||||
autofocus: autofocus
|
|
||||||
= label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post),
|
|
||||||
class: 'custom-control-label'
|
|
||||||
|
|
||||||
= render 'posts/attribute_feedback',
|
|
||||||
post: post, attribute: attribute, metadata: metadata
|
|
|
@ -8,7 +8,7 @@
|
||||||
%main.row
|
%main.row
|
||||||
%aside.menu.col-lg-3
|
%aside.menu.col-lg-3
|
||||||
.mb-3
|
.mb-3
|
||||||
= render 'sites/header', site: @site
|
= render 'sites/header', site: @site, filter_params: @filter_params
|
||||||
= render 'sites/status', site: @site
|
= render 'sites/status', site: @site
|
||||||
= render 'sites/build', site: @site, class: 'btn-block'
|
= render 'sites/build', site: @site, class: 'btn-block'
|
||||||
= render 'sites/moderation_queue', site: @site, class: 'btn-block'
|
= render 'sites/moderation_queue', site: @site, class: 'btn-block'
|
||||||
|
@ -89,7 +89,8 @@
|
||||||
- if @site.locales.size > 1
|
- if @site.locales.size > 1
|
||||||
%nav#locales
|
%nav#locales
|
||||||
- @site.locales.each do |locale|
|
- @site.locales.each do |locale|
|
||||||
= link_to @site.data.dig(locale.to_s, 'locale') || locale, site_posts_path(@site, **@filter_params.merge(locale: locale)),
|
= link_to @site.data.dig(locale.to_s, 'locale') || locale,
|
||||||
|
site_posts_path(@site, **@filter_params.merge(locale: locale)),
|
||||||
class: "mr-2 mt-2 mb-2 #{locale == @locale ? 'active font-weight-bold' : ''}"
|
class: "mr-2 mt-2 mb-2 #{locale == @locale ? 'active font-weight-bold' : ''}"
|
||||||
|
|
||||||
- if @posts.empty?
|
- if @posts.empty?
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
name: 'layout[]',
|
name: 'layout[]',
|
||||||
class: '',
|
class: '',
|
||||||
value: schema.name,
|
value: schema.name,
|
||||||
checked: @filter_params[:layout]&.include?(key.to_s) }
|
checked: filter[:layout]&.include?(key.to_s) }
|
||||||
%label.custom-control-label.font-weight-normal{ for: schema }= schema.humanized_name
|
%label.custom-control-label.font-weight-normal{ for: schema }= schema.humanized_name
|
||||||
|
|
||||||
-# XXX: Solo un nivel de recursividad
|
-# XXX: Solo un nivel de recursividad
|
||||||
|
|
|
@ -94,7 +94,8 @@
|
||||||
= f.radio_button :licencia_id, licencia.id,
|
= f.radio_button :licencia_id, licencia.id,
|
||||||
checked: licencia.id == site.licencia_id,
|
checked: licencia.id == site.licencia_id,
|
||||||
required: true, class: 'custom-control-input'
|
required: true, class: 'custom-control-input'
|
||||||
= f.label "licencia_id_#{licencia.id}", class: 'custom-control-label' do
|
= f.label "licencia_id_#{licencia.id}",
|
||||||
|
class: 'custom-control-label' do
|
||||||
= licencia.name
|
= licencia.name
|
||||||
= sanitize_markdown licencia.description,
|
= sanitize_markdown licencia.description,
|
||||||
tags: %w[p a strong em ul ol li h1 h2 h3 h4 h5 h6]
|
tags: %w[p a strong em ul ol li h1 h2 h3 h4 h5 h6]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%h1= site.title
|
%h1= site.title
|
||||||
%p.lead= site.description
|
%p.lead= site.description
|
||||||
%form.mb-3{ action: site_posts_path }
|
%form.mb-3{ action: site_posts_path }
|
||||||
- @filter_params.each do |param, values|
|
- filter_params.each do |param, values|
|
||||||
- next if param == :q
|
- next if param == :q
|
||||||
|
|
||||||
- [values].flatten.each do |value|
|
- [values].flatten.each do |value|
|
||||||
|
@ -14,19 +14,19 @@
|
||||||
.input-group
|
.input-group
|
||||||
%input.form-control.border.border-magenta.border-right-0#q{ type: 'search',
|
%input.form-control.border.border-magenta.border-right-0#q{ type: 'search',
|
||||||
name: 'q',
|
name: 'q',
|
||||||
value: @filter_params[:q] }
|
value: filter_params[:q] }
|
||||||
.input-group-append
|
.input-group-append
|
||||||
%span.input-group-text.background-white.magenta.border.border-magenta.border-top.border-left-0.border-right.border-bottom
|
%span.input-group-text.background-white.magenta.border.border-magenta.border-top.border-left-0.border-right.border-bottom
|
||||||
%i.fa.fa-fw.fa-search
|
%i.fa.fa-fw.fa-search
|
||||||
%input.sr-only{ type: 'submit' }
|
%input.sr-only{ type: 'submit' }
|
||||||
- @filter_params.each do |param, values|
|
- filter_params.each do |param, values|
|
||||||
- [values].flatten.each do |value|
|
- [values].flatten.each do |value|
|
||||||
= link_to site_posts_path(@site, **filter_params_by(@filter_params, param, value)),
|
= link_to site_posts_path(site, **filter_params_by(filter_params, param, value)),
|
||||||
class: 'btn btn-secondary btn-sm',
|
class: 'btn btn-secondary btn-sm',
|
||||||
title: t('posts.remove_filter_help', filter: value),
|
title: t('posts.remove_filter_help', filter: value),
|
||||||
aria: { labelledby: "help-filter-#{param}" } do
|
aria: { labelledby: "help-filter-#{param}" } do
|
||||||
- if param == :layout
|
- if param == :layout
|
||||||
= @site.layouts[value.to_sym].humanized_name
|
= site.layouts[value.to_sym].humanized_name
|
||||||
- else
|
- else
|
||||||
= value
|
= value
|
||||||
×
|
×
|
||||||
|
|
|
@ -55,7 +55,9 @@
|
||||||
.form-group
|
.form-group
|
||||||
%button.btn.btn-secondary{ type: 'submit' }= t('.urls.submit')
|
%button.btn.btn-secondary{ type: 'submit' }= t('.urls.submit')
|
||||||
- if @normalized_urls.present?
|
- if @normalized_urls.present?
|
||||||
= line_chart site_stats_uris_path(urls: @normalized_urls, **@chart_params), **@chart_options
|
= line_chart site_stats_uris_path(urls: @normalized_urls,
|
||||||
|
**@chart_params),
|
||||||
|
**@chart_options
|
||||||
|
|
||||||
.row.mb-5.row-cols-1.row-cols-lg-2
|
.row.mb-5.row-cols-1.row-cols-lg-2
|
||||||
- @columns.each_pair do |column, values|
|
- @columns.each_pair do |column, values|
|
||||||
|
|
Loading…
Reference in a new issue