mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 10:46:22 +00:00
fix: más lints
This commit is contained in:
parent
70528aa602
commit
a8297a9349
16 changed files with 78 additions and 49 deletions
|
@ -2,5 +2,9 @@
|
|||
- id = "#{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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
%main.row
|
||||
%aside.menu.col-12.col-lg-3
|
||||
= render 'sites/header', site: @site
|
||||
= render 'sites/header', site: @site, filter_params: @filter_params
|
||||
.col
|
||||
%h1= t('.title')
|
||||
|
||||
|
@ -14,7 +14,10 @@
|
|||
- row[:urls].each do |url|
|
||||
%tr
|
||||
%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
|
||||
%time{ datetime: row[:seconds][:machine] }= row[:seconds][:human]
|
||||
%td= row[:size]
|
||||
|
|
|
@ -10,15 +10,20 @@
|
|||
|
||||
- if @resource.needs_invitation_link?
|
||||
%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
|
||||
%p= t('devise.mailer.invitation_instructions.accept_until',
|
||||
due_date: l(@resource.invitation_due_at,
|
||||
format: :'devise.mailer.invitation_instructions.accept_until_format'))
|
||||
due_date: l(@resource.invitation_due_at,
|
||||
format: :'devise.mailer.invitation_instructions.accept_until_format'))
|
||||
|
||||
%p= t('devise.mailer.invitation_instructions.ignore')
|
||||
- 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
|
||||
%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
|
||||
= f.label :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
|
||||
= t('.leave_blank_if_you_don_t_want_to_change_it')
|
||||
- if @minimum_password_length
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
.form-group
|
||||
= f.label :password, class: 'sr-only'
|
||||
= 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' },
|
||||
placeholder: t(password)
|
||||
- if @minimum_password_length
|
||||
|
@ -47,7 +48,12 @@
|
|||
- content = t(".#{field}.label")
|
||||
- href = t(".#{field}.href", default: '')
|
||||
- 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?
|
||||
= link_to help_content, href, target: '_blank', rel: 'noopener'
|
||||
- else
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
placeholder: t('login.password')
|
||||
- if devise_mapping.rememberable?
|
||||
.form-group
|
||||
= render 'bootstrap/custom_checkbox_for_field', field: f, name: :remember_me do
|
||||
= t('login.remember_me', remember_for: distance_of_time_in_words(Usuarie.remember_for))
|
||||
= render 'bootstrap/custom_checkbox_for_field',
|
||||
field: f, name: :remember_me do
|
||||
= t('login.remember_me',
|
||||
remember_for: distance_of_time_in_words(Usuarie.remember_for))
|
||||
.actions
|
||||
= f.submit t('.sign_in'),
|
||||
class: 'btn btn-secondary btn-lg btn-block'
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
%nav.navbar.flex-md-nowrap.px-0
|
||||
%a.navbar-brand.order-0{ href: '/' }
|
||||
= 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?
|
||||
%nav.flex-grow-1.order-2.order-md-1{ aria: { label: t('.title') } }
|
||||
|
@ -13,11 +14,11 @@
|
|||
- else
|
||||
= 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
|
||||
- if @site&.tienda?
|
||||
- if site&.tienda?
|
||||
%li.nav-item
|
||||
= link_to t('.tienda'), @site.tienda_url,
|
||||
= link_to t('.tienda'), site.tienda_url,
|
||||
role: 'button', class: 'btn btn-secondary'
|
||||
|
||||
%li.nav-item
|
||||
|
@ -33,4 +34,5 @@
|
|||
- next if locale == I18n.locale
|
||||
|
||||
%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[: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] }
|
||||
%span= summary
|
||||
%span.hide-when-open{ class: local_assigns[:open_class] }= local_assigns[:closed]
|
||||
|
|
|
@ -13,16 +13,27 @@
|
|||
|
||||
%script{ type: 'text/javascript', src: '/env.js' }
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
|
||||
= stylesheet_link_tag 'dark', 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'
|
||||
= stylesheet_link_tag 'application',
|
||||
media: 'all',
|
||||
'data-turbolinks-track': 'reload'
|
||||
= stylesheet_link_tag 'dark',
|
||||
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'
|
||||
|
||||
%body{ class: yield(:body) }
|
||||
.container-fluid#sutty
|
||||
= render 'layouts/breadcrumb'
|
||||
= render 'layouts/breadcrumb', usuarie: @current_usuarie, site: @site
|
||||
= render 'layouts/flash'
|
||||
|
||||
= yield
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
%th= post_label_t(attribute, post: post)
|
||||
%td
|
||||
%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
|
||||
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
|
||||
%aside.menu.col-lg-3
|
||||
.mb-3
|
||||
= render 'sites/header', site: @site
|
||||
= render 'sites/header', site: @site, filter_params: @filter_params
|
||||
= render 'sites/status', site: @site
|
||||
= render 'sites/build', site: @site, class: 'btn-block'
|
||||
= render 'sites/moderation_queue', site: @site, class: 'btn-block'
|
||||
|
@ -89,7 +89,8 @@
|
|||
- if @site.locales.size > 1
|
||||
%nav#locales
|
||||
- @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' : ''}"
|
||||
|
||||
- if @posts.empty?
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
name: 'layout[]',
|
||||
class: '',
|
||||
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
|
||||
|
||||
-# XXX: Solo un nivel de recursividad
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
= f.radio_button :licencia_id, licencia.id,
|
||||
checked: licencia.id == site.licencia_id,
|
||||
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
|
||||
= sanitize_markdown licencia.description,
|
||||
tags: %w[p a strong em ul ol li h1 h2 h3 h4 h5 h6]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%h1= site.title
|
||||
%p.lead= site.description
|
||||
%form.mb-3{ action: site_posts_path }
|
||||
- @filter_params.each do |param, values|
|
||||
- filter_params.each do |param, values|
|
||||
- next if param == :q
|
||||
|
||||
- [values].flatten.each do |value|
|
||||
|
@ -14,19 +14,19 @@
|
|||
.input-group
|
||||
%input.form-control.border.border-magenta.border-right-0#q{ type: 'search',
|
||||
name: 'q',
|
||||
value: @filter_params[:q] }
|
||||
value: filter_params[:q] }
|
||||
.input-group-append
|
||||
%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
|
||||
%input.sr-only{ type: 'submit' }
|
||||
- @filter_params.each do |param, values|
|
||||
- filter_params.each do |param, values|
|
||||
- [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',
|
||||
title: t('posts.remove_filter_help', filter: value),
|
||||
aria: { labelledby: "help-filter-#{param}" } do
|
||||
- if param == :layout
|
||||
= @site.layouts[value.to_sym].humanized_name
|
||||
= site.layouts[value.to_sym].humanized_name
|
||||
- else
|
||||
= value
|
||||
×
|
||||
|
|
|
@ -55,7 +55,9 @@
|
|||
.form-group
|
||||
%button.btn.btn-secondary{ type: 'submit' }= t('.urls.submit')
|
||||
- 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
|
||||
- @columns.each_pair do |column, values|
|
||||
|
|
Loading…
Reference in a new issue