diff options
65 files changed, 284 insertions, 95 deletions
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e994c12af..568bed2bc 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -433,7 +433,7 @@ tr.entry.file td.filename a { margin-left: 26px; } tr.entry.file td.filename_no_report a { margin-left: 16px; } tr span.expander, .gantt_subjects div > span.expander {margin-left: 0; cursor: pointer;} -.gantt_subjects div > span .icon-gravatar {float: none;} +.gantt_subjects .avatar {margin-right: 4px;} .gantt_subjects div.project-name a, .gantt_subjects div.version-name a {margin-left: 4px;} tr.changeset { height: 20px } @@ -461,7 +461,7 @@ tr.version:not(.shared) td.name { padding-left: 20px; } tr.version td.date, tr.version td.status, tr.version td.sharing { text-align: center; white-space:nowrap; } #principals_for_new_member .icon-user, #users_for_watcher .icon-user {background:transparent;} -#principals_for_new_member svg, #principals_for_new_member img {margin-right: 4px;} +#principals_for_new_member svg, #principals_for_new_member .avatar {margin-right: 4px;} tr.user td {width:13%;white-space: nowrap;} td.username, td.firstname, td.lastname, td.email {text-align:left !important;} @@ -565,9 +565,9 @@ body.controller-gantts fieldset#options > div > div { td.center {text-align:center;} #watchers select {width: 95%; display: block;} -#watchers img.gravatar {margin: 0 4px 2px 0;} +#watchers .avatar {margin: 0 4px 2px 0;} #watchers svg.icon-svg {margin: 0 2px 2px 0;} -#users_for_watcher img.gravatar {padding-bottom: 2px; margin-right: 4px;} +#users_for_watcher .avatar {padding-bottom: 2px; margin-right: 4px;} #users_for_watcher svg {margin-right: 4px;} #users_for_watcher span.icon-user {display: inline;} @@ -1439,7 +1439,7 @@ p.cal.legend span {display:flex;} .tooltip span.tip{display: none; text-align:left;} .tooltip span.tip a { color: #169 !important; } -.tooltip span.tip img.gravatar { +.tooltip span.tip .avatar { float: none; margin: 0; } @@ -1794,9 +1794,6 @@ table.gantt-table td { } .gantt_subjects div.issue-subject:hover { background-color:#ffffdd; } .gantt_selected_column_content > div { padding-left: 3px; box-sizing: border-box; } -.gantt_subjects .issue-subject img.icon-gravatar { - margin: 2px 5px 0px 2px; -} .gantt_hdr_selected_column_name { position: absolute; @@ -2184,21 +2181,16 @@ tr.ui-sortable-helper { border:1px solid #e4e4e4; } .contextual>*:not(:first-child), .buttons>.icon:not(:first-child), .contextual .journal-actions>*:not(:first-child) { margin-left: 5px; } -img.gravatar { - vertical-align: middle; - border-radius: 20%; -} - -div.issue img.gravatar { +div.issue .avatar { float: left; margin: 0 12px 6px 0; } -div.gravatar-with-child { +div.avatar-with-child { position: relative; } -div.gravatar-with-child > img.gravatar:nth-child(2) { +div.avatar-with-child > .avatar:nth-child(2) { position: absolute; top: 30px; left: 30px; @@ -2206,11 +2198,11 @@ div.gravatar-with-child > img.gravatar:nth-child(2) { border: 2px solid rgba(255, 255, 255, 0.9); } -h2 img.gravatar, h3 img.gravatar {margin-right: 4px;} +h2 .avatar, h3 .avatar {margin-right: 4px;} +h4 img.gravatar {margin: -2px 4px -4px 0;} +/*# TODO: check where this rule is still used*/ td.username img.gravatar {margin: 0 0.5em 0 0; vertical-align: top;} -#activity dt img.gravatar {margin: 0 1em 0 0;} -/* Used on 12px Gravatar img tags without the icon background */ -.icon-gravatar {float: left; margin-right: 4px;} +#activity dt .avatar {margin: 0 1em 0 0;} #activity dt, .journal {clear: left;} @@ -2233,6 +2225,98 @@ color: #555; text-shadow: 1px 1px 0 #fff; img.filecontent.image {background-image: url(/transparent.png);} +/* Avatar styles */ +.avatar { + border-radius: 20%; + display: inline-flex; + vertical-align: middle; +} + +span[role="img"].avatar { + font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; + align-items: center; + display: inline-flex; + font-size: calc(24px * .4); + justify-content: center; + user-select: none; + font-weight: 700; +} +.avatar.s13 { + block-size: 13px; + inline-size: 13px; +} +span[role="img"].avatar.s13 { + font-size: calc(16px * .3); +} +.avatar.s16 { + block-size: 16px; + inline-size: 16px; +} +span[role="img"].avatar.s16 { + font-size: calc(16px * .4); +} +.avatar.s22 { + block-size: 22px; + inline-size: 22px; +} +span[role="img"].avatar.s22 { + font-size: calc(22px * .4); +} +.avatar.s24 { + block-size: 24px; + inline-size: 24px; +} +span[role="img"].avatar.s24 { + font-size: calc(24px * .4); +} +.avatar.s40 { + block-size: 40px; + inline-size: 40px; +} +span[role="img"].avatar.s40 { + font-size: calc(40px * .4); +} +.avatar.s50 { + block-size: 50px; + inline-size: 50px; +} +span[role="img"].avatar.s50 { + font-size: calc(50px * .4); +} + +.avatar-color-0 { + background-color: #880000; + color: #FFFFFF; +} +.avatar-color-1 { + background-color: #ff0000; + color: #000000; +} +.avatar-color-2 { + background-color: #00ff00; + color: #000000; +} +.avatar-color-3 { + background-color: #008800; + color: #FFFFFF; +} +.avatar-color-4 { + background-color: #0000ff; + color: #FFFFFF; +} +.avatar-color-5 { + background-color: #000088; + color: #FFFFFF; +} +.avatar-color-6 { + background-color: #ff8800; + color: #000000; +} +.avatar-color-7 { + background-color: #ff0088; + color: #000000; +} + /* Reaction styles */ .reaction-button:hover, .reaction-button:active { text-decoration: none; diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index cd9c1d66e..67567fd8d 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -38,25 +38,9 @@ module AvatarsHelper # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>') def avatar(user, options = {}) if Setting.gravatar_enabled? - options[:default] = Setting.gravatar_default - options[:class] = GravatarHelper::DEFAULT_OPTIONS[:class] + " " + options[:class] if options[:class] - email = nil - if user.respond_to?(:mail) - email = user.mail - options[:title] = user.name unless options[:title] - options[:initials] = user.initials if options[:default] == "initials" && user.initials.present? - elsif user.to_s =~ %r{<(.+?)>} - email = $1 - end - if email.present? - gravatar(email.to_s.downcase, options) rescue nil - elsif user.is_a?(AnonymousUser) - anonymous_avatar(options) - elsif user.is_a?(Group) - group_avatar(options) - else - nil - end + gravatar_avatar_tag(user, options) + elsif user.respond_to?(:initials) + initials_avatar_tag(user, options) else '' end @@ -70,8 +54,6 @@ module AvatarsHelper end end - private - def anonymous_avatar(options={}) image_tag 'anonymous.png', GravatarHelper::DEFAULT_OPTIONS.except(:default, :rating, :ssl).merge(options) end @@ -79,4 +61,42 @@ module AvatarsHelper def group_avatar(options={}) image_tag 'group.png', GravatarHelper::DEFAULT_OPTIONS.except(:default, :rating, :ssl).merge(options) end + + private + + def gravatar_avatar_tag(user, options) + options[:default] = Setting.gravatar_default + options[:class] = [GravatarHelper::DEFAULT_OPTIONS[:class], options[:class]].compact.join(' ') + + email = extract_email_from_user(user) + + if user.respond_to?(:mail) + options[:title] ||= user.name + options[:initials] = user.initials if options[:default] == "initials" && user.initials.present? + end + + if email.present? + gravatar(email.to_s.downcase, options) rescue nil + elsif user.is_a?(AnonymousUser) + anonymous_avatar(options) + elsif user.is_a?(Group) + group_avatar(options) + end + end + + def initials_avatar_tag(user, options) + size = (options.delete(:size) || GravatarHelper::DEFAULT_OPTIONS[:size]).to_i + + css_class = ["avatar-color-#{user.id % 8}", 'avatar', "s#{size}", options[:class]].compact.join(' ') + + content_tag('span', user.initials, role: 'img', class: css_class, title: options[:title]) + end + + def extract_email_from_user(user) + if user.respond_to?(:mail) + user.mail + elsif user.to_s =~ %r{<(.+?)>} + $1 + end + end end diff --git a/app/views/imports/show.html.erb b/app/views/imports/show.html.erb index cb698f018..b505d9912 100644 --- a/app/views/imports/show.html.erb +++ b/app/views/imports/show.html.erb @@ -12,8 +12,8 @@ <table id="unsaved-items" class="list"> <thead> <tr> - <th>Position</th> - <th>Message</th> + <th><%= l(:label_position) %></th> + <th><%= l(:label_message) %></th> </tr> </thead> <tbody> diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 696b8f0ec..6892269e4 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -28,9 +28,9 @@ </div> <% end %> - <div class="gravatar-with-child"> + <div class="avatar-with-child"> <%= author_avatar(@issue.author, :size => "50") %> - <%= assignee_avatar(@issue.assigned_to, :size => "22", :class => "gravatar-child") if @issue.assigned_to %> + <%= assignee_avatar(@issue.assigned_to, :size => "22", :class => "avatar-child") if @issue.assigned_to %> </div> <div data-controller="sticky-issue-header"> diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index e982f534c..9e2ef51b5 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -36,11 +36,9 @@ <% end %> <% if User.current.logged? %> - <div class="flyout-menu__avatar <% if !Setting.gravatar_enabled? %>flyout-menu__avatar--no-avatar<% end %>"> - <% if Setting.gravatar_enabled? %> - <%= link_to(avatar(User.current, :size => "80"), user_path(User.current)) %> - <% end %> - <%= link_to_user(User.current, :format => :username) %> + <div class="flyout-menu__avatar"> + <%= link_to(avatar(User.current, :size => "40"), user_path(User.current)) %> + <%= link_to_user(User.current, :format => :username) %> </div> <% end %> diff --git a/config/locales/ar.yml b/config/locales/ar.yml index bff7a376a..ab68e841e 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1532,3 +1532,5 @@ ar: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/az.yml b/config/locales/az.yml index 7bd2fffe2..54b623974 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -1623,3 +1623,5 @@ az: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 67fcf82f5..e4eb0d224 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1475,3 +1475,5 @@ bg: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 89c468f55..be1d37733 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -1518,3 +1518,5 @@ bs: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 456a1e9df..f047922c6 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1519,3 +1519,5 @@ ca: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/cs.yml b/config/locales/cs.yml index c8b0f57d0..c2438194d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1513,3 +1513,5 @@ cs: text_oauth_info_scopes: Vyberte rozsah, který může aplikace požadovat. Aplikace nebude oprávněna dělat více než je zde vybráno. Vždy to bude také omezeno rolí a členstvím v projektu uživatele, který to povolil. + label_position: Position + label_message: Message diff --git a/config/locales/da.yml b/config/locales/da.yml index 8bbf9a9ba..1226d4a3c 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1549,3 +1549,5 @@ da: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/de.yml b/config/locales/de.yml index 36e52fb3a..9c8da2187 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1488,4 +1488,6 @@ de: text_oauth_admin_permission_info: Diese Applikation verlangt vollen Administrator-Zugriff. Wenn Sie ein Administrator sind (oder in Zukunft Administrator werden), wird sie in der Lage sein, alle Daten zu lesen und zu schreiben, auch im Namen anderer Benutzer. Dies kann vermieden werden, indem die Applikation mit einem anderen Benutzerkonto ohne Administrator-Privileg autorisiert wird. text_oauth_copy_secret_now: Das Geheimnis bitte jetzt an einen sicheren Ort kopieren, es kann nicht erneut angezeigt werden. text_oauth_implicit_permissions: Zugriff auf Benutzername, Login sowie auf die primäre Email-Adresse - text_oauth_info_scopes: Scopes für die Applikation auswählen. Die Applikation wird niemals mehr Rechte haben als hier ausgewählt. Sie wird außerdem auf die Rollen und Projektmitgliedschaften des Benutzers, der sie autorisiert hat, beschränkt sein.
\ No newline at end of file + text_oauth_info_scopes: Scopes für die Applikation auswählen. Die Applikation wird niemals mehr Rechte haben als hier ausgewählt. Sie wird außerdem auf die Rollen und Projektmitgliedschaften des Benutzers, der sie autorisiert hat, beschränkt sein. + label_position: Position + label_message: Message diff --git a/config/locales/el.yml b/config/locales/el.yml index e2f9049f5..642d77281 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1532,3 +1532,5 @@ el: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 59ee096c4..1fc956a0c 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1533,3 +1533,5 @@ en-GB: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/en.yml b/config/locales/en.yml index 947a8642f..ef7f17e2f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1121,6 +1121,8 @@ en: label_relations_mapping: Relations mapping label_file_content_preview: File content preview label_create_missing_values: Create missing values + label_position: Position + label_message: Message label_api: API label_field_format_enumeration: Key/value list label_default_values_for_new_users: Default values for new users diff --git a/config/locales/es-PA.yml b/config/locales/es-PA.yml index a3c8c03df..e13baf1f2 100644 --- a/config/locales/es-PA.yml +++ b/config/locales/es-PA.yml @@ -1563,3 +1563,5 @@ es-PA: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/es.yml b/config/locales/es.yml index ff46a4a21..f4abb327d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1599,3 +1599,5 @@ es: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/et.yml b/config/locales/et.yml index d39c6d603..8f3dc3d88 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1537,3 +1537,5 @@ et: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/eu.yml b/config/locales/eu.yml index bc59806d8..cfdba7ad0 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1533,3 +1533,5 @@ eu: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 2b75de439..9e4e58d1e 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -1460,3 +1460,5 @@ fa: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/fi.yml b/config/locales/fi.yml index d8a62af1c..2105ff7ee 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1550,3 +1550,5 @@ fi: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 26aa88ac6..bbbffe200 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1509,3 +1509,5 @@ fr: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 413352c9a..7df031878 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1538,3 +1538,5 @@ gl: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/he.yml b/config/locales/he.yml index f9362290c..d6b575bad 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1537,3 +1537,5 @@ he: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/hr.yml b/config/locales/hr.yml index d024c3a11..23bf9602d 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1529,3 +1529,5 @@ hr: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 6294990b5..79fbe4578 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1521,3 +1521,5 @@ text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/id.yml b/config/locales/id.yml index cf273c65e..8ecb084b2 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1534,3 +1534,5 @@ id: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/it.yml b/config/locales/it.yml index 12d8934b8..b6f34ecbc 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1471,3 +1471,5 @@ it: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2019f4272..9d51f82a9 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1173,6 +1173,8 @@ ja: label_fields_mapping: フィールドの対応関係 label_file_content_preview: ファイル内容のプレビュー label_create_missing_values: 存在しない値は新規作成 + label_position: 位置 + label_message: メッセージ button_import: インポート field_total_estimated_hours: 合計予定工数 label_api: API diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 78ee45897..d811f93e8 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1549,3 +1549,5 @@ ko: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 200f7ae3c..d768b59f0 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1493,3 +1493,5 @@ lt: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 8f4d00a8f..f88bd078a 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1526,3 +1526,5 @@ lv: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/mk.yml b/config/locales/mk.yml index 7e58bcab7..6f69193bf 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -1532,3 +1532,5 @@ mk: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/mn.yml b/config/locales/mn.yml index 38ee6b463..6f6ef7fc2 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -1532,3 +1532,5 @@ mn: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 41d6a894a..d937e44d9 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1507,3 +1507,5 @@ nl: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/no.yml b/config/locales/no.yml index b4b66a860..26c96e893 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1523,3 +1523,5 @@ text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 1ad94fcc3..c5e286563 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1476,3 +1476,5 @@ pl: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 60a1103af..c087d46a2 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1537,3 +1537,5 @@ pt-BR: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 4cd941f41..34825aea7 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1525,3 +1525,5 @@ pt: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 2b98c7ed5..441b672a5 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1527,3 +1527,5 @@ ro: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 1f02f2979..80e442b02 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1601,3 +1601,5 @@ ru: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sk.yml b/config/locales/sk.yml index bd3cd0a13..8852ae029 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1521,3 +1521,5 @@ sk: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sl.yml b/config/locales/sl.yml index e47e355f5..e87a57170 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1532,3 +1532,5 @@ sl: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 73999469c..14c958e65 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1494,3 +1494,5 @@ sq: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index f0d82e9c6..8e31e93db 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -1534,3 +1534,5 @@ sr-YU: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sr.yml b/config/locales/sr.yml index cb47ba239..0c04d39bb 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1533,3 +1533,5 @@ sr: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 18fdbdfa3..ab63dd62b 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1496,3 +1496,5 @@ sv: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/ta-IN.yml b/config/locales/ta-IN.yml index c727a450d..70284cec6 100644 --- a/config/locales/ta-IN.yml +++ b/config/locales/ta-IN.yml @@ -1487,3 +1487,5 @@ ta-IN: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/th.yml b/config/locales/th.yml index e4eb61e5b..8ada77934 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1528,3 +1528,5 @@ th: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 386f6297b..15b00e007 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1531,3 +1531,5 @@ tr: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 290c2edaa..e1e890a44 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1520,3 +1520,5 @@ uk: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/vi.yml b/config/locales/vi.yml index c639f66aa..119c94652 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1536,3 +1536,5 @@ vi: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 8ac665232..6dc0d66b0 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1544,3 +1544,5 @@ text_oauth_info_scopes: 請選擇此應用程式可要求存取的權限範圍。 應用程式僅能執行您在此選擇的權限,無法超越此範圍。 此外,其存取權限也將始終受限於授權使用者的角色與所屬專案成員資格。 + label_position: Position + label_message: Message diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 6008a0fdd..bcde1116d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1468,3 +1468,5 @@ zh: text_oauth_info_scopes: Select the scopes this application may request. The application will not be allowed to do more than what is selected here. It will also always be limited by the roles and project memberships of the user who authorized it. + label_position: Position + label_message: Message diff --git a/lib/plugins/gravatar/lib/gravatar.rb b/lib/plugins/gravatar/lib/gravatar.rb index 316a01b19..43820008f 100644 --- a/lib/plugins/gravatar/lib/gravatar.rb +++ b/lib/plugins/gravatar/lib/gravatar.rb @@ -32,7 +32,7 @@ module GravatarHelper :title => '', # The class to assign to the img tag for the gravatar. - :class => 'gravatar', + :class => 'gravatar avatar', } # The methods that will be made available to your views. diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 523ae3188..d23c40b38 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -731,7 +731,7 @@ module Redmine css_classes = +'' css_classes << ' issue-overdue' if issue.overdue? css_classes << ' issue-behind-schedule' if issue.behind_schedule? - css_classes << ' icon icon-issue' unless Setting.gravatar_enabled? && issue.assigned_to + css_classes << ' icon icon-issue' unless issue.assigned_to css_classes << ' issue-closed' if issue.closed? if issue.start_date && issue.due_before && issue.done_ratio progress_date = calc_progress_date(issue.start_date, @@ -740,8 +740,8 @@ module Redmine css_classes << ' over-end-date' if progress_date > self.date_to && issue.done_ratio > 0 end s = (+"").html_safe - s << view.sprite_icon('issue').html_safe unless Setting.gravatar_enabled? && issue.assigned_to - s << view.assignee_avatar(issue.assigned_to, :size => 13, :class => 'icon-gravatar') + s << view.sprite_icon('issue').html_safe unless issue.assigned_to + s << view.assignee_avatar(issue.assigned_to, :size => 13, :class => 'icon-avatar') s << view.link_to_issue(issue).html_safe s << view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => issue.id, :style => 'display:none;', diff --git a/test/functional/calendars_controller_test.rb b/test/functional/calendars_controller_test.rb index 227919435..202c076ac 100644 --- a/test/functional/calendars_controller_test.rb +++ b/test/functional/calendars_controller_test.rb @@ -57,7 +57,7 @@ class CalendarsControllerTest < Redmine::ControllerTest ) do assert_select 'a.issue[href=?]', '/issues/2', :text => 'Feature request #2' assert_select 'span.tip' do - assert_select 'img[class="gravatar"]' + assert_select 'img[class="gravatar avatar"]' end assert_select 'input[name=?][type=?][value=?]', 'ids[]', 'checkbox', '2' end diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb index daba816b8..73a74ba65 100644 --- a/test/functional/gantts_controller_test.rb +++ b/test/functional/gantts_controller_test.rb @@ -58,7 +58,7 @@ class GanttsControllerTest < Redmine::ControllerTest # Assert context menu on issues subject and gantt bar assert_select 'div[class=?]', 'issue-subject hascontextmenu' assert_select 'div.tooltip.hascontextmenu' do - assert_select 'img[class="gravatar"]' + assert_select 'img[class="gravatar avatar"]' end assert_select "form[data-cm-url=?]", '/issues/context_menu' diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index d19c09f33..4b9b44537 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2816,7 +2816,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'h3', {text: /Watchers \(\d*\)/, count: 0} end - def test_show_should_display_watchers_with_gravatars + def test_show_should_display_watchers_with_avatars @request.session[:user_id] = 2 issue = Issue.find(1) issue.add_watcher User.find(2) @@ -2824,9 +2824,10 @@ class IssuesControllerTest < Redmine::ControllerTest with_settings :gravatar_enabled => '1' do get(:show, :params => {:id => 1}) end + assert_select 'div#watchers ul' do assert_select 'li.user-2' do - assert_select 'img.gravatar[title=?]', 'John Smith' + assert_select '.avatar[title=?]', 'John Smith' assert_select 'a[href="/users/2"]' assert_select 'a[class*=delete]' end @@ -8786,31 +8787,27 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'a[href=?][onclick=?]', "/issues/1", "", :text => 'Cancel' end - def test_show_should_display_author_gravatar_only_when_not_assigned + def test_show_should_display_author_avatar_only_when_not_assigned issue = Issue.find(1) assert_nil issue.assigned_to_id @request.session[:user_id] = 1 - with_settings :gravatar_enabled => '1' do - get :show, :params => {:id => issue.id} - assert_select 'div.gravatar-with-child' do - assert_select 'img.gravatar', 1 - end + get :show, :params => {:id => issue.id} + assert_select 'div.avatar-with-child' do + assert_select '.avatar', 1 end end - def test_show_should_display_author_and_assignee_gravatars_when_assigned + def test_show_should_display_author_and_assignee_avatars_when_assigned issue = Issue.find(1) issue.assigned_to_id = 2 issue.save! @request.session[:user_id] = 1 - with_settings :gravatar_enabled => '1' do - get :show, :params => {:id => issue.id} - assert_select 'div.gravatar-with-child' do - assert_select 'img.gravatar', 2 - assert_select 'img.gravatar-child', 1 - end + get :show, :params => {:id => issue.id} + assert_select 'div.avatar-with-child' do + assert_select '.avatar', 2 + assert_select '.avatar-child', 1 end end diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 997b2263a..cec58ff5f 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -28,7 +28,7 @@ class MessagesControllerTest < Redmine::ControllerTest get(:show, :params => {:board_id => 1, :id => 1}) assert_response :success - assert_select 'h2', :text => 'First post' + assert_select 'h2', :text => "RAFirst post" end def test_show_should_contain_reply_field_tags_for_quoting diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index 536814c9d..686fada25 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -75,7 +75,7 @@ class NewsControllerTest < Redmine::ControllerTest get(:show, :params => {:id => 1}) assert_response :success assert_select 'p.breadcrumb a[href=?]', '/projects/ecookbook/news', :text => 'News' - assert_select 'h2', :text => 'eCookbook first release !' + assert_select 'h2', :text => 'JS eCookbook first release !' end def test_show_should_show_attachments diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 2e2e8b933..1f60bbbe2 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -2053,20 +2053,6 @@ class ApplicationHelperTest < Redmine::HelperTest end end - def test_principals_check_box_tag_without_avatar - principals = [User.find(1), Group.find(10)] - Setting.gravatar_enabled = '1' - avatar_tags = principals.collect{|p| avatar(p, :size => 16)} - - with_settings :gravatar_enabled => '0' do - tags = principals_check_box_tags(name, principals) - principals.each_with_index do |principal, i| - assert_not_include avatar_tags[i], tags - assert_include content_tag('span', principal_icon(principal), :class => "name icon icon-#{principal.class.name.downcase}"), tags - end - end - end - def test_principals_options_for_select_with_users User.current = nil users = [User.find(2), User.find(4)] diff --git a/test/helpers/avatars_helper_test.rb b/test/helpers/avatars_helper_test.rb index baa64a653..6b426bc98 100644 --- a/test/helpers/avatars_helper_test.rb +++ b/test/helpers/avatars_helper_test.rb @@ -63,9 +63,9 @@ class AvatarsHelperTest < Redmine::HelperTest end def test_avatar_css_class - # The default class of the img tag should be gravatar - assert_include 'class="gravatar"', avatar('jsmith <jsmith@somenet.foo>') - assert_include 'class="gravatar picture"', avatar('jsmith <jsmith@somenet.foo>', :class => 'picture') + # The default classes of the img tag should be gravatar and avatar + assert_include 'class="gravatar avatar"', avatar('jsmith <jsmith@somenet.foo>') + assert_include 'class="gravatar avatar picture"', avatar('jsmith <jsmith@somenet.foo>', :class => 'picture') end def test_avatar_with_initials @@ -80,9 +80,9 @@ class AvatarsHelperTest < Redmine::HelperTest end end - def test_avatar_disabled + def test_avatar_disabled_should_display_user_initials with_settings :gravatar_enabled => '0' do - assert_equal '', avatar(User.find_by_mail('jsmith@somenet.foo')) + assert_equal "<span role=\"img\" class=\"avatar-color-2 avatar s24\">JS</span>", avatar(User.find_by_mail('jsmith@somenet.foo')) end end diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb index 23641b53a..4145fb969 100644 --- a/test/integration/api_test/authentication_test.rb +++ b/test/integration/api_test/authentication_test.rb @@ -127,20 +127,23 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base assert_response :unauthorized end + # TODO: check why this test does not use the API endpoint def test_api_should_accept_switch_user_header_for_admin_user user = User.find(1) su = User.find(4) get '/users/current', :headers => {'X-Redmine-API-Key' => user.api_key, 'X-Redmine-Switch-User' => su.login} assert_response :success - assert_select 'h2', :text => su.name + assert_select 'h2', :text => "#{su.initials} #{su.name}" end + # TODO: check why this test does not use the API endpoint def test_api_should_respond_with_412_when_trying_to_switch_to_a_invalid_user get '/users/current', :headers => {'X-Redmine-API-Key' => User.find(1).api_key, 'X-Redmine-Switch-User' => 'foobar'} assert_response :precondition_failed end + # TODO: check why this test does not use the API endpoint def test_api_should_respond_with_412_when_trying_to_switch_to_a_locked_user user = User.find(5) assert user.locked? @@ -149,12 +152,13 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base assert_response :precondition_failed end + # TODO: check why this test does not use the API endpoint def test_api_should_not_accept_switch_user_header_for_non_admin_user user = User.find(2) su = User.find(4) get '/users/current', :headers => {'X-Redmine-API-Key' => user.api_key, 'X-Redmine-Switch-User' => su.login} assert_response :success - assert_select 'h2', :text => user.name + assert_select 'h2', :text => "#{user.initials} #{user.name}" end end |