Skip to content

Commit

Permalink
Fixed remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDrabant committed Dec 3, 2023
1 parent 5bfd527 commit aa195f1
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
12 changes: 10 additions & 2 deletions src/app/addoption-dialog/addoption-dialog.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 [innerHtml]="'addoption.header'|translate"></h1>
: 'draftpoll.target-name-placeholder') | translate"
type="text" required [maxlength]="E.max_len.name"
style="font-weight: bold; font-style: italic;">
</ion-input>
</ion-input>
</ion-item>
<div class="validation-errors">
<ng-container *ngFor="let validation of validation_messages.option_name">
Expand Down Expand Up @@ -125,14 +125,22 @@ <h1 [innerHtml]="'addoption.header'|translate"></h1>
<ion-icon name="arrow-back-outline"></ion-icon>&nbsp;
<span [innerHtml]="'cancel'|translate"></span>
</ion-button>&nbsp;&nbsp;
<ion-button color="primary" [disabled]="!formGroup.valid"
<ion-button color="primary" [disabled]="isAddButtonDisabled()"
shape="round" fill="solid"
(click)="OK_button_clicked()"><!--type="submit" button-type="submit"-->
<ion-icon name="checkmark"></ion-icon>&nbsp;
<span [innerHtml]="'add'|translate"></span>
</ion-button>
</ion-buttons>
</ion-item>
<div class="validation-errors">
<ng-container>
<div class="error-message"
*ngIf="!this.p.can_add_option()"
[innerHtml]="'poll.add-option-expired'|translate">
</div>
</ng-container>
</div>
<ion-item lines="none">
<small [innerHtml]="'addoption.info' | translate"></small>
</ion-item>
Expand Down
5 changes: 5 additions & 0 deletions src/app/addoption-dialog/addoption-dialog.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export class AddoptionDialogPage implements OnInit {
setTimeout(() => this.focus_element.setFocus(), 100);
}

isAddButtonDisabled(): boolean {
// Combine both conditions here
return !this.formGroup.valid || !this.p.can_add_option();
}

OK_button_clicked() {
/** add the option */
const name = this.formGroup.get('option_name').value,
Expand Down
3 changes: 0 additions & 3 deletions src/app/poll/poll.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,6 @@ <h3><b>
[disabled]="!p.can_add_option()">
</ion-button>
</ion-item>
<ion-item *ngIf="!p.can_add_option()" color="danger">
<strong [innerHtml]="'poll.add-option-expired' | translate"></strong>
</ion-item>
<ion-item lines="none" style="padding-bottom: 10px!important;">
<small [innerHtml]="'poll.add-option-info' | translate"></small>
</ion-item>
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@
"explain": "Erklären",
"add-option": "Option hinzufügen",
"add-option-info": "Wenn Du denkst, eine wichtige Option fehlt noch und ist nicht von den anderen Optionen mit abgedeckt, kannst Du sie hinzufügen. Einmal hinzugefügte Optionen kann allerdings niemand mehr verändern oder löschen.",
"sorting": "Optionen werden neu sortiert...",
"add-option-expired": "Time to add new options has expired."
"sorting": "Optionen werden neu sortiert..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@
"explain": "Explicar",
"add-option": "Añadir opción",
"add-option-info": "Si crees que falta alguna opción importante y no está cubierta por ninguna de las anteriores, puedes añadirla. Una vez añadida, las opciones no podrán ser editadas o eliminadas.",
"sorting": "Ordenando opciones según su aprobación...",
"add-option-expired": "Time to add new options has expired."
"sorting": "Ordenando opciones según su aprobación..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,7 @@
"explain": "Selitä",
"add-option": "Lisää vaihtoehto",
"add-option-info": "Jos tärkeä vaihtoehto mielestäsi puuttuu vielä eikä yksikään muista vaihtoehdoista kata sitä, voit lisätä sen. Kun vaihtoehto on lisätty, sitä ei voi kuitenkaan enää muokata tai poistaa.",
"sorting": "Järjestetään vaihtoehtoja kannatuksen perusteella...",
"add-option-expired": "Time to add new options has expired."
"sorting": "Järjestetään vaihtoehtoja kannatuksen perusteella..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@
"explain": "समझाएँ",
"add-option": "विकल्प जोड़ें",
"add-option-info": "यदि आपको लगता है कि कुछ महत्वपूर्ण विकल्प गायब है और सूचीबद्ध विकल्पों में से किसी के द्वारा कवर नहीं किया गया है, तो आप इसे जोड़ सकते हैं। एक बार जोड़ने के बाद, विकल्पों को संपादित या फिर से हटाया नहीं जा सकता है।",
"sorting": "स्वीकृति के आधार पर विकल्पों को क्रमित किया जा रहा है...",
"add-option-expired": "Time to add new options has expired."
"sorting": "स्वीकृति के आधार पर विकल्पों को क्रमित किया जा रहा है..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@
"explain": "Explain",
"add-option": "Add option",
"add-option-info": "If you believe some important option is missing and is not covered by any of the listed options, you can add it. Once added, options cannot be edited or removed again, however.",
"sorting": "Sorting options by approval...",
"add-option-expired": "Time to add new options has expired."
"sorting": "Sorting options by approval..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@
"explain": "설명",
"add-option": "선택지 추가",
"add-option-info": "중요한 선택지가 위에 목록에 없다고 생각된다면 추가 할 수 있습니다. 하지만 추가된 이후에는 수정되거나 삭제할 수 없음을 유의해 주십시오.",
"sorting": "승인 수에 따라 선택지 정렬중...",
"add-option-expired": "Time to add new options has expired."
"sorting": "승인 수에 따라 선택지 정렬중..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down
3 changes: 1 addition & 2 deletions src/assets/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@
"explain": "Wyjaśnij",
"add-option": "Dodaj opcję",
"add-option-info": "Jeśli uważasz, że brakuje jakiejś ważnej opcji i nie pokrywa się ona z żadną z już wymienionych, możesz ją dodać. Jednak po dodaniu opcji nie można jej ponownie edytować ani usunąć.",
"sorting": "Sortowanie opcji według poziomu akceptacji...",
"add-option-expired": "Time to add new options has expired."
"sorting": "Sortowanie opcji według poziomu akceptacji..."
},
"previewpoll": {
"_COMMENT_SECTION_": "[COMMENT] strings used on the Please Check (Poll Preview) page:",
Expand Down

0 comments on commit aa195f1

Please sign in to comment.