5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 08:41:42 +00:00

Merge branch 'issue-12792' into 'rails'

Issue #12792

See merge request sutty/sutty!134
This commit is contained in:
fauno 2023-03-31 22:21:06 +00:00
commit b15ebdf549
24 changed files with 54 additions and 41 deletions

View file

@ -25,6 +25,10 @@ $spacers: (
2-plus: 0.75rem 2-plus: 0.75rem
); );
$sizes: (
"70ch": 70ch,
);
@import "bootstrap"; @import "bootstrap";
@import "editor"; @import "editor";
@ -404,6 +408,8 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1);
@each $prop, $abbrev in (width: w, height: h) { @each $prop, $abbrev in (width: w, height: h) {
@each $size, $length in $sizes { @each $size, $length in $sizes {
.#{$abbrev}-#{$grid-breakpoint}-#{$size} { #{$prop}: $length !important; } .#{$abbrev}-#{$grid-breakpoint}-#{$size} { #{$prop}: $length !important; }
.min-#{$abbrev}-#{$grid-breakpoint}-#{$size} { min-#{$prop}: $length !important; }
.max-#{$abbrev}-#{$grid-breakpoint}-#{$size} { max-#{$prop}: $length !important; }
} }
} }

View file

@ -0,0 +1,2 @@
.alert.alert-primary.mx-auto.content.max-w-md-70ch{ role: 'alert', class: local_assigns[:class] }
= yield

View file

@ -11,7 +11,6 @@
url: site_collaborate_path(@site), url: site_collaborate_path(@site),
method: :post) do |f| method: :post) do |f|
- unless current_usuarie - unless current_usuarie
= render 'layouts/flash'
.form-group .form-group
= f.label :email = f.label :email
= f.email_field :email, autofocus: true, autocomplete: 'email', = f.email_field :email, autofocus: true, autocomplete: 'email',

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-4.align-self-center .col-md-4.align-self-center
.sr-only .sr-only
@ -11,8 +13,6 @@
url: confirmation_path(resource_name), url: confirmation_path(resource_name),
html: { method: :post }) do |f| html: { method: :post }) do |f|
= render 'devise/shared/error_messages', resource: resource
:ruby :ruby
value = if resource.pending_reconfirmation? value = if resource.pending_reconfirmation?
resource.unconfirmed_email resource.unconfirmed_email

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
%h2= t 'devise.invitations.edit.header' %h2= t 'devise.invitations.edit.header'
@ -8,7 +10,6 @@
as: resource_name, as: resource_name,
url: invitation_path(resource_name), url: invitation_path(resource_name),
html: { method: :put }) do |f| html: { method: :put }) do |f|
= render 'devise/shared/error_messages', resource: resource
= f.hidden_field :invitation_token, readonly: true = f.hidden_field :invitation_token, readonly: true
- if f.object.class.require_password_on_accepting - if f.object.class.require_password_on_accepting
.form-group .form-group

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
%h2= t 'devise.invitations.new.header' %h2= t 'devise.invitations.new.header'
@ -8,7 +10,6 @@
as: resource_name, as: resource_name,
url: invitation_path(resource_name), url: invitation_path(resource_name),
html: { method: :post }) do |f| html: { method: :post }) do |f|
= render 'devise/shared/error_messages', resource: resource
- resource.class.invite_key_fields.each do |field| - resource.class.invite_key_fields.each do |field|
.form-group .form-group
= f.label field = f.label field

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
.sr-only .sr-only
@ -10,7 +12,6 @@
= form_for(resource, as: resource_name, = form_for(resource, as: resource_name,
url: password_path(resource_name), url: password_path(resource_name),
html: { method: :put }) do |f| html: { method: :put }) do |f|
= render 'devise/shared/error_messages', resource: resource
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
.sr-only .sr-only
@ -11,7 +13,6 @@
as: resource_name, as: resource_name,
url: password_path(resource_name), url: password_path(resource_name),
html: { method: :post }) do |f| html: { method: :post }) do |f|
= render 'devise/shared/error_messages', resource: resource
.form-group .form-group
= f.label :email, class: 'sr-only' = f.label :email, class: 'sr-only'
= f.email_field :email, autofocus: true, autocomplete: 'email', = f.email_field :email, autofocus: true, autocomplete: 'email',

