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 7d26f7ec2..cd077f0da 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 @@ -32,7 +32,7 @@ @@ -47,5 +47,5 @@ diff --git a/client/src/app/shared/components/head-bar/head-bar.component.ts b/client/src/app/shared/components/head-bar/head-bar.component.ts index e55e7b42d..a7309cd33 100644 --- a/client/src/app/shared/components/head-bar/head-bar.component.ts +++ b/client/src/app/shared/components/head-bar/head-bar.component.ts @@ -10,9 +10,6 @@ import { MainMenuService } from '../../../core/services/main-menu.service'; * * Will translate the title automatically. * - * Use `PlusButton=true` and `(plusButtonClicked)=myFunction()` if a plus button is needed - * - * * ## Examples: * * ### Usage of the selector: @@ -21,7 +18,7 @@ import { MainMenuService } from '../../../core/services/main-menu.service'; * @@ -56,7 +53,7 @@ export class HeadBarComponent { * Custom icon if necessary */ @Input() - public buttonIcon = 'add'; + public mainButtonIcon = 'add'; /** * Determine edit mode diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.html b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.html index ab94d13e9..32842f73b 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.html +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.html @@ -5,19 +5,19 @@ - + - Topic - {{item.getListTitle()}} + Topic + {{ item.getListTitle() }} - Duration - {{item.duration}} + Duration + {{ item.duration }} - + diff --git a/client/src/app/site/agenda/components/speaker-list/speaker-list.component.html b/client/src/app/site/agenda/components/speaker-list/speaker-list.component.html index 2c78480ef..4ace6260d 100644 --- a/client/src/app/site/agenda/components/speaker-list/speaker-list.component.html +++ b/client/src/app/site/agenda/components/speaker-list/speaker-list.component.html @@ -25,12 +25,8 @@  ( Start time : {{ speaker.begin_time }}) - @@ -42,12 +38,8 @@ play_arrow {{ activeSpeaker }} - @@ -61,17 +53,13 @@
- + mic Start - + {{ item.marked ? 'star' : 'star_border' }} diff --git a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html index e6ede53a2..0a9438a2d 100644 --- a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html +++ b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html @@ -1,10 +1,5 @@ - +

@@ -47,21 +42,15 @@
- + A name is required
- +
diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.html b/client/src/app/site/assignments/assignment-list/assignment-list.component.html index 5cf3a731c..a6e6810d3 100644 --- a/client/src/app/site/assignments/assignment-list/assignment-list.component.html +++ b/client/src/app/site/assignments/assignment-list/assignment-list.component.html @@ -12,31 +12,31 @@

