From 2499ee905882c6332e7ea527d35889e8ee7a5324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 14 Feb 2019 08:54:35 +0100 Subject: [PATCH] UI improvements for motion detail/list view --- .../motions/motion-repository.service.ts | 20 ++++---- .../motion-block-detail.component.scss | 2 - .../motion-detail.component.html | 36 +++++++------- .../motion-detail.component.scss | 7 ++- .../motion-list/motion-list.component.html | 49 ++++++++++--------- .../motion-list/motion-list.component.scss | 43 +++++++--------- client/src/styles.scss | 12 ++++- 7 files changed, 86 insertions(+), 83 deletions(-) diff --git a/client/src/app/core/repositories/motions/motion-repository.service.ts b/client/src/app/core/repositories/motions/motion-repository.service.ts index 158b8626d..200dd174c 100644 --- a/client/src/app/core/repositories/motions/motion-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-repository.service.ts @@ -853,7 +853,7 @@ export class MotionRepositoryService extends BaseRepository /** * Get the label for the motion's current state with the extension - * attached (if present). For cross-referencing other motions, `[motion:id]` + * attached (if available). For cross-referencing other motions, `[motion:id]` * will replaced by the referenced motion's identifier (see {@link solveExtensionPlaceHolder}) * * @param motion @@ -872,21 +872,19 @@ export class MotionRepositoryService extends BaseRepository /** * Get the label for the motion's current recommendation with the extension - * attached (if present) + * attached (if available) * * @param motion - * @returns the translated extension with the extension attached, 'not set' - * if no recommendation si set + * @returns the translated extension with the extension attached */ public getExtendedRecommendationLabel(motion: ViewMotion): string { - if (!motion.recommendation) { - return this.translate.instant('not set'); + if (motion.recommendation) { + let rec = this.translate.instant(motion.recommendation.recommendation_label); + if (motion.recommendationExtension && motion.recommendation.show_recommendation_extension_field) { + rec += ' ' + this.solveExtensionPlaceHolder(motion.recommendationExtension); + } + return rec; } - let rec = this.translate.instant(motion.recommendation.recommendation_label); - if (motion.recommendationExtension && motion.recommendation.show_recommendation_extension_field) { - rec += ' ' + this.solveExtensionPlaceHolder(motion.recommendationExtension); - } - return rec; } /** diff --git a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.scss b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.scss index 2d4194ec0..9a8150135 100644 --- a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.scss +++ b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.scss @@ -24,8 +24,6 @@ .chip-container { display: block; - height: 5em; - line-height: 5em; } .os-headed-listview-table { diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html index 1473e6cd7..e516406e1 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html @@ -184,7 +184,7 @@ -

- - {{ supporter.full_name }} - +

+ + {{ supporter.full_name }}, +

@@ -251,7 +251,7 @@
-

{{ recommender }}

+

{{ recommender }}

@@ -311,7 +311,7 @@
-

Category

+

Category

@@ -373,7 +373,7 @@
-

Motion block

+

Motion block

diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.scss b/client/src/app/site/motions/components/motion-detail/motion-detail.component.scss index cd61dee08..f36434e0e 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.scss +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.scss @@ -299,6 +299,11 @@ span { .mat-chip-list-stacked { .mat-chip { - margin: 4px 4px 4px 8px; + margin: 4px 4px 4px 4px; } } + +.supporters { + font-size: 12px; + margin-top: 4px; +} diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.html b/client/src/app/site/motions/components/motion-list/motion-list.component.html index 44be33c73..4c975c6af 100644 --- a/client/src/app/site/motions/components/motion-list/motion-list.component.html +++ b/client/src/app/site/motions/components/motion-list/motion-list.component.html @@ -58,7 +58,7 @@
-
+
star @@ -73,31 +73,32 @@
-
- - by {{ motion.submitters }} - +
+ by {{ motion.submitters }}
- - +
+ + {{ getStateLabel(motion) }} + +
+ +
- {{ getStateLabel(motion) }} - - - - {{ getRecommendationLabel(motion) }} - +
@@ -106,12 +107,12 @@ State -
-
+
+
device_hub {{ motion.category }}
-
+
widgets {{ motion.motion_block.title }}
diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.scss b/client/src/app/site/motions/components/motion-list/motion-list.component.scss index f116433ba..a6848d5d9 100644 --- a/client/src/app/site/motions/components/motion-list/motion-list.component.scss +++ b/client/src/app/site/motions/components/motion-list/motion-list.component.scss @@ -22,47 +22,40 @@ display: block; padding-left: 10px; - .motion-list { - display: flex; - padding-right: 20px; + .title-line { + font-weight: 500; + font-size: 16px; - .motion-list-title, - .motion-list-from { - flex: 2; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - .motion-list-title { - font-weight: 500; - font-size: 16px; + .attached-files { + .mat-icon { + display: inline-flex; + vertical-align: middle; + $icon-size: 16px; + font-size: $icon-size; + height: $icon-size; + width: $icon-size; + } } + .favorite-star { padding-right: 3px; } } - .motion-list-from { + .submitters-line { color: rgba(0, 0, 0, 0.5); font-size: 90%; } - - .attached-files { - .mat-icon { - display: inline-flex; - vertical-align: middle; - $icon-size: 16px; - font-size: $icon-size; - height: $icon-size; - width: $icon-size; - } - } } /** State */ .mat-column-state { flex: 0 0 160px; + .state-column { + width: 160px; + } + mat-icon { font-size: 150%; } diff --git a/client/src/styles.scss b/client/src/styles.scss index 6e4ea4dff..589465127 100644 --- a/client/src/styles.scss +++ b/client/src/styles.scss @@ -193,10 +193,11 @@ mat-card { /** size of the mat row */ mat-row { - height: 60px; + min-height: 60px; } mat-row.lg { - height: 90px; + height: 110px; + min-height: 90px; } mat-row:hover { cursor: pointer; @@ -346,6 +347,7 @@ mat-expansion-panel { border-radius: 5px !important; padding: 4px 8px !important; margin: 8px 8px 8px 0; + line-height: 2; } .mat-chip-list.user .mat-chip { @@ -645,4 +647,10 @@ button.mat-menu-item.selected { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + padding-right: 3px; + margin-right: 3px; +} + +.white { + color: white; }