View file

@ -3,6 +3,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-6.align-self-center .col-md-6.align-self-center
%h2= t('.title') %h2= t('.title')
@ -11,8 +13,6 @@
url: registration_path(resource_name), url: registration_path(resource_name),
html: { method: :put }) do |f| html: { method: :put }) do |f|
= render 'devise/shared/error_messages', resource: resource
.form-group .form-group
= f.label :email = f.label :email
= f.email_field :email, autofocus: true, autocomplete: 'email', = f.email_field :email, autofocus: true, autocomplete: 'email',

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
%h2= t('.sign_up') %h2= t('.sign_up')
@ -10,8 +12,6 @@
as: resource_name, as: resource_name,
url: registration_path(resource_name, params: { locale: params[:locale] })) do |f| url: registration_path(resource_name, params: { locale: params[:locale] })) do |f|
= render 'devise/shared/error_messages', resource: resource
.form-group .form-group
= f.label :email, class: 'sr-only' = f.label :email, class: 'sr-only'
= f.email_field :email, autofocus: true, autocomplete: 'email', = f.email_field :email, autofocus: true, autocomplete: 'email',

View file

@ -3,8 +3,6 @@
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
= render 'layouts/flash'
.sr-only .sr-only
%h2= t('.sign_in') %h2= t('.sign_in')
%p= t('.help') %p= t('.help')

View file

@ -1,9 +1,4 @@
- if resource.errors.any? - if resource.errors.any?
#error_explanation = render 'bootstrap/alert' do
%h2
= I18n.t("errors.messages.not_saved", |
count: resource.errors.count, |
resource: resource.class.model_name.human.downcase) |
%ul
- resource.errors.full_messages.each do |message| - resource.errors.full_messages.each do |message|
%li= message %p= message

View file

@ -1,6 +1,8 @@
= content_for :body do = content_for :body do
- 'black-bg' - 'black-bg'
= render 'devise/shared/error_messages', resource: resource
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-5.align-self-center .col-md-5.align-self-center
.sr-only .sr-only
@ -11,7 +13,6 @@
as: resource_name, as: resource_name,
url: unlock_path(resource_name), url: unlock_path(resource_name),
html: { method: :post }) do |f| html: { method: :post }) do |f|
= render 'devise/shared/error_messages', resource: resource
.form-group .form-group
= f.label :email, class: 'sr-only' = f.label :email, class: 'sr-only'
= f.email_field :email, autofocus: true, autocomplete: 'email', = f.email_field :email, autofocus: true, autocomplete: 'email',

View file

@ -1,4 +1,4 @@
.row.align-items-center.justify-content-center.full-height .row.align-items-center.justify-content-center.full-height
.col-md-6.align-self-center .col-md-6.align-self-center
.alert{role: 'alert', class: "alert-success"} = render 'bootstrap/alert' do
= t('.confirmation_sent') = t('.confirmation_sent')

View file

@ -1,3 +1,4 @@
- flash.each do |type, message| - flash.each do |type, message|
- unless type == 'js' - unless type == 'js'
.alert{ role: 'alert', class: "alert-#{type}" }= message = render 'bootstrap/alert' do
= message

View file

@ -1,3 +1,4 @@
-# DEPRECADO
.alert.alert-info.alert-dismissible.fade.show{role: 'alert'} .alert.alert-info.alert-dismissible.fade.show{role: 'alert'}
- if help.respond_to? :each - if help.respond_to? :each
%ul %ul

View file

@ -21,6 +21,9 @@
%body{ class: yield(:body) } %body{ class: yield(:body) }
.container-fluid#sutty .container-fluid#sutty
= render 'layouts/breadcrumb' = render 'layouts/breadcrumb'
= render 'layouts/flash'
= yield = yield
- if flash[:js] - if flash[:js]
.js-flash.d-none{ data: flash[:js] } .js-flash.d-none{ data: flash[:js] }

View file

