Merge pull request #10109 from opf/fix/40363-news-avatar-alignment

[40363] Avatars misplaces in team planner dropdown (complete solution)
pull/10170/head
Henriette Darge 3 years ago committed by GitHub
commit d34fed8232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      app/views/homescreen/blocks/_news.html.erb
  2. 2
      frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.html
  3. 4
      frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.sass
  4. 56
      frontend/src/app/shared/components/grids/widgets/news/news.component.html
  5. 7
      frontend/src/global_styles/content/_autocomplete.sass
  6. 1
      frontend/src/global_styles/content/_avatar.sass
  7. 8
      frontend/src/global_styles/content/_news.sass
  8. 1
      frontend/src/global_styles/content/_principal.sass
  9. 44
      frontend/src/global_styles/content/_widget_box.sass

@ -2,20 +2,14 @@
<% unless @news.empty? %> <% unless @news.empty? %>
<ul class="widget-box--arrow-links"> <ul class="widget-box--arrow-links">
<% @news.each do |news| %> <% @news.each do |news| %>
<li class="-widget-box--arrow-multiline"> <li class="widget-box--arrow-multiline">
<div> <%= avatar(news.author, class: 'widget-box--avatar news-author-avatar hidden-for-mobile') %>
<%= avatar(news.author, class: 'news-author-avatar hidden-for-mobile') %> <div class="widget-box--project">
<div class="news--project">
<%= link_to_project(news.project) + ': ' %> <%= link_to_project(news.project) + ': ' %>
<%= link_to h(news.title), news_path(news) %> <%= link_to h(news.title), news_path(news) %>
</div> </div>
<div class="news-author"> <div class="widget-box--author news-author"><%= authoring_at Date.strptime(news.created_at.to_s), news.author %></div>
<span><%= authoring_at Date.strptime(news.created_at.to_s), news.author %></span>
</div>
<div>
<p class="widget-box--additional-info"><%= news.summary %></p> <p class="widget-box--additional-info"><%= news.summary %></p>
</div>
</div>
</li> </li>
<% end %> <% end %>
</ul> </ul>

@ -170,7 +170,7 @@
class="op-autocompleter--option-principal-avatar" class="op-autocompleter--option-principal-avatar"
size="mini" size="mini"
></op-principal> ></op-principal>
<span [ngOptionHighlight]="search">{{ item.name }}</span> <span [ngOptionHighlight]="search" class="ellipsis">{{ item.name }}</span>
</div> </div>
</ng-container> </ng-container>

@ -52,6 +52,4 @@
&--option-principal &--option-principal
&-wrapper &-wrapper
display: flex display: flex
overflow: hidden
&-avatar
margin-right: 5px

@ -1,5 +1,7 @@
<widget-header [name]="widgetName" <widget-header
[editable]="isEditable"> [name]="widgetName"
[editable]="isEditable"
>
<widget-menu <widget-menu
slot="menu" slot="menu"
@ -8,37 +10,41 @@
</widget-header> </widget-header>
<div class="grid--widget-content"> <div class="grid--widget-content">
<no-results *ngIf="noEntries" <no-results
[title]="text.noResults"> *ngIf="noEntries"
</no-results> [title]="text.noResults"
></no-results>
<ul class="widget-box--arrow-links"> <ul class="widget-box--arrow-links">
<li class="-widget-box--arrow-multiline" <li
*ngFor="let news of entries"> class="widget-box--arrow-multiline"
<div> *ngFor="let news of entries"
>
<op-principal <op-principal
*ngIf="news.author" *ngIf="news.author"
[principal]="news.author" [principal]="news.author"
[hideName]="true" [hideName]="true"
class="news-author-avatar hidden-for-mobile" class="widget-box--avatar news-author-avatar hidden-for-mobile"
></op-principal> ></op-principal>
<div class="news--project"> <div class="widget-box--project">
<a [href]="newsProjectPath(news)" <a
[textContent]="newsProjectName(news)"> [href]="newsProjectPath(news)"
</a>: [textContent]="newsProjectName(news)"
<a [href]="newsPath(news)" ></a>:
[textContent]="news.title"> <a
</a> [href]="newsPath(news)"
[textContent]="news.title"
></a>
</div> </div>
<div *ngIf="news.author" <div
class="news-author"> *ngIf="news.author"
<span [innerHTML]="text.addedBy(news)"></span> class="widget-box--author news-author"
</div> [innerHTML]="text.addedBy(news)"
<div> ></div>
<p *ngIf="news.summary" <p
*ngIf="news.summary"
[textContent]="news.summary" [textContent]="news.summary"
class="widget-box--additional-info"></p> class="widget-box--additional-info"
</div> ></p>
</div>
</li> </li>
</ul> </ul>
</div> </div>

