diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-09-19 21:46:01 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-09-19 21:46:01 +0200 |
commit | 91bef4759f40422b64d7990f9b90db0b493773b1 (patch) | |
tree | 3211b1014a6d0a88737db16c44d210ef96a070e4 /app/helpers/home_helper.rb | |
parent | 382cdd7f959480d59fee5646be320d6076cb18d8 (diff) | |
parent | 554f659f2aa1eb9c0ca64ec1c9c177538434826c (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: Vagrantfile app/javascript/packs/public.js app/views/admin/settings/edit.html.haml app/views/settings/preferences/show.html.haml app/views/settings/profiles/show.html.haml config/locales/es.yml config/locales/simple_form.en.yml config/webpack/configuration.js config/webpack/loaders/babel.js package.json yarn.lock Split new additions to app/javascript/packs/public.js to app/javascript/core/settings.js
Diffstat (limited to 'app/helpers/home_helper.rb')
-rw-r--r-- | app/helpers/home_helper.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index f5b501235..ba7c443c2 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -7,13 +7,13 @@ module HomeHelper } end - def account_link_to(account, button = '') + def account_link_to(account, button = '', size: 36, path: nil) content_tag(:div, class: 'account') do content_tag(:div, class: 'account__wrapper') do section = if account.nil? content_tag(:div, class: 'account__display-name') do content_tag(:div, class: 'account__avatar-wrapper') do - content_tag(:div, '', class: 'account__avatar', style: "background-image: url(#{full_asset_url('avatars/original/missing.png', skip_pipeline: true)})") + content_tag(:div, '', class: 'account__avatar', style: "width: #{size}px; height: #{size}px; background-size: #{size}px #{size}px; background-image: url(#{full_asset_url('avatars/original/missing.png', skip_pipeline: true)})") end + content_tag(:span, class: 'display-name') do content_tag(:strong, t('about.contact_missing')) + @@ -21,9 +21,9 @@ module HomeHelper end end else - link_to(TagManager.instance.url_for(account), class: 'account__display-name') do + link_to(path || TagManager.instance.url_for(account), class: 'account__display-name') do content_tag(:div, class: 'account__avatar-wrapper') do - content_tag(:div, '', class: 'account__avatar', style: "background-image: url(#{account.avatar.url})") + content_tag(:div, '', class: 'account__avatar', style: "width: #{size}px; height: #{size}px; background-size: #{size}px #{size}px; background-image: url(#{account.avatar.url})") end + content_tag(:span, class: 'display-name') do content_tag(:bdi) do @@ -48,4 +48,12 @@ module HomeHelper '1+' end end + + def custom_field_classes(field) + if field.verified? + 'verified' + else + 'emojify' + end + end end |