@ -1,7 +1,9 @@
- unless post.errors.empty? - unless post.errors.empty?
.alert.alert-danger - title = t('.errors.title')
%h4= t('.errors.title') - help = t('.errors.help')
%p= t('.errors.help') = render 'bootstrap/alert' do
%h4= title
%p= help
%ul %ul
- post.errors.each do |attribute, errors| - post.errors.each do |attribute, errors|

View file

@ -1,6 +1,6 @@
.form-group .form-group
= submit_tag t('.save'), class: 'btn submit-post' = submit_tag t('.save'), class: 'btn submit-post'
.invalid-help.alert.alert-danger.d-none = render 'bootstrap/alert', class: 'invalid-help d-none' do
= site.config.fetch('invalid_help', t('.invalid_help')) = site.config.fetch('invalid_help', t('.invalid_help'))
.sending-help.alert.alert-success.d-none = render 'bootstrap/alert', class: 'sending-help d-none' do
= site.config.fetch('sending_help', t('.sending_help')) = site.config.fetch('sending_help', t('.sending_help'))

View file

@ -6,7 +6,7 @@
.editor{ id: attribute, data: { editor: '' } } .editor{ id: attribute, data: { editor: '' } }
-# Esto es para luego decirle al navegador que se olvide estas cosas. -# Esto es para luego decirle al navegador que se olvide estas cosas.
= hidden_field_tag 'storage_keys[]', "#{request.original_url}##{attribute}", data: { target: 'storage-key' } = hidden_field_tag 'storage_keys[]', "#{request.original_url}##{attribute}", data: { target: 'storage-key' }
.alert.alert-info = render 'bootstrap/alert' do
:markdown :markdown
#{t('editor.alert')} #{t('editor.alert')}
= text_area_tag "#{base}[#{attribute}]", '', = text_area_tag "#{base}[#{attribute}]", '',
@ -123,7 +123,7 @@
%label{ for: 'link-url' }= t('editor.url') %label{ for: 'link-url' }= t('editor.url')
%input.form-control{ type: 'url', id: 'link-url', name: 'link-url' }/ %input.form-control{ type: 'url', id: 'link-url', name: 'link-url' }/
.editor-aviso-word.alert.alert-info = render 'bootstrap/alert', class: 'editor-aviso-word' do
%p= t('editor.word') %p= t('editor.word')
.editor-content.form-control.h-auto.mt-1{ contenteditable: 'true' } .editor-content.form-control.h-auto.mt-1{ contenteditable: 'true' }

View file

@ -34,14 +34,13 @@
= render 'sites/build', site: @site = render 'sites/build', site: @site
- if @site.design.credits - if @site.design.credits
.alert.alert-primary{ role: 'alert' } = render 'bootstrap/alert' do
= sanitize_markdown @site.design.credits = sanitize_markdown @site.design.credits
= link_to t('sites.donations.text'), t('sites.donations.url'), class: 'btn' = link_to t('sites.donations.text'), t('sites.donations.url'), class: 'btn'
- if @site.design.designer_url - if @site.design.designer_url
= link_to t('sites.designer_url'), @site.design.designer_url, class: 'btn' = link_to t('sites.designer_url'), @site.design.designer_url, class: 'btn'
%section.col %section.col
= render 'layouts/flash'
.d-flex.justify-content-between.align-items-center.pl-2-plus.pr-2-plus.mb-2 .d-flex.justify-content-between.align-items-center.pl-2-plus.pr-2-plus.mb-2
%form{ action: site_posts_path } %form{ action: site_posts_path }
- @filter_params.each do |param, value| - @filter_params.each do |param, value|

View file

@ -1,7 +1,9 @@
- unless site.errors.empty? - unless site.errors.empty?
.alert.alert-info - title = t('.errors.title')
%h4= t('.errors.title') - help = t('.errors.help')
%p.lead= t('.errors.help') = render 'bootstrap/alert' do
%h4= title
%p.lead= help
%ul %ul
- site.errors.messages.each_pair do |attr, error| - site.errors.messages.each_pair do |attr, error|
- attr = attr.to_s - attr = attr.to_s
@ -48,7 +50,7 @@
%h2= t('.design.title') %h2= t('.design.title')
%p.lead= t('.help.design') %p.lead= t('.help.design')
- if invalid? site, :design_id - if invalid? site, :design_id
.alert.alert-info = render 'bootstrap/alert' do
= t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.help', = t('activerecord.errors.models.site.attributes.design_id.layout_incompatible.help',
layouts: site.incompatible_layouts.to_sentence) layouts: site.incompatible_layouts.to_sentence)
.row.designs .row.designs

