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

@ -43,28 +43,28 @@
%p.font-weight-bold.mb-0 Profile picture %p.font-weight-bold.mb-0 Profile picture
.media .media
.pull-left .pull-left
%img.profile--img{src: current_user.profile_picture.url(:medium)} %img.profile--img{ src: current_user.profile_picture.url(:medium) }
.media-body .media-body
%ul %ul
%li %li
%a{href: current_user.profile_picture.url(:small)} Small %a{ href: current_user.profile_picture.url(:small) } Small
%li %li
%a{href: current_user.profile_picture.url(:medium)} Medium %a{ href: current_user.profile_picture.url(:medium) } Medium
%li %li
%a{href: current_user.profile_picture.url(:large)} Large %a{ href: current_user.profile_picture.url(:large) } Large
%li %li
%a{href: current_user.profile_picture.url(:original)} Original image %a{ href: current_user.profile_picture.url(:original) } Original image
%p.font-weight-bold.mb-0 Header picture %p.font-weight-bold.mb-0 Header picture
%img{src: current_user.profile_header.url(:mobile), style: 'width: 100%'} %img{ src: current_user.profile_header.url(:mobile), style: 'width: 100%' }
%p %p
%a{href: current_user.profile_header.url(:mobile)} Mobile %a{ href: current_user.profile_header.url(:mobile) } Mobile
| |
%a{href: current_user.profile_header.url(:web)} Web %a{ href: current_user.profile_header.url(:web) } Web
| |
%a{href: current_user.profile_header.url(:retina)} Retina %a{ href: current_user.profile_header.url(:retina) } Retina
| |
%a{href: current_user.profile_header.url(:original)} Original image %a{ href: current_user.profile_header.url(:original) } Original image
.row .row
.col-md-6.col-sm-6.col-xs-12 .col-md-6.col-sm-6.col-xs-12
%h4 Statistics %h4 Statistics
@ -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
@ -11,13 +11,13 @@
will take a while, so please be patient. You will receive a question once exporting will take a while, so please be patient. You will receive a question once exporting
is done. is done.
- 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
%button.btn.btn-lg.btn-primary.disabled{disabled: :disabled} Export %button.btn.btn-lg.btn-primary.disabled{ disabled: :disabled } Export
%p %p
- if current_user.export_url.nil? - if current_user.export_url.nil?
Once exporting your account is done, a download link will appear here. Once exporting your account is done, a download link will appear here.
@ -25,5 +25,5 @@
Here is your export from Here is your export from
= succeed ':' do = succeed ':' do
= current_user.export_created_at = current_user.export_created_at
%a{href: current_user.export_url} %a{ href: current_user.export_url }
= File.basename current_user.export_url = File.basename current_user.export_url

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,41 +1,41 @@
.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')
.media#profile-picture-media .media#profile-picture-media
.pull-left .pull-left
%img.avatar-lg.mr-3{src: current_user.profile_picture.url(:medium)} %img.avatar-lg.mr-3{ src: current_user.profile_picture.url(:medium) }
.media-body .media-body
= f.file_field :profile_picture, label: t('views.settings.profile.avatar') = f.file_field :profile_picture, label: t('views.settings.profile.avatar')
.row#profile-picture-crop-controls{style: 'display: none;'} .row#profile-picture-crop-controls{ style: 'display: none;' }
.col-sm-10.col-md-8 .col-sm-10.col-md-8
%strong= t('views.settings.profile.avatar_adjust') %strong= t('views.settings.profile.avatar_adjust')
%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
.col .col
%img.mw-100.mr-3{src: current_user.profile_header.url(:mobile)} %img.mw-100.mr-3{ src: current_user.profile_header.url(:mobile) }
.col-xs-12.mt-3.mt-sm-0.pl-3.pr-3 .col-xs-12.mt-3.mt-sm-0.pl-3.pr-3
= f.file_field :profile_header, label: t('views.settings.profile.header') = f.file_field :profile_header, label: t('views.settings.profile.header')
.row#profile-header-crop-controls{style: 'display: none;'} .row#profile-header-crop-controls{ style: 'display: none;' }
.col-sm-10.col-md-8 .col-sm-10.col-md-8
%strong= t('views.settings.profile.header_adjust') %strong= t('views.settings.profile.header_adjust')
%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
@ -22,9 +22,9 @@
Here you'll find general page values that are basically visible all across the page. Here you'll find general page values that are basically visible all across the page.
.row .row
.col-sm-6 .col-sm-6
= f.text_field :background_color, class: 'color', data: {default: 0xF0EDF4} = f.text_field :background_color, class: 'color', data: { default: 0xF0EDF4 }
.col-sm-6 .col-sm-6
= f.text_field :body_text, class: 'color', data: {default: 0x000000} = f.text_field :body_text, class: 'color', data: { default: 0x000000 }
.card .card
.card-body .card-body
%h2 Colors %h2 Colors
@ -50,61 +50,61 @@
Color used for messages if something went through successfully. Color used for messages if something went through successfully.
.row .row
.col-sm-6 .col-sm-6
= f.text_field :primary_color, class: 'color', data: {default: 0x5E35B1} = f.text_field :primary_color, class: 'color', data: { default: 0x5E35B1 }
.col-sm-6 .col-sm-6
= f.text_field :primary_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :primary_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
.alert.alert-primary .alert.alert-primary
A simple primary alert—check it out! A simple primary alert—check it out!
.row .row
.col-sm-6 .col-sm-6
= f.text_field :danger_color, class: 'color', data: {default: 0xDC3545} = f.text_field :danger_color, class: 'color', data: { default: 0xDC3545 }
.col-sm-6 .col-sm-6
= f.text_field :danger_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :danger_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
.alert.alert-danger .alert.alert-danger
A simple danger alert—check it out! A simple danger alert—check it out!
.row .row
.col-sm-6 .col-sm-6
= f.text_field :warning_color, class: 'color', data: {default: 0xFFC107} = f.text_field :warning_color, class: 'color', data: { default: 0xFFC107 }
.col-sm-6 .col-sm-6
= f.text_field :warning_text, class: 'color', data: {default: 0x292929} = f.text_field :warning_text, class: 'color', data: { default: 0x292929 }
.col-sm-12 .col-sm-12
.alert.alert-warning .alert.alert-warning
A simple warning alert—check it out! A simple warning alert—check it out!
.row .row
.col-sm-6 .col-sm-6
= f.text_field :info_color, class: 'color', data: {default: 0x17A2B8} = f.text_field :info_color, class: 'color', data: { default: 0x17A2B8 }
.col-sm-6 .col-sm-6
= f.text_field :info_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :info_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
.alert.alert-info .alert.alert-info
A simple info alert—check it out! A simple info alert—check it out!
.row .row
.col-sm-6 .col-sm-6
= f.text_field :success_color, class: 'color', data: {default: 0x28A745} = f.text_field :success_color, class: 'color', data: { default: 0x28A745 }
.col-sm-6 .col-sm-6
= f.text_field :success_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :success_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
.alert.alert-success .alert.alert-success
A simple success alert—check it out! A simple success alert—check it out!
.row .row
.col-sm-6 .col-sm-6
= f.text_field :dark_color, class: 'color', data: {default: 0x343A40} = f.text_field :dark_color, class: 'color', data: { default: 0x343A40 }
.col-sm-6 .col-sm-6
= f.text_field :dark_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :dark_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
%a.btn.btn-dark.mb-3{ href: '#' } A dark button %a.btn.btn-dark.mb-3{ href: '#' } A dark button
.row .row
.col-sm-6 .col-sm-6
= f.text_field :light_color, class: 'color', data: {default: 0xF8F9FA} = f.text_field :light_color, class: 'color', data: { default: 0xF8F9FA }
.col-sm-6 .col-sm-6
= f.text_field :light_text, class: 'color', data: {default: 0xFFFFFF} = f.text_field :light_text, class: 'color', data: { default: 0xFFFFFF }
.col-sm-12 .col-sm-12
%a.btn.btn-light.mb-3{ href: '#' } A light button %a.btn.btn-light.mb-3{ href: '#' } A light button
.row .row
.col-sm-6 .col-sm-6
= f.text_field :muted_text, class: 'color', data: {default: 0x6C757D} = f.text_field :muted_text, class: 'color', data: { default: 0x6C757D }
.col-sm-6 .col-sm-6
%p.pt-4.text-muted Some muted text %p.pt-4.text-muted Some muted text
.card .card
@ -114,9 +114,9 @@
Styles for form inputs, like textfields. Styles for form inputs, like textfields.
.row .row
.col-sm-6 .col-sm-6
= f.text_field :input_color, class: 'color', data: {default: 0xFFFFFF} = f.text_field :input_color, class: 'color', data: { default: 0xFFFFFF }
.col-sm-6 .col-sm-6
= f.text_field :input_text, class: 'color', data: {default: 0x000000} = f.text_field :input_text, class: 'color', data: { default: 0x000000 }
.card .card
.card-body .card-body
%h2 Raised Content %h2 Raised Content
@ -124,9 +124,9 @@
Raised content basically describes all the different boxes and panels you can see across the site. Raised content basically describes all the different boxes and panels you can see across the site.
.row .row
.col-sm-6 .col-sm-6
= f.text_field :raised_background, class: 'color', data: {default: 0xFFFFFF} = f.text_field :raised_background, class: 'color', data: { default: 0xFFFFFF }
.col-sm-6 .col-sm-6
= f.text_field :raised_accent, class: 'color', data: {default: 0xF7F7F7} = f.text_field :raised_accent, class: 'color', data: { default: 0xF7F7F7 }
.card-footer .card-footer
%p Some text on top of a accented area on a raised element! %p Some text on top of a accented area on a raised element!
.card .card