- + - Title - {{assignment.getTitle()}} + Title + {{ assignment.getTitle() }} - Phase + Phase - {{assignment.phase}} + {{ assignment.phase }} - Candidates + Candidates - {{assignment.candidateAmount}} + {{ assignment.candidateAmount }} - + diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.css b/client/src/app/site/assignments/assignment-list/assignment-list.component.scss similarity index 100% rename from client/src/app/site/assignments/assignment-list/assignment-list.component.css rename to client/src/app/site/assignments/assignment-list/assignment-list.component.scss diff --git a/client/src/app/site/assignments/assignment-list/assignment-list.component.ts b/client/src/app/site/assignments/assignment-list/assignment-list.component.ts index 90cfbd965..5db9e9dad 100644 --- a/client/src/app/site/assignments/assignment-list/assignment-list.component.ts +++ b/client/src/app/site/assignments/assignment-list/assignment-list.component.ts @@ -13,7 +13,7 @@ import { MatSnackBar } from '@angular/material'; @Component({ selector: 'os-assignment-list', templateUrl: './assignment-list.component.html', - styleUrls: ['./assignment-list.component.css'] + styleUrls: ['./assignment-list.component.scss'] }) export class AssignmentListComponent extends ListViewBaseComponent implements OnInit { /** diff --git a/client/src/app/site/common/components/start/start.component.html b/client/src/app/site/common/components/start/start.component.html index 6574489ec..98c76224e 100644 --- a/client/src/app/site/common/components/start/start.component.html +++ b/client/src/app/site/common/components/start/start.component.html @@ -6,7 +6,6 @@
-

{{welcomeTitle | translate}}

{{welcomeText | translate}} diff --git a/client/src/app/site/config/components/config-field/config-field.component.html b/client/src/app/site/config/components/config-field/config-field.component.html index f175e7a6a..662b69ebb 100644 --- a/client/src/app/site/config/components/config-field/config-field.component.html +++ b/client/src/app/site/config/components/config-field/config-field.component.html @@ -1,6 +1,5 @@ - @@ -50,9 +49,9 @@ - +
{{ configItem.label | translate }} diff --git a/client/src/app/site/login/components/login-legal-notice/login-legal-notice.component.html b/client/src/app/site/login/components/login-legal-notice/login-legal-notice.component.html index a25337024..b279b0913 100644 --- a/client/src/app/site/login/components/login-legal-notice/login-legal-notice.component.html +++ b/client/src/app/site/login/components/login-legal-notice/login-legal-notice.component.html @@ -1,5 +1,4 @@
-

Legal notice

diff --git a/client/src/app/site/login/components/login-mask/login-mask.component.html b/client/src/app/site/login/components/login-mask/login-mask.component.html index 22813cc93..67719f14c 100644 --- a/client/src/app/site/login/components/login-mask/login-mask.component.html +++ b/client/src/app/site/login/components/login-mask/login-mask.component.html @@ -2,7 +2,8 @@
diff --git a/client/src/app/site/login/components/login-privacy-policy/login-privacy-policy.component.html b/client/src/app/site/login/components/login-privacy-policy/login-privacy-policy.component.html index 9f2be700c..f284f7338 100644 --- a/client/src/app/site/login/components/login-privacy-policy/login-privacy-policy.component.html +++ b/client/src/app/site/login/components/login-privacy-policy/login-privacy-policy.component.html @@ -1,5 +1,4 @@
-

Privacy Policy

diff --git a/client/src/app/site/login/components/login-wrapper/login-wrapper.component.html b/client/src/app/site/login/components/login-wrapper/login-wrapper.component.html index 29826247f..4da6fcac8 100644 --- a/client/src/app/site/login/components/login-wrapper/login-wrapper.component.html +++ b/client/src/app/site/login/components/login-wrapper/login-wrapper.component.html @@ -1,7 +1,7 @@
diff --git a/client/src/app/site/login/components/reset-password-confirm/reset-password-confirm.component.html b/client/src/app/site/login/components/reset-password-confirm/reset-password-confirm.component.html index b496b6f3b..6c6f68539 100644 --- a/client/src/app/site/login/components/reset-password-confirm/reset-password-confirm.component.html +++ b/client/src/app/site/login/components/reset-password-confirm/reset-password-confirm.component.html @@ -8,7 +8,7 @@
- diff --git a/client/src/app/site/login/components/reset-password/reset-password.component.html b/client/src/app/site/login/components/reset-password/reset-password.component.html index a6015db63..0e2e37f7a 100644 --- a/client/src/app/site/login/components/reset-password/reset-password.component.html +++ b/client/src/app/site/login/components/reset-password/reset-password.component.html @@ -8,7 +8,7 @@
- diff --git a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html index 2a8eb904b..c3879947b 100644 --- a/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html +++ b/client/src/app/site/mediafiles/mediafile-list/mediafile-list.component.html @@ -12,25 +12,26 @@
- + - Name - {{file.title}} + Name + {{ file.title }} - Group - - {{file.type}} + Group + + {{ file.type }}
- {{file.size}} + {{ file.size }}
+ - Download + Download save_alt @@ -43,7 +44,7 @@ - diff --git a/client/src/app/site/motions/components/call-list/cal-list.component.spec.ts b/client/src/app/site/motions/components/call-list/cal-list.component.spec.ts new file mode 100644 index 000000000..0fa3f483d --- /dev/null +++ b/client/src/app/site/motions/components/call-list/cal-list.component.spec.ts @@ -0,0 +1,26 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallListComponent } from './call-list.component'; +import { E2EImportsModule } from 'e2e-imports.module'; + +describe('CallListComponent', () => { + let component: CallListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [E2EImportsModule], + declarations: [CallListComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CallListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/client/src/app/site/motions/components/call-list/call-list.component.html b/client/src/app/site/motions/components/call-list/call-list.component.html new file mode 100644 index 000000000..78c2fbf9d --- /dev/null +++ b/client/src/app/site/motions/components/call-list/call-list.component.html @@ -0,0 +1,17 @@ + + +
+

Call list

+
+ + +
+ + + + + diff --git a/client/src/app/site/motions/components/call-list/call-list.component.ts b/client/src/app/site/motions/components/call-list/call-list.component.ts new file mode 100644 index 000000000..1c79fdd7a --- /dev/null +++ b/client/src/app/site/motions/components/call-list/call-list.component.ts @@ -0,0 +1,68 @@ +import { Component, ViewChild } from '@angular/core'; +import { Title } from '@angular/platform-browser'; + +import { TranslateService } from '@ngx-translate/core'; + +import { BaseViewComponent } from '../../../base/base-view'; +import { MatSnackBar } from '@angular/material'; +import { MotionRepositoryService } from '../../services/motion-repository.service'; +import { ViewMotion } from '../../models/view-motion'; +import { SortingListComponent } from '../../../../shared/components/sorting-list/sorting-list.component'; +import { Router, ActivatedRoute } from '@angular/router'; + +/** + * Sort view for the call list. + */ +@Component({ + selector: 'os-call-list', + templateUrl: './call-list.component.html' +}) +export class CallListComponent extends BaseViewComponent { + /** + * All motions sorted first by weight, then by id. + */ + public motions: ViewMotion[]; + + /** + * The sort component + */ + @ViewChild('sorter') + public sorter: SortingListComponent; + + /** + * Updates the motions member, and sorts it. + * @param title + * @param translate + * @param matSnackBar + * @param motionRepo + */ + public constructor( + title: Title, + translate: TranslateService, + matSnackBar: MatSnackBar, + private motionRepo: MotionRepositoryService, + private router: Router, + private route: ActivatedRoute + ) { + super(title, translate, matSnackBar); + + this.motionRepo.getViewModelListObservable().subscribe(motions => { + this.motions = motions.sort((a, b) => { + if (a.weight !== b.weight) { + return a.weight - b.weight; + } else { + return a.id - b.id; + } + }); + }); + } + + /** + * Saves the new motion order to the server. + */ + public save(): void { + this.motionRepo.sortMotions(this.sorter.array.map(s => ({ id: s.id }))).then(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }, this.raiseError); + } +} diff --git a/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.html b/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.html index d3268a073..04a6b2cfc 100644 --- a/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.html +++ b/client/src/app/site/motions/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.html @@ -1,12 +1,7 @@
    -
  • +
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 ad61f4109..82f8caffa 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 @@ -1,5 +1,5 @@ - +
@@ -73,7 +73,7 @@