View file

@ -104,7 +104,7 @@ en:
new: new:
sign_up: Sign up sign_up: Sign up
help: We only ask for an e-mail address and a password. The password is safely stored, no one else besides you knows it! You'll also receive an e-mail to confirm your account. help: We only ask for an e-mail address and a password. The password is safely stored, no one else besides you knows it! You'll also receive an e-mail to confirm your account.
signed_up: Welcome! You have signed up successfully. signed_up: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
signed_up_but_inactive: You have signed up successfully. However, we could not sign you in because your account is not yet activated. signed_up_but_inactive: You have signed up successfully. However, we could not sign you in because your account is not yet activated.
signed_up_but_locked: You have signed up successfully. However, we could not sign you in because your account is locked. signed_up_but_locked: You have signed up successfully. However, we could not sign you in because your account is locked.
signed_up_but_unconfirmed: A message with a confirmation link has been sent to your email address. Please follow the link to activate your account. signed_up_but_unconfirmed: A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.
@ -138,7 +138,7 @@ en:
errors: errors:
messages: messages:
already_confirmed: was already confirmed, please try signing in already_confirmed: was already confirmed, please try signing in
confirmation_period_expired: needs to be confirmed within %{period}, please request a new one confirmation_period_expired: "wasn't confirmed within %{period}. Please request a new confirmation link by using the \"Resend confirmation instructions\" button below and find it in your inbox."
expired: has expired, please request a new one expired: has expired, please request a new one
not_found: not found not_found: not found
not_locked: was not locked not_locked: was not locked

View file

@ -104,7 +104,7 @@ es:
new: new:
sign_up: Registrarme sign_up: Registrarme
help: Para registrarte solo pedimos una dirección de correo y una contraseña. La contraseña se almacena de forma segura, ¡nadie más que vos la sabe! Recibirás un correo de confirmación de cuenta. help: Para registrarte solo pedimos una dirección de correo y una contraseña. La contraseña se almacena de forma segura, ¡nadie más que vos la sabe! Recibirás un correo de confirmación de cuenta.
signed_up: Bienvenide. Tu cuenta fue creada. signed_up: "Hemos enviado un mensaje con un enlace de confirmación a tu correo electrónico. Por favor, abrí el enlace para terminar de activar tu cuenta."
signed_up_but_inactive: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque tu cuenta aún no está activada. signed_up_but_inactive: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque tu cuenta aún no está activada.
signed_up_but_locked: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque que tu cuenta está bloqueada. signed_up_but_locked: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque que tu cuenta está bloqueada.
signed_up_but_unconfirmed: Para recibir actualizaciones, se ha enviado un mensaje con un enlace de confirmación a tu correo electrónico. Abre el enlace para activar tu cuenta. signed_up_but_unconfirmed: Para recibir actualizaciones, se ha enviado un mensaje con un enlace de confirmación a tu correo electrónico. Abre el enlace para activar tu cuenta.
@ -138,7 +138,7 @@ es:
errors: errors:
messages: messages:
already_confirmed: ya ha sido confirmada, por favor intenta iniciar sesión already_confirmed: ya ha sido confirmada, por favor intenta iniciar sesión
confirmation_period_expired: necesita confirmarse dentro de %{period}, por favor solicita una nueva confirmation_period_expired: "quedó sin confirmar luego de %{period}. Por favor, usa el botón \"Reenviar instrucciones de confirmación\" y busca el nuevo link en tu casilla."
expired: ha expirado, por favor solicita una nueva expired: ha expirado, por favor solicita una nueva
not_found: no se ha encontrado not_found: no se ha encontrado
not_locked: no estaba bloqueada not_locked: no estaba bloqueada