Project

General

Profile

Feature #29824 » 0002-WIP.patch

Marius BĂLTEANU, 2025-04-25 00:04

View differences:

app/assets/stylesheets/application.css
2007 2007
  border-radius: 20%;
2008 2008
}
2009 2009

  
2010
div.issue img.gravatar {
2010
div.issue img.gravatar, div.issue .avatar {
2011 2011
  float: left;
2012 2012
  margin: 0 12px 6px 0;
2013 2013
}
......
2016 2016
  position: relative;
2017 2017
}
2018 2018

  
2019
div.gravatar-with-child > img.gravatar:nth-child(2) {
2019
div.gravatar-with-child > img.gravatar:nth-child(2), div.gravatar-with-child > .avatar:nth-child(2) {
2020 2020
  position: absolute;
2021 2021
  top: 30px;
2022 2022
  left: 30px;
......
2030 2030
#activity dt img.gravatar {margin: 0 1em 0 0;}
2031 2031
/* Used on 12px Gravatar img tags without the icon background */
2032 2032
.icon-gravatar {float: left; margin-right: 4px;}
2033
.avatar {
2034
  border-radius: 20%;
2035
  display: inline-flex;
2036
  flex-shrink: 0;
2037
  overflow: hidden;
2038
}
2039

  
2040
.avatar span[role="img"] {
2041
  align-items: center;
2042
  block-size: 100%;
2043
  border-radius: 20%;
2044
  display: flex;
2045
  font-size: calc(24px * .6);
2046
  color: #fff;
2047
  inline-size: 100%;
2048
  justify-content: center;
2049
  user-select: none;
2050
}
2051
.avatar.s16 {
2052
  block-size: 16px;
2053
  inline-size: 16px;
2054
}
2055
.avatar.s16 span[role="img"] {
2056
  font-size: calc(16px * .6);
2057
}
2058
.avatar.s22 {
2059
  block-size: 22px;
2060
  inline-size: 22px;
2061
}
2062
.avatar.s22 span[role="img"] {
2063
  font-size: calc(22px * .5);
2064
}
2065
.avatar.s24 {
2066
  block-size: 24px;
2067
  inline-size: 24px;
2068
}
2069
.avatar.s24 span[role="img"] {
2070
  font-size: calc(24px * .6);
2071
}
2072
.avatar.s50 {
2073
  block-size: 50px;
2074
  inline-size: 50px;
2075
}
2076
.avatar.s50 span[role="img"] {
2077
  font-size: calc(50px * .6);
2078
}
2079

  
2080
.avatar-color-0 {
2081
  background-color: #880000;
2082
}
2083
.avatar-color-1 {
2084
  background-color: #ff0000;
2085
}
2086
.avatar-color-2 {
2087
  background-color: #00ff00;
2088
}
2089
.avatar-color-3 {
2090
  background-color: #008800;
2091
}
2092
.avatar-color-4 {
2093
  background-color: #0000ff;
2094
}
2095
.avatar-color-5 {
2096
  background-color: #000088;
2097
}
2098
.avatar-color-6 {
2099
  background-color: #ff8800;
2100
}
2101
.avatar-color-7 {
2102
  background-color: #ff0088;
2103
}
2033 2104

  
2034 2105
#activity dt, .journal {clear: left;}
2035 2106

  
app/helpers/avatars_helper.rb
58 58
        nil
59 59
      end
60 60
    else
61
      if user.respond_to?(:initials)
62
        size = options.delete(:size) || GravatarHelper::DEFAULT_OPTIONS[:size]
63
        span = content_tag('span', user.initials, role: 'img', class: "avatar-color-#{user.id % 8}")
64
        content_tag('div', span, class: "avatar s#{size}")
65
      else
61 66
      ''
67
      end
62 68
    end
63 69
  end
64 70

  
(4-4/4)