mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 19:55:16 +00:00
fix icons not being jazzy
This commit is contained in:
parent
a9e1e60506
commit
c1337151ac
4 changed files with 17 additions and 4 deletions
2
Gemfile
2
Gemfile
|
|
@ -97,6 +97,8 @@ gem "countries"
|
|||
# Markdown parsing
|
||||
gem "redcarpet"
|
||||
|
||||
gem "ruby_identicon"
|
||||
|
||||
# Feature flags
|
||||
gem "flipper"
|
||||
gem "flipper-active_record"
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@ GEM
|
|||
chartkick (5.2.0)
|
||||
childprocess (5.1.0)
|
||||
logger (~> 1.5)
|
||||
chunky_png (1.4.0)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.3)
|
||||
countries (8.0.2)
|
||||
|
|
@ -438,6 +439,8 @@ GEM
|
|||
rubocop-performance (>= 1.24)
|
||||
rubocop-rails (>= 2.30)
|
||||
ruby-progressbar (1.13.0)
|
||||
ruby_identicon (0.0.6)
|
||||
chunky_png (~> 1.4.0)
|
||||
rubyzip (2.4.1)
|
||||
safely_block (0.5.0)
|
||||
sanitize (7.0.0)
|
||||
|
|
@ -589,6 +592,7 @@ DEPENDENCIES
|
|||
rails (~> 8.0.2)
|
||||
redcarpet
|
||||
rubocop-rails-omakase
|
||||
ruby_identicon
|
||||
selenium-webdriver
|
||||
sentry-rails
|
||||
sentry-ruby
|
||||
|
|
|
|||
|
|
@ -430,9 +430,16 @@ class User < ApplicationRecord
|
|||
def avatar_url
|
||||
return self.slack_avatar_url if self.slack_avatar_url.present?
|
||||
return self.github_avatar_url if self.github_avatar_url.present?
|
||||
initials = self.email_addresses&.first&.email[0..1]&.upcase
|
||||
hashed_initials = Digest::SHA256.hexdigest(initials)[0..5]
|
||||
"https://i2.wp.com/ui-avatars.com/api/#{initials}/48/#{hashed_initials}/fff?ssl=1" if initials.present?
|
||||
|
||||
email = self.email_addresses&.first&.email
|
||||
if email.present?
|
||||
initials = email[0..1]&.upcase
|
||||
hashed_initials = Digest::SHA256.hexdigest(initials)[0..5]
|
||||
return "https://i2.wp.com/ui-avatars.com/api/#{initials}/48/#{hashed_initials}/fff?ssl=1"
|
||||
end
|
||||
|
||||
base64_identicon = RubyIdenticon.create_base64(id.to_s)
|
||||
"data:image/png;base64,#{base64_identicon}"
|
||||
end
|
||||
|
||||
def display_name
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ Rails.application.routes.draw do
|
|||
post "my/settings/migrate_heartbeats", to: "users#migrate_heartbeats", as: :my_settings_migrate_heartbeats
|
||||
|
||||
namespace :my do
|
||||
resources :project_repo_mappings, param: :project_name, only: [ :edit, :update ], constraints: { project_name: /[^\/]+/ }
|
||||
resources :project_repo_mappings, param: :project_name, only: [ :edit, :update ], constraints: { project_name: /[^\/]+/ }
|
||||
resource :mailing_address, only: [ :show, :edit ]
|
||||
get "mailroom", to: "mailroom#index"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue