Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

improve news widget styles

bsatarnejad7db261497387
diff --git a/app/assets/stylesheets/content/_news.sass b/app/assets/stylesheets/content/_news.sass
index 3548cddc0a8..b2508171652 100644
--- a/app/assets/stylesheets/content/_news.sass
+++ b/app/assets/stylesheets/content/_news.sass
@@ -35,3 +35,17 @@
.summary
font-style: italic
+
+.author
+ font-size: 0.8rem
+ color: #777777
+ display: block
+ margin-top: -7px
+
+.author-avatar
+ margin: -2px 10px 0 0
+ float: left
+
+.title
+ font-weight: bold
+ margin-top: 2px
diff --git a/app/views/homescreen/blocks/_news.html.erb b/app/views/homescreen/blocks/_news.html.erb
index c7c665163f3..dcb400204f2 100644
--- a/app/views/homescreen/blocks/_news.html.erb
+++ b/app/views/homescreen/blocks/_news.html.erb
@@ -1,15 +1,14 @@
<%= render 'homescreen/blocks/header', title: t(:label_news_latest) %>
-
<% unless @news.empty? %>
<ul class="widget-box--arrow-links">
<% @news.each do |news| %>
<li class="-widget-box--arrow-multiline">
<div>
- <%= avatar(news.author, {class: 'avatar-mini'}) %>
+ <%= avatar(news.author, {class: 'avatar author-avatar'}) %>
<%= link_to_project(news.project) + ': ' %>
<%= link_to h(news.title), news_path(news) %>
- <br/>
- <span class="additional-information"><%= authoring news.created_at, news.author %></span>
+ <div class="author"> <span><%= authoring news.created_at, news.author %></span> </div>
+ <div> <span class="additional-information"><%= news.summary %></span></div>
</div>
</li>
<% end %>
diff --git a/frontend/src/app/modules/grids/widgets/news/news.component.html b/frontend/src/app/modules/grids/widgets/news/news.component.html
index 48ea7e6e854..103b2103b75 100644
--- a/frontend/src/app/modules/grids/widgets/news/news.component.html
+++ b/frontend/src/app/modules/grids/widgets/news/news.component.html
@@ -2,31 +2,26 @@
<widget-menu [resource]="resource">
</widget-menu>
-
+
</widget-header>
<div class="grid--widget-content">
<no-results *ngIf="noEntries" [title]="text.noResults">
</no-results>
+
<ul class="widget-box--arrow-links">
<li class="-widget-box--arrow-multiline" *ngFor="let news of entries">
<div>
- <user-avatar *ngIf="news.author" [user]="news.author" data-class-list="avatar avatar-medium -spaced">
+ <user-avatar *ngIf="news.author" [user]="news.author" data-class-list="avatar" class="author-avatar">
</user-avatar>
- <a [href]="newsProjectPath(news)" [textContent]="newsProjectName(news)">
- </a>:
- <a [href]="newsPath(news)" [textContent]="news.title">
- </a>
-
- <p *ngIf="news.summary" [textContent]="news.summary" class="widget-box--additional-info"></p>
-
- <p *ngIf="news.author"
- class="widget-box--additional-info">
- {{text.createdBy}}
- <a [href]="newsAuthorPath(news)" [textContent]="newsAuthorName(news)">
- </a>
- {{text.at}}
- {{newsCreated(news)}}
- </p>
+ <div class="title"><a [href]="newsProjectPath(news)" [textContent]="newsProjectName(news)">
+ </a>: <a [href]="newsPath(news)" [textContent]="news.title"> </a></div>
+ <div *ngIf="news.author" class="author"><span>{{text.createdBy}} </span>
+ <a [href]="newsAuthorPath(news)" [textContent]="newsAuthorName(news)"> </a>
+ <span> {{text.at}} {{newsCreated(news)}}</span>
+ </div>
+ <div>
+ <p *ngIf="news.summary" [textContent]="news.summary" class="widget-box--additional-info"></p>
+ </div>
</div>
</li>
</ul>