Fix lints in app/views/settings

This commit is contained in:
Andreas Nedbal 2020-05-10 10:40:48 +02:00
parent fe70717510
commit c21a3d0f73
7 changed files with 77 additions and 74 deletions

View file

@ -11,19 +11,19 @@
- if devise_mapping.confirmable? && resource.pending_reconfirmation? - if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div= raw t('views.settings.account.email_confirm', resource: resource.unconfirmed_email) %div= raw t('views.settings.account.email_confirm', resource: resource.unconfirmed_email)
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password'), help: t('views.settings.account.password_help') = f.password_field :password, autocomplete: 'off', label: t('views.settings.account.password'), help: t('views.settings.account.password_help')
= f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm') = f.password_field :password_confirmation, autocomplete: 'off', label: t('views.settings.account.password_confirm')
%button.btn.btn-primary{"data-target" => "#modal-passwd", "data-toggle" => "modal", :type => "button"} %button.btn.btn-primary{ data: { target: '#modal-passwd', toggle: :modal, type: :button } }
= t 'views.actions.save' = t 'views.actions.save'
%hr/ %hr/
%p %p
= t 'views.settings.account.unsatisfied' = t 'views.settings.account.unsatisfied'
=button_to t('views.settings.account.delete'), '/settings/account', data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-xs" = button_to t('views.settings.account.delete'), '/settings/account', data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-danger btn-xs'
= link_to t('views.settings.account.back'), :back = link_to t('views.settings.account.back'), :back
.visible-xs= render "shared/links" .visible-xs= render 'shared/links'

View file

@ -132,13 +132,13 @@
%h4 Sign In %h4 Sign In
%p.font-weight-bold.mb-0 Current Sign In %p.font-weight-bold.mb-0 Current Sign In
%p.text-muted= current_user.current_sign_in_at ? localize(current_user.current_sign_in_at) : "Not set" %p.text-muted= current_user.current_sign_in_at ? localize(current_user.current_sign_in_at) : 'Not set'
%p.font-weight-bold.mb-0 Last Sign In %p.font-weight-bold.mb-0 Last Sign In
%p.text-muted= current_user.last_sign_in_at ? localize(current_user.last_sign_in_at) : "Not set" %p.text-muted= current_user.last_sign_in_at ? localize(current_user.last_sign_in_at) : 'Not set'
%p.font-weight-bold.mb-0 Remember me set at %p.font-weight-bold.mb-0 Remember me set at
%p.text-muted= current_user.remember_created_at ? localize(current_user.remember_created_at) : "Not set" %p.text-muted= current_user.remember_created_at ? localize(current_user.remember_created_at) : 'Not set'
.col-md-6.col-sm-6.col-xs-12 .col-md-6.col-sm-6.col-xs-12
%h4 Create/Update %h4 Create/Update

View file

@ -3,7 +3,7 @@
%h2 Export your data %h2 Export your data
%p %p
The data is inside a The data is inside a
%code= ".tar.gz" %code= '.tar.gz'
archive and available in three formats: YAML, JSON, and XML. The archive also contains a copy of your archive and available in three formats: YAML, JSON, and XML. The archive also contains a copy of your
profile picture and header picture in all sizes. profile picture and header picture in all sizes.
%p %p
@ -13,7 +13,7 @@
- if current_user.can_export? - if current_user.can_export?
%form{ action: begin_user_export_path, method: 'POST' } %form{ action: begin_user_export_path, method: 'POST' }
%p.text-center %p.text-center
%button#export-btn.btn.btn-lg.btn-primary{type: :submit} Export %button.btn.btn-lg.btn-primary#export-btn{ type: :submit } Export
= hidden_field_tag :authenticity_token, form_authenticity_token = hidden_field_tag :authenticity_token, form_authenticity_token
- else - else
%p.text-center %p.text-center

View file

@ -1,6 +1,6 @@
.card .card
.card-body .card-body
= bootstrap_form_for(current_user, url: {action: "edit_privacy"}, method: "patch") do |f| = bootstrap_form_for(current_user, url: { action: 'edit_privacy' }, method: 'patch') do |f|
= f.check_box :privacy_allow_anonymous_questions, label: t('views.settings.privacy.anonymous') = f.check_box :privacy_allow_anonymous_questions, label: t('views.settings.privacy.anonymous')
= f.check_box :privacy_allow_public_timeline, label: t('views.settings.privacy.public') = f.check_box :privacy_allow_public_timeline, label: t('views.settings.privacy.public')

View file

