From 5657067e558791a7ea6ce3fd4a131d8eb323ff7c Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Tue, 1 Sep 2020 18:28:58 -0500 Subject: [PATCH] [deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149) This reverts commit ab81f36a38c74534ff0cc7cf61b9401228d1a0eb. --- app/controllers/async_info_controller.rb | 2 +- app/controllers/stories_controller.rb | 4 ++-- app/helpers/chat_channel_membership_helper.rb | 4 ++-- .../chat_channel_memberships_helper.rb | 2 +- app/helpers/messages_helper.rb | 2 +- app/labor/profile_image.rb | 13 +++++++++++++ app/models/chat_channel.rb | 2 +- app/models/chat_channel_membership.rb | 2 +- app/models/message.rb | 4 ++-- app/models/organization.rb | 2 +- app/models/podcast.rb | 2 +- app/models/user.rb | 2 +- .../search/podcast_episode_serializer.rb | 2 +- app/serializers/webhook/user_serializer.rb | 4 ++-- app/services/images/profile.rb | 14 -------------- app/views/admin/comments/index.html.erb | 2 +- .../api/v0/articles/onboarding.json.jbuilder | 2 +- .../api/v0/shared/_follows.json.jbuilder | 2 +- .../api/v0/shared/_organization.json.jbuilder | 6 ++++-- app/views/api/v0/shared/_user.json.jbuilder | 6 ++++-- app/views/api/v0/users/show.json.jbuilder | 2 +- app/views/articles/_about_author.html.erb | 2 +- app/views/articles/_liquid.html.erb | 2 +- app/views/articles/_org_branding.html.erb | 2 +- app/views/articles/_single_story.html.erb | 2 +- app/views/articles/_sticky_nav.html.erb | 4 ++-- app/views/articles/show.html.erb | 4 ++-- app/views/articles/tags/_sidebar.html.erb | 2 +- app/views/chat_channels/show.json.jbuilder | 2 +- app/views/comments/_comment.json.jbuilder | 2 +- app/views/comments/_comment_proper.html.erb | 2 +- app/views/comments/_liquid.html.erb | 2 +- .../deleted_commentable_comment.html.erb | 2 +- app/views/dashboards/followers.html.erb | 2 +- .../following_organizations.html.erb | 2 +- app/views/dashboards/following_users.html.erb | 2 +- app/views/notifications/_broadcast.html.erb | 2 +- app/views/organizations/_liquid.html.erb | 2 +- .../_sidebar_additional.html.erb | 2 +- .../partnerships/_metal_level_form.html.erb | 2 +- .../partnerships/_not_enough_credits.html.erb | 2 +- app/views/partnerships/_tag_form.html.erb | 2 +- .../social_previews/articles/article.html.erb | 2 +- .../articles/shecoded.html.erb | 2 +- app/views/social_previews/comment.html.erb | 2 +- app/views/social_previews/user.html.erb | 2 +- app/views/users/_liquid.html.erb | 4 ++-- app/views/users/_organizations_area.html.erb | 2 +- app/views/users/_profile.html.erb | 2 +- app/views/users/_profile_header.html.erb | 2 +- app/views/users/index.json.jbuilder | 2 +- app/views/users/show.html.erb | 2 +- .../profile_image_spec.rb} | 6 +++--- spec/liquid_tags/link_tag_spec.rb | 2 +- spec/requests/api/v0/followers_spec.rb | 2 +- spec/requests/api/v0/users_spec.rb | 6 +++--- spec/requests/api/v0/webhooks_spec.rb | 19 ++++++++----------- spec/requests/articles/articles_show_spec.rb | 2 +- spec/requests/chat_channels_spec.rb | 2 +- spec/requests/followings_spec.rb | 6 +++--- spec/requests/user/user_show_spec.rb | 2 +- spec/requests/user/user_suggestions_spec.rb | 2 +- 62 files changed, 99 insertions(+), 99 deletions(-) create mode 100644 app/labor/profile_image.rb delete mode 100644 app/services/images/profile.rb rename spec/{services/images/profile_spec.rb => labor/profile_image_spec.rb} (60%) diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index f6ff9c9d0..566dbec57 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -56,7 +56,7 @@ class AsyncInfoController < ApplicationController id: @user.id, name: @user.name, username: @user.username, - profile_image_90: Images::Profile.call(@user.profile_image_url, length: 90), + profile_image_90: ProfileImage.new(@user).get(width: 90), followed_tags: @user.cached_followed_tags.to_json(only: %i[id name bg_color_hex text_color_hex hotness_score], methods: [:points]), followed_podcast_ids: @user.cached_following_podcasts_ids, diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 80466bd7e..7cf5a8893 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -378,7 +378,7 @@ class StoriesController < ApplicationController }, "url": URL.user(@user), "sameAs": user_same_as, - "image": Images::Profile.call(@user.profile_image_url, length: 320), + "image": ProfileImage.new(@user).get(width: 320), "name": @user.name, "email": @user.email_public ? @user.email : nil, "jobTitle": @user.employment_title.presence, @@ -444,7 +444,7 @@ class StoriesController < ApplicationController "@id": URL.organization(@organization) }, "url": URL.organization(@organization), - "image": Images::Profile.call(@organization.profile_image_url, length: 320), + "image": ProfileImage.new(@organization).get(width: 320), "name": @organization.name, "description": @organization.summary.presence || "404 bio not found" } diff --git a/app/helpers/chat_channel_membership_helper.rb b/app/helpers/chat_channel_membership_helper.rb index b922d8421..dc1ffb8b1 100644 --- a/app/helpers/chat_channel_membership_helper.rb +++ b/app/helpers/chat_channel_membership_helper.rb @@ -8,7 +8,7 @@ module ChatChannelMembershipHelper membership_id: membership.id, role: membership.role, status: membership.status, - image: Images::Profile.call(membership.user.profile_image_url, length: 90) + image: ProfileImage.new(membership.user).get(width: 90) } end end @@ -21,7 +21,7 @@ module ChatChannelMembershipHelper membership_id: membership.id, role: membership.role, status: membership.status, - image: Images::Profile.call(membership.user.profile_image_url, length: 90) + image: ProfileImage.new(membership.user).get(width: 90) } end end diff --git a/app/helpers/chat_channel_memberships_helper.rb b/app/helpers/chat_channel_memberships_helper.rb index 70e31f4ad..710511bf0 100644 --- a/app/helpers/chat_channel_memberships_helper.rb +++ b/app/helpers/chat_channel_memberships_helper.rb @@ -8,7 +8,7 @@ module ChatChannelMembershipsHelper membership_id: membership.id, role: membership.role, status: membership.status, - image: Images::Profile.call(membership.user.profile_image_url, length: 90), + image: ProfileImage.new(membership.user).get(width: 90), chat_channel_name: membership.chat_channel.channel_name, chat_channel_id: membership.chat_channel.id, slug: membership.chat_channel.slug diff --git a/app/helpers/messages_helper.rb b/app/helpers/messages_helper.rb index 46098d6b5..2af27b524 100644 --- a/app/helpers/messages_helper.rb +++ b/app/helpers/messages_helper.rb @@ -8,7 +8,7 @@ module MessagesHelper chat_channel_adjusted_slug: new_message.chat_channel.adjusted_slug(current_user, "sender"), channel_type: new_message.chat_channel.channel_type, username: new_message.user.username, - profile_image_url: Images::Profile.call(new_message.user.profile_image_url, length: 90), + profile_image_url: ProfileImage.new(new_message.user).get(width: 90), message: new_message.message_html, markdown: new_message.message_markdown, edited_at: new_message.edited_at, diff --git a/app/labor/profile_image.rb b/app/labor/profile_image.rb new file mode 100644 index 000000000..e3ed25b70 --- /dev/null +++ b/app/labor/profile_image.rb @@ -0,0 +1,13 @@ +class ProfileImage + BACKUP_LINK = "https://thepracticaldev.s3.amazonaws.com/i/99mvlsfu5tfj9m7ku25d.png".freeze + + attr_accessor :image_link + + def initialize(resource) + @image_link = resource.profile_image_url + end + + def get(width: 120) + Images::Optimizer.call(image_link || BACKUP_LINK, width: width, height: width, crop: "fill") + end +end diff --git a/app/models/chat_channel.rb b/app/models/chat_channel.rb index eab7ef3bb..dea2750ca 100644 --- a/app/models/chat_channel.rb +++ b/app/models/chat_channel.rb @@ -169,7 +169,7 @@ class ChatChannel < ApplicationRecord def user_obj(membership) { - profile_image: Images::Profile.call(membership.user.profile_image_url, length: 90), + profile_image: ProfileImage.new(membership.user).get(width: 90), darker_color: membership.user.decorate.darker_color, name: membership.user.name, last_opened_at: membership.last_opened_at, diff --git a/app/models/chat_channel_membership.rb b/app/models/chat_channel_membership.rb index 83d8220bf..4febd4607 100644 --- a/app/models/chat_channel_membership.rb +++ b/app/models/chat_channel_membership.rb @@ -50,7 +50,7 @@ class ChatChannelMembership < ApplicationRecord def channel_image if chat_channel.channel_type == "direct" - Images::Profile.call(other_user.profile_image_url, length: 90) + ProfileImage.new(other_user).get(width: 90) else ActionController::Base.helpers.asset_path("organization.svg") end diff --git a/app/models/message.rb b/app/models/message.rb index 6989c9e1c..4ffb0f882 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -109,7 +109,7 @@ class Message < ApplicationRecord target='_blank' rel='noopener' data-content='sidecar-article'> #{"
" if article.main_image.present?}

#{article.title}

-

#{article.cached_user.name}・#{article.readable_publish_date || 'Draft Post'}

+

#{article.cached_user.name}・#{article.readable_publish_date || 'Draft Post'}

".html_safe elsif (tag = rich_link_tag(anchor)) html += "

- + #{user.name}

".html_safe diff --git a/app/models/organization.rb b/app/models/organization.rb index 6d6263cf1..55b92bb9f 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -93,7 +93,7 @@ class Organization < ApplicationRecord end def profile_image_90 - Images::Profile.call(profile_image_url, length: 90) + ProfileImage.new(self).get(width: 90) end def enough_credits?(num_credits_needed) diff --git a/app/models/podcast.rb b/app/models/podcast.rb index 4796e310c..70986c12d 100644 --- a/app/models/podcast.rb +++ b/app/models/podcast.rb @@ -43,7 +43,7 @@ class Podcast < ApplicationRecord end def image_90 - Images::Profile.call(profile_image_url, length: 90) + ProfileImage.new(self).get(width: 90) end private diff --git a/app/models/user.rb b/app/models/user.rb index f554a12ac..b0c040f9e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -490,7 +490,7 @@ class User < ApplicationRecord end def profile_image_90 - Images::Profile.call(profile_image_url, length: 90) + ProfileImage.new(self).get(width: 90) end def unsubscribe_from_newsletters diff --git a/app/serializers/search/podcast_episode_serializer.rb b/app/serializers/search/podcast_episode_serializer.rb index 1485fa4f3..3b55a9e18 100644 --- a/app/serializers/search/podcast_episode_serializer.rb +++ b/app/serializers/search/podcast_episode_serializer.rb @@ -8,7 +8,7 @@ module Search :website_url attribute :main_image do |pde| - Images::Profile.call(pde.podcast.profile_image_url, length: 90) + ProfileImage.new(pde.podcast).get(width: 90) end attribute :slug, &:podcast_slug diff --git a/app/serializers/webhook/user_serializer.rb b/app/serializers/webhook/user_serializer.rb index e07ff9537..ad0167309 100644 --- a/app/serializers/webhook/user_serializer.rb +++ b/app/serializers/webhook/user_serializer.rb @@ -3,10 +3,10 @@ module Webhook attributes :name, :username, :twitter_username, :github_username attribute :website_url, &:processed_website_url attribute :profile_image do |user| - Images::Profile.call(user.profile_image_url, length: 640) + ProfileImage.new(user).get(width: 640) end attribute :profile_image_90 do |user| - Images::Profile.call(user.profile_image_url, length: 90) + ProfileImage.new(user).get(width: 90) end end end diff --git a/app/services/images/profile.rb b/app/services/images/profile.rb deleted file mode 100644 index 4031cbbff..000000000 --- a/app/services/images/profile.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Images - module Profile - BACKUP_LINK = "https://thepracticaldev.s3.amazonaws.com/i/99mvlsfu5tfj9m7ku25d.png".freeze - - def self.call(image_url, length: 120) - Optimizer.call( - image_url || BACKUP_LINK, - width: length, - height: length, - crop: "fill", - ) - end - end -end diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb index 8e39a9399..6e0b94864 100644 --- a/app/views/admin/comments/index.html.erb +++ b/app/views/admin/comments/index.html.erb @@ -19,7 +19,7 @@
<% if comment.user %> - <%= comment.user.username %> profile <%= comment.user.username %> + <%= comment.user.username %> profile <%= comment.user.username %> <% end %> <% if comment.user && comment.user.twitter_username.present? %> diff --git a/app/views/api/v0/articles/onboarding.json.jbuilder b/app/views/api/v0/articles/onboarding.json.jbuilder index 25754a4c4..ce578dd28 100644 --- a/app/views/api/v0/articles/onboarding.json.jbuilder +++ b/app/views/api/v0/articles/onboarding.json.jbuilder @@ -13,6 +13,6 @@ json.array! @articles do |article| json.user do json.name article.user.name - json.profile_image_url Images::Profile.call(article.user.profile_image_url, length: 90) + json.profile_image_url ProfileImage.new(article.user).get(width: 90) end end diff --git a/app/views/api/v0/shared/_follows.json.jbuilder b/app/views/api/v0/shared/_follows.json.jbuilder index 456337d1e..afc7c75b4 100644 --- a/app/views/api/v0/shared/_follows.json.jbuilder +++ b/app/views/api/v0/shared/_follows.json.jbuilder @@ -1,4 +1,4 @@ json.name user.name json.path "/#{user.path.delete_prefix('/')}" json.username user.try(:username) || user.name -json.profile_image Images::Profile.call(user.profile_image_url, length: 60) +json.profile_image ProfileImage.new(user).get(width: 60) diff --git a/app/views/api/v0/shared/_organization.json.jbuilder b/app/views/api/v0/shared/_organization.json.jbuilder index d933741b9..e64497d25 100644 --- a/app/views/api/v0/shared/_organization.json.jbuilder +++ b/app/views/api/v0/shared/_organization.json.jbuilder @@ -1,6 +1,8 @@ +organization_profile_image = ProfileImage.new(organization) + json.organization do json.extract!(organization, :name, :username, :slug) - json.profile_image Images::Profile.call(organization.profile_image_url, length: 640) - json.profile_image_90 Images::Profile.call(organization.profile_image_url, length: 90) + json.profile_image organization_profile_image.get(width: 640) + json.profile_image_90 organization_profile_image.get(width: 90) end diff --git a/app/views/api/v0/shared/_user.json.jbuilder b/app/views/api/v0/shared/_user.json.jbuilder index d7a1d1344..52ab7809b 100644 --- a/app/views/api/v0/shared/_user.json.jbuilder +++ b/app/views/api/v0/shared/_user.json.jbuilder @@ -1,7 +1,9 @@ +user_profile_image = ProfileImage.new(user) + json.user do json.extract!(user, :name, :username, :twitter_username, :github_username) json.website_url user.processed_website_url - json.profile_image Images::Profile.call(user.profile_image_url, length: 640) - json.profile_image_90 Images::Profile.call(user.profile_image_url, length: 90) + json.profile_image user_profile_image.get(width: 640) + json.profile_image_90 user_profile_image.get(width: 90) end diff --git a/app/views/api/v0/users/show.json.jbuilder b/app/views/api/v0/users/show.json.jbuilder index 44bce87e5..8720d53fe 100644 --- a/app/views/api/v0/users/show.json.jbuilder +++ b/app/views/api/v0/users/show.json.jbuilder @@ -13,4 +13,4 @@ json.extract!( ) json.joined_at @user.created_at.strftime("%b %e, %Y") -json.profile_image Images::Profile.call(@user.profile_image_url, length: 320) +json.profile_image ProfileImage.new(@user).get(width: 320) diff --git a/app/views/articles/_about_author.html.erb b/app/views/articles/_about_author.html.erb index 8bec12c43..ec2fa37c0 100644 --- a/app/views/articles/_about_author.html.erb +++ b/app/views/articles/_about_author.html.erb @@ -5,7 +5,7 @@
- <%= @user.username %> profile + <%= @user.username %> profile

<%= @user.name %>

diff --git a/app/views/articles/_liquid.html.erb b/app/views/articles/_liquid.html.erb index a4083a81d..f1df953ff 100644 --- a/app/views/articles/_liquid.html.erb +++ b/app/views/articles/_liquid.html.erb @@ -9,7 +9,7 @@ <% end %> diff --git a/app/views/articles/_org_branding.html.erb b/app/views/articles/_org_branding.html.erb index f57e0cf6b..49d7a38e7 100644 --- a/app/views/articles/_org_branding.html.erb +++ b/app/views/articles/_org_branding.html.erb @@ -2,7 +2,7 @@
diff --git a/app/views/articles/_single_story.html.erb b/app/views/articles/_single_story.html.erb index d0769d5b6..01dc0ea79 100644 --- a/app/views/articles/_single_story.html.erb +++ b/app/views/articles/_single_story.html.erb @@ -28,7 +28,7 @@ <% end %> - <%= story.cached_user.username %> profile + <%= story.cached_user.username %> profile
diff --git a/app/views/articles/_sticky_nav.html.erb b/app/views/articles/_sticky_nav.html.erb index b9df1b107..f811ef258 100644 --- a/app/views/articles/_sticky_nav.html.erb +++ b/app/views/articles/_sticky_nav.html.erb @@ -4,7 +4,7 @@
crayons-avatar crayons-avatar--xl<% elsif @actor.class.name == "Organization" %>crayons-logo crayons-logo--xl<% end %> mr-2 shrink-0"> - crayons-avatar__image<% elsif @actor.class.name == "Organization" %>crayons-logo__image<% end %>" alt="<%= @actor.name %> profile image"> + crayons-avatar__image<% elsif @actor.class.name == "Organization" %>crayons-logo__image<% end %>" alt="<%= @actor.name %> profile image"> <%= @actor.name %> @@ -72,7 +72,7 @@ <% @sticky_articles.each_with_index do |article, index| %> - <%= article.user.name %> profile image + <%= article.user.name %> profile image
<%= article.title %> diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index 46ac009f7..05f2f62d8 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -124,7 +124,7 @@ <% if @organization %> <%= @organization.name %> @@ -147,7 +147,7 @@
- <%= @user.username %> profile image + <%= @user.username %> profile image <%= @user.name %> diff --git a/app/views/articles/tags/_sidebar.html.erb b/app/views/articles/tags/_sidebar.html.erb index 9ee724c75..cb770b527 100644 --- a/app/views/articles/tags/_sidebar.html.erb +++ b/app/views/articles/tags/_sidebar.html.erb @@ -54,7 +54,7 @@ <% @moderators.each do |user| %> <% end %> diff --git a/app/views/chat_channels/show.json.jbuilder b/app/views/chat_channels/show.json.jbuilder index 1fab47d65..885442833 100644 --- a/app/views/chat_channels/show.json.jbuilder +++ b/app/views/chat_channels/show.json.jbuilder @@ -2,7 +2,7 @@ json.messages @chat_messages.reverse do |message| json.extract!(message, :id, :user_id, :edited_at) json.username message.user.username - json.profile_image_url Images::Profile.call(message.user.profile_image_url, length: 90) + json.profile_image_url ProfileImage.new(message.user).get(width: 90) json.message message.message_html json.markdown message.message_markdown json.timestamp message.created_at diff --git a/app/views/comments/_comment.json.jbuilder b/app/views/comments/_comment.json.jbuilder index 9d90c1fe1..be524362c 100644 --- a/app/views/comments/_comment.json.jbuilder +++ b/app/views/comments/_comment.json.jbuilder @@ -12,7 +12,7 @@ json.user do json.id current_user.id json.username current_user.username json.name current_user.name - json.profile_pic Images::Profile.call(current_user.profile_image_url, length: 50) + json.profile_pic ProfileImage.new(current_user).get(width: 50) json.twitter_username current_user.twitter_username json.github_username current_user.github_username end diff --git a/app/views/comments/_comment_proper.html.erb b/app/views/comments/_comment_proper.html.erb index 7ae19702d..5ac61a776 100644 --- a/app/views/comments/_comment_proper.html.erb +++ b/app/views/comments/_comment_proper.html.erb @@ -26,7 +26,7 @@
"> - <%= comment.user.username %> profile image + <%= comment.user.username %> profile image <%= comment.user.name %> diff --git a/app/views/comments/_liquid.html.erb b/app/views/comments/_liquid.html.erb index 021fc296b..c356f1287 100644 --- a/app/views/comments/_liquid.html.erb +++ b/app/views/comments/_liquid.html.erb @@ -1,7 +1,7 @@
- <%= comment.user.username %> profile image + <%= comment.user.username %> profile image <%= comment.user.name %> diff --git a/app/views/comments/deleted_commentable_comment.html.erb b/app/views/comments/deleted_commentable_comment.html.erb index b99c6fb81..4b27253ec 100644 --- a/app/views/comments/deleted_commentable_comment.html.erb +++ b/app/views/comments/deleted_commentable_comment.html.erb @@ -23,7 +23,7 @@
"> - <%= @user.username %> profile image + <%= @user.username %> profile image <%= @user.name %> diff --git a/app/views/dashboards/followers.html.erb b/app/views/dashboards/followers.html.erb index bb22bb65a..d284a4d0f 100644 --- a/app/views/dashboards/followers.html.erb +++ b/app/views/dashboards/followers.html.erb @@ -21,7 +21,7 @@ <% if user %>
- <%= user.username %> profile image + <%= user.username %> profile image
diff --git a/app/views/dashboards/following_organizations.html.erb b/app/views/dashboards/following_organizations.html.erb index d2607fe6c..b26fb03a7 100644 --- a/app/views/dashboards/following_organizations.html.erb +++ b/app/views/dashboards/following_organizations.html.erb @@ -21,7 +21,7 @@ <% organization = follow.followable %>
diff --git a/app/views/dashboards/following_users.html.erb b/app/views/dashboards/following_users.html.erb index 5f3e11feb..5200915ed 100644 --- a/app/views/dashboards/following_users.html.erb +++ b/app/views/dashboards/following_users.html.erb @@ -22,7 +22,7 @@ <% if user %>
- <%= user.username %> profile image + <%= user.username %> profile image
diff --git a/app/views/notifications/_broadcast.html.erb b/app/views/notifications/_broadcast.html.erb index 3f1daafa8..edb866a09 100644 --- a/app/views/notifications/_broadcast.html.erb +++ b/app/views/notifications/_broadcast.html.erb @@ -3,7 +3,7 @@ <% cache "broadcast-html-#{notification.json_data['broadcast']['title']}" do %> " class="small-pic-link-wrapper">
- link to <%= json_data['s profile"> + link to <%= json_data['s profile">
"> diff --git a/app/views/organizations/_liquid.html.erb b/app/views/organizations/_liquid.html.erb index 61301a8aa..3e3e4d2da 100644 --- a/app/views/organizations/_liquid.html.erb +++ b/app/views/organizations/_liquid.html.erb @@ -8,7 +8,7 @@
- <%= " /> + <%= organization.slug + " />
diff --git a/app/views/organizations/_sidebar_additional.html.erb b/app/views/organizations/_sidebar_additional.html.erb index 06837783a..008ccb5e1 100644 --- a/app/views/organizations/_sidebar_additional.html.erb +++ b/app/views/organizations/_sidebar_additional.html.erb @@ -18,7 +18,7 @@ <% @organization.users.find_each do |user| %> <% end %> diff --git a/app/views/partnerships/_metal_level_form.html.erb b/app/views/partnerships/_metal_level_form.html.erb index 7ceb4ff73..00bf00cf5 100644 --- a/app/views/partnerships/_metal_level_form.html.erb +++ b/app/views/partnerships/_metal_level_form.html.erb @@ -1,5 +1,5 @@
-

@<%= org.slug %>

+

@<%= org.slug %>

This organization account has <%= org.credits.unspent.size %> credits available
<% sponsorships = org.sponsorships.unexpired.where(level: Sponsorship::METAL_LEVELS) %> <% level_sponsorship = sponsorships.where(level: level).take %> diff --git a/app/views/partnerships/_not_enough_credits.html.erb b/app/views/partnerships/_not_enough_credits.html.erb index 008c54c8c..3f2e8729e 100644 --- a/app/views/partnerships/_not_enough_credits.html.erb +++ b/app/views/partnerships/_not_enough_credits.html.erb @@ -1,5 +1,5 @@

What next?

-

Purchase Credits for @<%= org.slug %>

+

Purchase Credits for @<%= org.slug %>

<% if org.credits.unspent.size > 0 %>
This organization account has <%= org.credits.unspent.size %> credits available diff --git a/app/views/partnerships/_tag_form.html.erb b/app/views/partnerships/_tag_form.html.erb index c07afc6bf..d739fe218 100644 --- a/app/views/partnerships/_tag_form.html.erb +++ b/app/views/partnerships/_tag_form.html.erb @@ -1,6 +1,6 @@
<% sponsored_tags = org.sponsorships.unexpired.where(level: :tag).includes(:sponsorable).map { |sp| sp.sponsorable.name } %> -

@<%= org.slug %>

+

@<%= org.slug %>

<% if org.enough_credits?(Sponsorship::CREDITS[level]) %>
This organization account has <%= org.credits.unspent.size %> credits available

diff --git a/app/views/social_previews/articles/article.html.erb b/app/views/social_previews/articles/article.html.erb index 3ff8fbcdb..fa60c6025 100644 --- a/app/views/social_previews/articles/article.html.erb +++ b/app/views/social_previews/articles/article.html.erb @@ -127,7 +127,7 @@

<%= @article.title %>

- + <%= truncate @article.user.name, length: 28 %>・<%= @article.readable_publish_date %>
diff --git a/app/views/social_previews/articles/shecoded.html.erb b/app/views/social_previews/articles/shecoded.html.erb index 3e84cefe1..ac878b768 100644 --- a/app/views/social_previews/articles/shecoded.html.erb +++ b/app/views/social_previews/articles/shecoded.html.erb @@ -117,7 +117,7 @@

<%= @article.title %>

- + <%= truncate @article.user.name, length: 28 %>・<%= @article.readable_publish_date %>
diff --git a/app/views/social_previews/comment.html.erb b/app/views/social_previews/comment.html.erb index 60b8e45c7..1e485db59 100644 --- a/app/views/social_previews/comment.html.erb +++ b/app/views/social_previews/comment.html.erb @@ -120,7 +120,7 @@

<%= @comment.title %>

- + <%= truncate @comment.user.name, length: 28 %>・<%= @comment.readable_publish_date %>
diff --git a/app/views/social_previews/user.html.erb b/app/views/social_previews/user.html.erb index 1b09184af..65d4eed4c 100644 --- a/app/views/social_previews/user.html.erb +++ b/app/views/social_previews/user.html.erb @@ -110,7 +110,7 @@ <% font_size = 4.6 %> <% end %>

- <%= @user.name %> profile image + <%= @user.name %> profile image <%= truncate @user.name, length: 32 %>
@<%= @user.username %> diff --git a/app/views/users/_liquid.html.erb b/app/views/users/_liquid.html.erb index 182464717..a15580ca7 100644 --- a/app/views/users/_liquid.html.erb +++ b/app/views/users/_liquid.html.erb @@ -9,12 +9,12 @@ <% if user_path.present? %>
- <%= " /> + <%= " />
<% else %>
- <%= " /> + <%= " />
<% end %>
diff --git a/app/views/users/_organizations_area.html.erb b/app/views/users/_organizations_area.html.erb index 3d36b81e9..a9b575897 100644 --- a/app/views/users/_organizations_area.html.erb +++ b/app/views/users/_organizations_area.html.erb @@ -8,7 +8,7 @@ <% @user.organizations.each do |organization| %> <% end %> diff --git a/app/views/users/_profile.html.erb b/app/views/users/_profile.html.erb index e9d0d554a..8b5d21c55 100644 --- a/app/views/users/_profile.html.erb +++ b/app/views/users/_profile.html.erb @@ -42,7 +42,7 @@
<% if @user.profile_image_url.present? %> - <%= @user.username %> profile image + <%= @user.username %> profile image <%= f.file_field :profile_image, accept: "image/*", class: "crayons-card crayons-card--secondary p-3 flex items-center flex-1 w-100" %> <% end %>
diff --git a/app/views/users/_profile_header.html.erb b/app/views/users/_profile_header.html.erb index ed9aee8f3..4493539f9 100644 --- a/app/views/users/_profile_header.html.erb +++ b/app/views/users/_profile_header.html.erb @@ -20,7 +20,7 @@