{{ contentForm.get("title").value }}

- + @@ -298,7 +298,6 @@ -
Reason
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 90c091b69..a8a417caf 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 @@ -12,7 +12,7 @@
-
+
@@ -21,13 +21,13 @@
- + Identifier -
- {{motion.identifier}} +
+ {{ motion.identifier }}
@@ -36,12 +36,12 @@ Title -
- {{motion.title}} +
+ {{ motion.title }}
- + by - {{motion.submitters}} + {{ motion.submitters }}
@@ -51,20 +51,19 @@ State -
- {{getStateIcon(motion.state)}} +
+ {{ getStateIcon(motion.state) }}
- + - + diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/components/motion-list/motion-list.component.ts index 1a7d7f6fb..c5e5212cc 100644 --- a/client/src/app/site/motions/components/motion-list/motion-list.component.ts +++ b/client/src/app/site/motions/components/motion-list/motion-list.component.ts @@ -60,7 +60,14 @@ export class MotionListComponent extends ListViewBaseComponent imple super.setTitle('Motions'); this.initTable(); this.repo.getViewModelListObservable().subscribe(newMotions => { - this.dataSource.data = newMotions; + // TODO: This is for testing purposes. Can be removed with #3963 + this.dataSource.data = newMotions.sort((a, b) => { + if (a.weight !== b.weight) { + return a.weight - b.weight; + } else { + return a.id - b.id; + } + }); }); } diff --git a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.html b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.html index a515dfa7e..13e5bcf13 100644 --- a/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.html +++ b/client/src/app/site/motions/components/statute-paragraph-list/statute-paragraph-list.component.html @@ -1,5 +1,4 @@ -

Statute paragraphs

@@ -11,10 +10,8 @@ more_vert
-
-
Create new statute paragraph @@ -48,6 +45,7 @@ + @@ -103,6 +101,7 @@ +
No statute paragraphs
diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index b0e936e9e..552c29395 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -84,6 +84,14 @@ export class ViewMotion extends BaseViewModel { return this.motion ? this.motion.reason : null; } + public get weight(): number { + return this.motion ? this.motion.weight : null; + } + + public get sort_parent_id(): number { + return this.motion ? this.motion.sort_parent_id : null; + } + public get category(): Category { return this._category; } @@ -133,7 +141,9 @@ export class ViewMotion extends BaseViewModel { } public get possibleRecommendations(): WorkflowState[] { - return this.workflow ? this.workflow.states.filter(recommendation => recommendation.recommendation_label !== undefined) : null; + return this.workflow + ? this.workflow.states.filter(recommendation => recommendation.recommendation_label !== undefined) + : null; } public get origin(): string { @@ -179,10 +189,9 @@ export class ViewMotion extends BaseViewModel { this.highlightedLine = null; } - // TODO aware of issues here? public getTitle(): string { - if (this.category) { - return this.category.prefix + ' - ' + this.title; + if (this.identifier) { + return this.identifier + ' - ' + this.title; } return this.title; } diff --git a/client/src/app/site/motions/motions-routing.module.ts b/client/src/app/site/motions/motions-routing.module.ts index 2d5b26e16..f5c0b6e73 100644 --- a/client/src/app/site/motions/motions-routing.module.ts +++ b/client/src/app/site/motions/motions-routing.module.ts @@ -6,12 +6,14 @@ import { CategoryListComponent } from './components/category-list/category-list. import { MotionCommentSectionListComponent } from './components/motion-comment-section-list/motion-comment-section-list.component'; import { StatuteParagraphListComponent } from './components/statute-paragraph-list/statute-paragraph-list.component'; import { SpeakerListComponent } from '../agenda/components/speaker-list/speaker-list.component'; +import { CallListComponent } from './components/call-list/call-list.component'; const routes: Routes = [ { path: '', component: MotionListComponent }, { path: 'category', component: CategoryListComponent }, { path: 'comment-section', component: MotionCommentSectionListComponent }, { path: 'statute-paragraphs', component: StatuteParagraphListComponent }, + { path: 'call-list', component: CallListComponent }, { path: 'new', component: MotionDetailComponent }, { path: ':id', component: MotionDetailComponent }, { path: ':id/speakers', component: SpeakerListComponent } diff --git a/client/src/app/site/motions/motions.module.ts b/client/src/app/site/motions/motions.module.ts index 006e7e2d4..99d2db40d 100644 --- a/client/src/app/site/motions/motions.module.ts +++ b/client/src/app/site/motions/motions.module.ts @@ -14,6 +14,7 @@ import { MotionDetailDiffComponent } from './components/motion-detail-diff/motio import { MotionCommentsComponent } from './components/motion-comments/motion-comments.component'; import { MetaTextBlockComponent } from './components/meta-text-block/meta-text-block.component'; import { PersonalNoteComponent } from './components/personal-note/personal-note.component'; +import { CallListComponent } from './components/call-list/call-list.component'; @NgModule({ imports: [CommonModule, MotionsRoutingModule, SharedModule], @@ -28,7 +29,8 @@ import { PersonalNoteComponent } from './components/personal-note/personal-note. MotionDetailDiffComponent, MotionCommentsComponent, MetaTextBlockComponent, - PersonalNoteComponent + PersonalNoteComponent, + CallListComponent ], entryComponents: [ MotionChangeRecommendationComponent, diff --git a/client/src/app/site/motions/services/motion-repository.service.ts b/client/src/app/site/motions/services/motion-repository.service.ts index 28b0d43d3..3ba541fad 100644 --- a/client/src/app/site/motions/services/motion-repository.service.ts +++ b/client/src/app/site/motions/services/motion-repository.service.ts @@ -149,6 +149,16 @@ export class MotionRepositoryService extends BaseRepository return this.configService.get('motions_recommendations_by'); } + /** + * Sorts motions for the call list by the given list of ids (as identifiables with + * the format `{id: }`). + * @param motionIds all motion ids in the new order. + */ + public async sortMotions(motionIds: Identifiable[]): Promise { + const url = '/rest/motions/motion/sort/'; + await this.httpService.post(url, { nodes: motionIds }); + } + /** * Format the motion text using the line numbering and change * reco algorithm. diff --git a/client/src/app/site/tags/components/tag-list/tag-list.component.html b/client/src/app/site/tags/components/tag-list/tag-list.component.html index 1f5316586..fcf15b07e 100644 --- a/client/src/app/site/tags/components/tag-list/tag-list.component.html +++ b/client/src/app/site/tags/components/tag-list/tag-list.component.html @@ -1,11 +1,12 @@ - - +

Tags

- + Required
@@ -20,13 +21,13 @@
- + - Name - {{tag.getTitle()}} + Name + {{ tag.getTitle() }} - + diff --git a/client/src/app/site/users/components/group-list/group-list.component.html b/client/src/app/site/users/components/group-list/group-list.component.html index 907fe6966..7bab89daf 100644 --- a/client/src/app/site/users/components/group-list/group-list.component.html +++ b/client/src/app/site/users/components/group-list/group-list.component.html @@ -1,12 +1,13 @@ - - +

Groups

- + Required
@@ -35,7 +36,7 @@
- +
Permissions @@ -53,7 +54,7 @@
+ (change)="togglePerm(group, perm.value)">
diff --git a/client/src/app/site/users/components/user-detail/user-detail.component.html b/client/src/app/site/users/components/user-detail/user-detail.component.html index 00b48d634..b06b05a17 100644 --- a/client/src/app/site/users/components/user-detail/user-detail.component.html +++ b/client/src/app/site/users/components/user-detail/user-detail.component.html @@ -1,16 +1,15 @@ - - +
-

- {{personalInfoForm.get('title').value}} - {{personalInfoForm.get('first_name').value}} - {{personalInfoForm.get('last_name').value}} +

+ {{ personalInfoForm.get('title').value }} + {{ personalInfoForm.get('first_name').value }} + {{ personalInfoForm.get('last_name').value }}

-

- {{user.full_name}} +

+ {{ user.full_name }}

@@ -22,7 +21,7 @@ - @@ -30,34 +29,34 @@
-
+ -
+
- - + + - - + + - - + +
-
+
- - - + + + Please enter a valid email address @@ -65,79 +64,83 @@
- - + + - - + +
- - - {{group}} + + + {{ group }}
-
+
- - + + Generate -
-
+
- - + +
-
+
- - + +
-
+
- - + + Only for internal notes.
-
+
- + Is present + - + Is active + - + Is a committee
- diff --git a/client/src/app/site/users/components/user-list/user-list.component.html b/client/src/app/site/users/components/user-list/user-list.component.html index 5151987e9..93e799be6 100644 --- a/client/src/app/site/users/components/user-list/user-list.component.html +++ b/client/src/app/site/users/components/user-list/user-list.component.html @@ -12,7 +12,7 @@
-
+
@@ -21,27 +21,27 @@
- + - Name - {{user.full_name}} + Name + {{ user.full_name }} - Group + Group
people - {{user.groups}} + {{ user.groups }}
flag - {{user.structure_level}} + {{ user.structure_level }}
@@ -49,7 +49,7 @@ - Presence + Presence
check_box @@ -59,7 +59,7 @@ - + diff --git a/openslides/motions/views.py b/openslides/motions/views.py index b766f1ab1..8173b92b8 100644 --- a/openslides/motions/views.py +++ b/openslides/motions/views.py @@ -289,7 +289,6 @@ class MotionViewSet(ModelViewSet): Note: This view is not tested! Maybe needs to be refactored. Add documentation abou the data to be send. """ - raise ValidationError({'detail': _('This view needs testing and refactoring!')}) nodes = request.data.get('nodes', []) sort_parent_id = request.data.get('sort_parent_id') motions = []