+
+
+
+
+ This field is required.
+
+
+
+
outside
+
+
@@ -918,9 +975,9 @@
diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.scss b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.scss
index 827b2a53a..650ee17bc 100644
--- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.scss
+++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.scss
@@ -23,30 +23,36 @@ span {
display: flow-root;
}
-.motion-text-controls {
- float: right;
- margin-left: 5px;
- margin-top: -15px;
- height: 50px;
+.motion-text-toolbar-wrapper {
+ display: flex;
+ justify-content: flex-end;
button {
- font-size: 115%;
+ font-weight: 400;
+ margin-top: 7px;
}
+ height: 50px;
+ margin: -16px -16px 5px -16px;
+ padding: 0 16px;
+
> button {
// Prevent moving the buttons when the "go to line"-input is shown
margin-top: 7px;
}
- .motion-goto-line {
- width: 150px;
- }
- input[type='number']::-webkit-inner-spin-button,
- input[type='number']::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- input[type='number'] {
- -moz-appearance: textfield;
+
+ .motion-text-controls {
+ .motion-goto-line {
+ width: 150px;
+ }
+ input[type='number']::-webkit-inner-spin-button,
+ input[type='number']::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+ }
+ input[type='number'] {
+ -moz-appearance: textfield;
+ }
}
}
diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts
index 3a4bcdf2b..8e6ae03e4 100644
--- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts
+++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts
@@ -45,7 +45,12 @@ import {
ViewMotionNotificationEditMotion,
TypeOfNotificationViewMotion
} from 'app/site/motions/models/view-motion-notify';
-import { ViewMotion, ChangeRecoMode, LineNumberingMode } from 'app/site/motions/models/view-motion';
+import {
+ ViewMotion,
+ ChangeRecoMode,
+ LineNumberingMode,
+ verboseChangeRecoMode
+} from 'app/site/motions/models/view-motion';
import { ViewStatuteParagraph } from 'app/site/motions/models/view-statute-paragraph';
import { ViewTag } from 'app/site/tags/models/view-tag';
import { ViewUnifiedChange } from 'app/shared/models/motions/view-unified-change';
@@ -123,6 +128,30 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
return this.repo.getExtendedStateLabel(this.motion);
}
+ private finalEditMode = false;
+
+ /**
+ * check if the 'final version edit mode' is active
+ *
+ * @returns true if active
+ */
+ public get isFinalEdit(): boolean {
+ return this.finalEditMode;
+ }
+
+ /**
+ * Helper to check the current state of the final version edit
+ *
+ * @returns true if the local edit of the modified_final_version differs
+ * from the submitted version
+ */
+ public get finalVersionEdited(): boolean {
+ return (
+ this.crMode === ChangeRecoMode.ModifiedFinal &&
+ this.contentForm.get('modified_final_version').value !== this.motion.modified_final_version
+ );
+ }
+
/**
* Saves the target motion. Accessed via the getter and setter.
*/
@@ -275,6 +304,8 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
*/
public ChangeRecoMode = ChangeRecoMode;
+ public verboseChangeRecoMode = verboseChangeRecoMode;
+
/**
* For using the enum constants from the template
*/
@@ -704,8 +735,9 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
selected_paragraphs: [],
statute_amendment: [''], // Internal value for the checkbox, not saved to the model
statute_paragraph_id: [''],
- motion_block_id: [], // TODO: Can be removed if this is not required
- parent_id: []
+ motion_block_id: [],
+ parent_id: [],
+ modified_final_version: ['']
});
this.updateWorkflowIdForCreateForm();
@@ -1062,7 +1094,10 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
'Are you sure you want to copy the final version to the print template?'
);
if (await this.promptService.open(title, null)) {
- await this.updateMotion({ modified_final_version: finalVersion }, this.motion);
+ this.updateMotion({ modified_final_version: finalVersion }, this.motion).then(
+ () => this.setChangeRecoMode(ChangeRecoMode.ModifiedFinal),
+ this.raiseError
+ );
}
} else {
await this.updateMotion({ modified_final_version: finalVersion }, this.motion);
@@ -1070,7 +1105,6 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
} catch (e) {
this.raiseError(e);
}
- this.setChangeRecoMode(ChangeRecoMode.ModifiedFinal);
}
/**
@@ -1079,6 +1113,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
public async deleteModifiedFinalVersion(): Promise
{
const title = this.translate.instant('Are you sure you want to delete the print template?');
if (await this.promptService.open(title, null)) {
+ this.finalEditMode = false;
this.updateMotion({ modified_final_version: '' }, this.motion).then(
() => this.setChangeRecoMode(ChangeRecoMode.Final),
this.raiseError
@@ -1444,6 +1479,27 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
}
}
+ /**
+ * Submits the modified final version of the motion
+ */
+ public onSubmitFinalVersion(): void {
+ const val = this.contentForm.get('modified_final_version').value;
+ this.updateMotion({ modified_final_version: val }, this.motion).then(() => {
+ this.finalEditMode = false;
+ this.contentForm.get('modified_final_version').markAsPristine();
+ }, this.raiseError);
+ }
+
+ /**
+ * Cancels the final version edit and resets the form value
+ *
+ * TODO: the tinyMCE editor content should reset, too
+ */
+ public cancelFinalVersionEdit(): void {
+ this.finalEditMode = false;
+ this.contentForm.patchValue({ modified_final_version: this.motion.modified_final_version });
+ }
+
/**
* Toggles the favorite status
*/
@@ -1548,4 +1604,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
}
}
}
+
+ /**
+ * Activates the 'edit final version' mode
+ */
+ public editModifiedFinal(): void {
+ this.finalEditMode = true;
+ }
}
diff --git a/client/src/assets/styles/global-components-style.scss b/client/src/assets/styles/global-components-style.scss
index a779da3d9..5c06218a8 100644
--- a/client/src/assets/styles/global-components-style.scss
+++ b/client/src/assets/styles/global-components-style.scss
@@ -46,6 +46,10 @@
color: mat-color($warn);
}
+ .outline-border-bottom {
+ border-bottom: 1px solid $os-outline;
+ }
+
/* motion list/detail view */
.mat-chip-list.user .mat-chip {
color: mat-color($foreground, text);