@ -183,9 +183,16 @@ mark.ui-autocomplete-match
.ng-dropdown-panel .ng-dropdown-panel
z-index: 9500 !important z-index: 9500 !important
.ng-option-label
vertical-align: top
.ng-option .ng-option
font-size: 14px font-size: 14px
line-height: 22px line-height: 22px
.op-avatar
margin-right: 8px
.work-package-table--container .ng-dropdown-panel .work-package-table--container .ng-dropdown-panel
z-index: auto !important z-index: auto !important

@ -24,7 +24,6 @@
width: var(--user-avatar-mini-width) width: var(--user-avatar-mini-width)
min-width: var(--user-avatar-mini-width) min-width: var(--user-avatar-mini-width)
height: var(--user-avatar-mini-height) height: var(--user-avatar-mini-height)
margin-right: 10px -5px
line-height: var(--user-avatar-mini-height) line-height: var(--user-avatar-mini-height)
font-size: 10px font-size: 10px

@ -40,17 +40,13 @@
font-size: 0.8rem font-size: 0.8rem
color: var(--gray-dark) color: var(--gray-dark)
display: block display: block
padding: 5px 0 5px 40px
line-height: 1.25 line-height: 1.25
.news-author-avatar .news-author-avatar
line-height: 1 line-height: 1
.op-avatar
margin-right: 5px
float: left
.news--project .op-avatar
display: inline margin-right: 10px
@media screen and (max-width: 679px) @media screen and (max-width: 679px)
.news-author .news-author

@ -1,6 +1,7 @@
.op-principal .op-principal
display: inline-flex display: inline-flex
align-items: center align-items: center
vertical-align: middle
&--avatar &--avatar
flex-grow: 0 flex-grow: 0

@ -133,13 +133,9 @@ $widget-box--enumeration-width: 20px
text-transform: uppercase text-transform: uppercase
font-weight: bold font-weight: bold
.widget-box--additional-info
font-style: italic
margin-bottom: 0.5rem
.widget-box--arrow-links .widget-box--arrow-links
list-style: none list-style: none
margin: 0.5rem 0 1rem 20px margin: 0.5rem 0 1rem 0
&:last-child &:last-child
margin-bottom: 0 margin-bottom: 0
@ -152,24 +148,36 @@ $widget-box--enumeration-width: 20px
font-size: 0.6rem font-size: 0.6rem
color: var(--content-icon-link-color) color: var(--content-icon-link-color)
width: $widget-box--enumeration-width width: $widget-box--enumeration-width
margin-left: -20px
.-widget-box--arrow-multiline .widget-box--arrow-multiline
display: grid
grid-template-columns: auto auto 1fr
grid-template-rows: auto auto auto
margin-bottom: 10px
&:before &:before
line-height: 2 grid-column: 1/2
float: left grid-row: 1/3
align-self: center
justify-self: center
&:after .widget-box--avatar
clear: both grid-column: 2/3
content: "" grid-row: 1/3
display: table
> div .widget-box--project
float: left grid-column: 3/4
margin-bottom: 10px grid-row: 1/2
//necessary for correct alignment even with long texts
width: calc(100% - #{$widget-box--enumeration-width}) .widget-box--author
grid-column: 3/4
grid-row: 2/3
.widget-box--additional-info
grid-column: 2/4
grid-row: 3/4
font-style: italic
margin-bottom: 0.5rem
@include breakpoint(680px down) @include breakpoint(680px down)
.widget-boxes .widget-boxes

Loading…
Cancel
Save