@ -1,6 +1,6 @@
.card .card
.card-body .card-body
= bootstrap_form_for(current_user, url: {action: "edit"}, :html => { :multipart => true }, method: "patch") do |f| = bootstrap_form_for(current_user, url: { action: 'edit' }, html: { multipart: true }, method: 'patch') do |f|
= f.text_field :display_name, label: t('views.settings.profile.displayname') = f.text_field :display_name, label: t('views.settings.profile.displayname')
@ -16,9 +16,9 @@
%img#profile-picture-cropper{ src: current_user.profile_picture.url(:medium) } %img#profile-picture-cropper{ src: current_user.profile_picture.url(:medium) }
.col-sm-2.col-md-4 .col-sm-2.col-md-4
.btn-group .btn-group
%button#cropper-zoom-out.btn.btn-inverse{type: :button} %button.btn.btn-inverse#cropper-zoom-out{ type: :button }
%i.fa.fa-search-minus %i.fa.fa-search-minus
%button#cropper-zoom-in.btn.btn-inverse{type: :button} %button.btn.btn-inverse#cropper-zoom-in{ type: :button }
%i.fa.fa-search-plus %i.fa.fa-search-plus
.row.mb-2#profile-header-media .row.mb-2#profile-header-media
@ -33,9 +33,9 @@
%img#profile-header-cropper{ src: current_user.profile_header.url(:web) } %img#profile-header-cropper{ src: current_user.profile_header.url(:web) }
.col-sm-2.col-md-4 .col-sm-2.col-md-4
.btn-group .btn-group
%button#cropper-header-zoom-out.btn.btn-inverse{type: :button} %button.btn.btn-inverse#cropper-header-zoom-out{ type: :button }
%i.fa.fa-search-minus %i.fa.fa-search-minus
%button#cropper-header-zoom-in.btn.btn-inverse{type: :button} %button.btn.btn-inverse#cropper-header-zoom-in{ type: :button }
%i.fa.fa-search-plus %i.fa.fa-search-plus
= f.text_field :motivation_header, label: t('views.settings.profile.motivation'), placeholder: t('views.settings.profile.placeholder.motivation') = f.text_field :motivation_header, label: t('views.settings.profile.motivation'), placeholder: t('views.settings.profile.placeholder.motivation')
@ -48,10 +48,10 @@
= f.check_box :show_foreign_themes, label: 'Render other user themes when visiting their profile' = f.check_box :show_foreign_themes, label: 'Render other user themes when visiting their profile'
- for attrib in %i(crop_x crop_y crop_w crop_h) - %i[crop_x crop_y crop_w crop_h].each do |attrib|
= f.hidden_field attrib, id: attrib = f.hidden_field attrib, id: attrib
- for attrib in %i(crop_h_x crop_h_y crop_h_w crop_h_h) - %i[crop_h_x crop_h_y crop_h_w crop_h_h].each do |attrib|
= f.hidden_field attrib, id: attrib = f.hidden_field attrib, id: attrib
= f.submit t('views.actions.save'), class: 'btn btn-primary' = f.submit t('views.actions.save'), class: 'btn btn-primary'

View file

@ -1,19 +1,22 @@
.card .card
.card-body .card-body
- if @services.count > 0 - if @services.count.positive?
= t 'views.settings.service.enabled' = t 'views.settings.service.enabled'
- else - else
= t 'views.settings.service.none' = t 'views.settings.service.none'
- APP_CONFIG['sharing'].each do |service, service_options| - APP_CONFIG['sharing'].each do |service, service_options|
- if service_options['enabled'] and !@services.any? { |x| x.provider == service.to_s } - if service_options['enabled'] && @services.none? { |x| x.provider == service.to_s }
%p= link_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}" %p= link_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}"
- if @services.count > 0 - if @services.count.positive?
%ul.list-group %ul.list-group
- @services.each do |service| - @services.each do |service|
%li.list-group-item %li.list-group-item
%i{ class: "fa fa-#{service.provider}" } %i{ class: "fa fa-#{service.provider}" }
%strong= service.provider.capitalize %strong= service.provider.capitalize
(#{service.nickname}) (#{service.nickname})
= link_to t('views.settings.service.disconnect'), service_path(service), data: { confirm: t('views.settings.service.confirm', service: service.provider.capitalize) }, method: :delete = link_to t('views.settings.service.disconnect'),
service_path(service),
data: { confirm: t('views.settings.service.confirm', service: service.provider.capitalize) },
method: :delete

View file

@ -13,8 +13,8 @@
- if current_user.theme - if current_user.theme
.pull-right .pull-right
= button_to 'Delete Theme', delete_user_theme_path, data: { confirm: "Are you sure?" }, tabindex: -1, method: :delete, class: "btn btn-danger" = button_to 'Delete Theme', delete_user_theme_path, data: { confirm: 'Are you sure?' }, tabindex: -1, method: :delete, class: 'btn btn-danger'
= bootstrap_form_for(current_user.theme || Theme.new, url: {action: "update_theme"}, html: {id: 'update_theme'}, method: "patch") do |f| = bootstrap_form_for(current_user.theme || Theme.new, url: { action: 'update_theme' }, html: { id: 'update_theme' }, method: 'patch') do |f|
.card .card
.card-body .card-body
%h2 General %h2 General