From 8536f46d0185eef8766b3f775ffc01e0d3dba335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 17 Jan 2019 14:07:54 +0100 Subject: [PATCH] UI improvements - better select field for category and block in motion detail - improved motion block views - chips for submitters - motion detail template --- .../head-bar/head-bar.component.html | 8 +- .../sorting-list/sorting-list.component.scss | 4 - .../agenda-list/agenda-list.component.ts | 2 - .../category-list.component.html | 2 +- .../manage-submitters.component.html | 65 ++++++----- .../meta-text-block.component.html | 42 ++----- .../meta-text-block.component.scss | 2 +- .../motion-block-detail.component.html | 36 +++--- .../motion-block-list.component.html | 30 ++++- .../motion-block-list.component.scss | 13 ++- .../motion-block-list.component.ts | 24 +++- .../motion-detail.component.html | 107 ++++++++---------- .../motion-detail.component.scss | 1 - .../motion-detail/motion-detail.component.ts | 12 +- client/src/app/site/site.component.ts | 6 +- client/src/styles.scss | 49 +++++++- 16 files changed, 232 insertions(+), 171 deletions(-) diff --git a/client/src/app/shared/components/head-bar/head-bar.component.html b/client/src/app/shared/components/head-bar/head-bar.component.html index 1beefef7d..1b18b62aa 100644 --- a/client/src/app/shared/components/head-bar/head-bar.component.html +++ b/client/src/app/shared/components/head-bar/head-bar.component.html @@ -1,4 +1,9 @@ - + + + +
@@ -63,7 +68,6 @@ edit - diff --git a/client/src/app/shared/components/sorting-list/sorting-list.component.scss b/client/src/app/shared/components/sorting-list/sorting-list.component.scss index f022bfb1c..b05c67942 100644 --- a/client/src/app/shared/components/sorting-list/sorting-list.component.scss +++ b/client/src/app/shared/components/sorting-list/sorting-list.component.scss @@ -1,9 +1,6 @@ .list { width: 100%; - border: solid 1px #ccc; display: block; - background: white; // TODO theme - border-radius: 4px; overflow: hidden; } @@ -11,7 +8,6 @@ width: 100%; border-bottom: solid 1px #ccc; color: rgba(0, 0, 0, 0.87); - background: white; // TODO theme font-size: 14px; } diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts index 59ae4b408..85fea6064 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts @@ -51,8 +51,6 @@ export class AgendaListComponent extends ListViewBaseComponent impleme * @param vp determine the viewport * @param durationService Converts numbers to readable duration strings * @param csvExport Handles the exporting into csv - * @param repo the agenda repository - * @param promptService * @param filterService: service for filtering data */ public constructor( diff --git a/client/src/app/site/motions/components/category-list/category-list.component.html b/client/src/app/site/motions/components/category-list/category-list.component.html index c66681fcf..0d9ebea9a 100644 --- a/client/src/app/site/motions/components/category-list/category-list.component.html +++ b/client/src/app/site/motions/components/category-list/category-list.component.html @@ -42,7 +42,7 @@ - + diff --git a/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.html b/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.html index 6f25ee8ad..40742d722 100644 --- a/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.html +++ b/client/src/app/site/motions/components/manage-submitters/manage-submitters.component.html @@ -6,41 +6,40 @@
- + {{ submitter.full_name }}
-
- -
- -
- - - - - - - - - - -
+
+ + + + + + + +
+ +
+ +

+ + +

diff --git a/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.html b/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.html index 2cd2a7bba..9c730a763 100644 --- a/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.html +++ b/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.html @@ -1,34 +1,4 @@ - - - - - - - - - - - - - - - - - {{ icon }} - - - - - - - - - - - - - - +
@@ -47,4 +17,14 @@ +
+ + + + + + + + + diff --git a/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.scss b/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.scss index 93591e953..964c42927 100644 --- a/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.scss +++ b/client/src/app/site/motions/components/meta-text-block/meta-text-block.component.scss @@ -1,6 +1,6 @@ .meta-text-block { padding: 0px; - margin: 20px 10px 20px 0; + margin: 20px 0; min-width: 200px; mat-card-header { diff --git a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html index 24c78fe82..c556c4897 100644 --- a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html +++ b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html @@ -1,14 +1,10 @@ - + + + +
-

{{ 'Motion block' | translate }} {{ block.id }}

+

{{ block.title }}

@@ -24,21 +20,23 @@
+ + + +
+ +
+ +
- -
-

{{ block.title }}

-

{{ blockEditForm.get('title').value }}

-
- - + + + + +
+ diff --git a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.scss b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.scss index 628d20945..ffd15ed98 100644 --- a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.scss +++ b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.scss @@ -1,11 +1,20 @@ .os-headed-listview-table { // Title .mat-column-title { - flex: 3 0 0; + flex: 9 0 0; } // Amount .mat-column-amount { - flex: 1 0 0; + flex: 1 0 60px; + } + + // Menu + .mat-column-menu { + flex: 0 0 40px; } } + +::ng-deep .mat-form-field { + width: 50%; +} diff --git a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts index e466f3690..bf2b7cb46 100644 --- a/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts +++ b/client/src/app/site/motions/components/motion-block-list/motion-block-list.component.ts @@ -14,6 +14,7 @@ import { DataStoreService } from 'app/core/services/data-store.service'; import { MotionBlockRepositoryService } from '../../services/motion-block-repository.service'; import { ViewMotionBlock } from '../../models/view-motion-block'; import { AgendaRepositoryService } from 'app/site/agenda/services/agenda-repository.service'; +import { PromptService } from '../../../../core/services/prompt.service'; /** * Table for the motion blocks @@ -53,7 +54,7 @@ export class MotionBlockListComponent extends ListViewBaseComponent { + newMotionblocks.sort((a, b) => (a > b ? 1 : -1)); this.dataSource.data = newMotionblocks; }); @@ -110,7 +114,7 @@ export class MotionBlockListComponent extends ListViewBaseComponent { + const content = this.translate.instant('Are you sure you want to delete this motion block?'); + if (await this.promptService.open(motionBlock.title, content)) { + await this.repo.delete(motionBlock); + } + } + /** * Helper function reset the form and set the default values */ 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 bafcad2f5..1e47a8298 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 @@ -60,23 +60,23 @@
+ - + - + - + - + +
+ +
+
+

+ {{ motion.title }} +

+ +
+ Sequential number {{ motion.id }}
- Sequential number {{ motion.id }} + +
- - - - - - - - info - Meta information - - - -
- -
-
+ +
+ +
- - - - - format_align_left - Content - - + -
- -
-
+ +
+ +
- - - - -
+ + + + + + + + + + +
@@ -287,7 +279,7 @@ -
+

Category

- - {{ motion.category ? motion.category : ('not set' | translate) }} + {{ motion.category ? motion.category : '–' }}
-
+

Motion block

- - - {{ motion.motion_block ? motion.motion_block : ('not set' | translate) }} + {{ motion.motion_block ? motion.motion_block : '–' }}
@@ -326,7 +317,7 @@
-
+
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 6f9c0286a..adcf174f3 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 @@ -107,7 +107,6 @@ span { .desktop-left { width: 30%; float: left; - padding-left: 65px; padding-right: 25px; } diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts index af67aefda..c8fa1474f 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts @@ -923,7 +923,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit { * @param id Motion category id */ public setCategory(id: number): void { - this.repo.setCatetory(this.motion, id); + if (id === this.motion.category_id) { + this.repo.setCatetory(this.motion, null); + } else { + this.repo.setCatetory(this.motion, id); + } } /** @@ -932,7 +936,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit { * @param id Motion block id */ public setBlock(id: number): void { - this.repo.setBlock(this.motion, id); + if (id === this.motion.motion_block_id) { + this.repo.setBlock(this.motion, null); + } else { + this.repo.setBlock(this.motion, id); + } } /** diff --git a/client/src/app/site/site.component.ts b/client/src/app/site/site.component.ts index 8547a02b0..89b14aed8 100644 --- a/client/src/app/site/site.component.ts +++ b/client/src/app/site/site.component.ts @@ -114,12 +114,10 @@ export class SiteComponent extends BaseComponent implements OnInit { } /** - * Closes the sidenav in mobile view + * Closes the sidenav */ public toggleSideNav(): void { - if (this.vp.isMobile) { - this.sideNav.toggle(); - } + this.sideNav.toggle(); } /** diff --git a/client/src/styles.scss b/client/src/styles.scss index e3cba2ba1..1f0d7f811 100644 --- a/client/src/styles.scss +++ b/client/src/styles.scss @@ -318,6 +318,13 @@ mat-panel-title mat-icon { margin: 8px 8px 8px 0; } +.mat-chip-list.user .mat-chip { + border-radius: 16px !important; + padding: 15px !important; + border: solid 1px lightgray; + background: #fff; +} + // to display quantities. Use in span or div .os-amount-chip { border-radius: 50%; @@ -338,6 +345,10 @@ button.mat-menu-item.selected { font-weight: bold !important; } +.mat-menu-item .mat-icon { + margin-right: 8px !important; +} + .meta-text-block .mat-icon-button { margin-top: -12px !important; } @@ -347,13 +358,16 @@ button.mat-menu-item.selected { /** helper classes for margin/padding */ .spacer-top-10 { - margin-top: 10px; + margin-top: 10px !important; } .spacer-top-20 { - margin-top: 20px; + margin-top: 20px !important; +} +.spacer-bottom-10 { + margin-bottom: 10px !important; } .spacer-bottom-20 { - margin-bottom: 20px; + margin-bottom: 20px !important; } .button24 { background-color: white; @@ -378,8 +392,7 @@ button.mat-menu-item.selected { line-height: 24px; } } -.title-left { - padding-left: 65px; +.title { padding-top: 20px; padding-bottom: 20px; } @@ -387,6 +400,32 @@ button.mat-menu-item.selected { padding-right: 20px; } +.content-container { + margin: 0 65px; +} + +/** media queries */ + +/* medium */ +@media only screen and (min-width: 500px) and (max-width: 960px) { + .content-container { + margin: 0 25px; + } + .content-container h1 { + font-size: 30px + } +} +/* small */ +@media only screen and (max-width: 500px) { + .content-container { + margin: 0 15px; + } + .content-container h1 { + font-size: 30px + } +} + + /** more helper classes **/ .center { text-align: center;