Skip to content

Commit

Permalink
ui updates. Added new role.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marios Venetsianos committed Feb 28, 2023
1 parent 4565fa1 commit 025e014
Show file tree
Hide file tree
Showing 19 changed files with 706 additions and 483 deletions.
23 changes: 21 additions & 2 deletions public/js/common_form_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ $("#add_row_table_14").on("click", function () {
}" name="field_14_arthro${index - 1}" rows="5" ></textarea>
</td>
<td>
<br>
<textarea class="govgr-textarea" id="field_14_stoxos${
index - 1
}" name="field_14_stoxos${index - 1}" onkeypress="wordsCounter('field_14_stoxos${index - 1}','words14_${index - 1}', event)" onpaste="wordsCounter('field_14_stoxos${index - 1}','words14_${index - 1}', event)" rows="5"></textarea>
Expand Down Expand Up @@ -349,15 +350,15 @@ $("#add_row_table_17").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateMinistersNameSelect(`field_17_minister_name${index - 1}`);
setChoicesJs(`minister_name${index - 1}`);
setChoicesJs(`field_17_minister_name${index - 1}`);
});

$("#add_row_ministers_table").on("click", function () {
let index = $("#tbody_ministers").prop("rows").length;
$("#tbody_ministers").append(`
<tr class="govgr-table__row" id="R${++index}">
<td>
<select one="one" id="minister_name${
<select style="width:100%;" id="minister_name${
index - 1
}" name="minister_name${index - 1}" class="govgr-select" onchange="ministerNameOnChange('minister_name${index - 1}', 'minister_role${index - 1}', 'minister_ministry${index - 1}')" style="width:100%;" ></select>
</td>
Expand Down Expand Up @@ -438,6 +439,7 @@ $("#add_row_table_31").on("click", function () {
}" name="field_31_synarmodia_ypoyrgeia${index - 1}" rows="5"></textarea>
</td>
<td>
<br>
<textarea class="govgr-textarea" id="field_31_antikeimeno_synarmodiotitas${
index - 1
}" name="field_31_antikeimeno_synarmodiotitas${index - 1}" rows="5" onkeypress="wordsCounter('field_31_antikeimeno_synarmodiotitas${index - 1}','words31_${index - 1}',50, event)" onpaste="wordsCounter('field_31_antikeimeno_synarmodiotitas${index - 1}','words31_${index - 1}',50, event)"></textarea>
Expand Down Expand Up @@ -469,6 +471,7 @@ $("#add_row_table_32").on("click", function () {
}" name="field_32_armodio_ypoyrgeio${index - 1}" rows="5"></textarea>
</td>
<td>
<br>
<textarea class="govgr-textarea" id="field_32_antikeimeno${
index - 1
}" name="field_32_antikeimeno${index - 1}" rows="5" onkeypress="wordsCounter('field_32_antikeimeno${index - 1}','words32_${index - 1}',50, event)" onpaste="wordsCounter('field_32_antikeimeno${index - 1}','words32_${index - 1}',50, event)"></textarea>
Expand Down Expand Up @@ -542,6 +545,7 @@ $("#add_row_education").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`ekpaideysi_index${index - 1}`, "ΕΚΠΑΙΔΕΥΣΗ");
setChoicesJs(`ekpaideysi_index${index - 1}`);
});

$("#add_row_civ").on("click", function () {
Expand Down Expand Up @@ -589,6 +593,7 @@ $("#add_row_civ").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`politismos_index${index - 1}`, "ΠΟΛΙΤΙΣΜΟΣ");
setChoicesJs(`politismos_index${index - 1}`);
});

$("#add_row_economy").on("click", function () {
Expand Down Expand Up @@ -636,6 +641,7 @@ $("#add_row_economy").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`oikonomia_index${index - 1}`, "ΟΙΚΟΝΟΜΙΑ");
setChoicesJs(`oikonomia_index${index - 1}`);
});

$("#add_row_taxation").on("click", function () {
Expand Down Expand Up @@ -683,6 +689,7 @@ $("#add_row_taxation").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`forologia_index${index - 1}`, "ΦΟΡΟΛΟΓΙΑ");
setChoicesJs(`forologia_index${index - 1}`);
});

$("#add_row_relations").on("click", function () {
Expand Down Expand Up @@ -733,6 +740,7 @@ $("#add_row_relations").on("click", function () {
`ergasiakes_sxeseis_index${index - 1}`,
"ΕΡΓΑΣΙΑΚΕΣ ΣΧΕΣΕΙΣ"
);
setChoicesJs(`ergasiakes_sxeseis_index${index - 1}`);
});

$("#add_row_employment").on("click", function () {
Expand Down Expand Up @@ -780,6 +788,7 @@ $("#add_row_employment").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`apasxolisi_index${index - 1}`, "ΑΠΑΣΧΟΛΗΣΗ");
setChoicesJs(`apasxolisi_index${index - 1}`);
});

$("#add_row_insurance").on("click", function () {
Expand Down Expand Up @@ -829,6 +838,7 @@ $("#add_row_insurance").on("click", function () {
`koinoniki_asfalisi_index${index - 1}`,
"ΚΟΙΝΩΝΙΚΗ ΑΣΦΑΛΙΣΗ"
);
setChoicesJs(`koinoniki_asfalisi_index${index - 1}`);
});

$("#add_row_welfare").on("click", function () {
Expand Down Expand Up @@ -879,6 +889,7 @@ $("#add_row_welfare").on("click", function () {
`koinoniki_pronoia_index${index - 1}`,
"ΚΟΙΝΩΝΙΚΗ ΠΡΟΝΟΙΑ"
);
setChoicesJs(`koinoniki_pronoia_index${index - 1}`);
});

$("#add_row_healthcare").on("click", function () {
Expand Down Expand Up @@ -926,6 +937,7 @@ $("#add_row_healthcare").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`ygeia_index${index - 1}`, "ΥΓΕΙΑ");
setChoicesJs(`ygeia_index${index - 1}`);
});

$("#add_row_equality").on("click", function () {
Expand Down Expand Up @@ -973,6 +985,7 @@ $("#add_row_equality").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`isotita_fylwn_index${index - 1}`, "ΙΣΟΤΗΤΑ ΦΥΛΩΝ");
setChoicesJs(`isotita_fylwn_index${index - 1}`);
});

$("#add_row_immigration").on("click", function () {
Expand Down Expand Up @@ -1025,6 +1038,7 @@ $("#add_row_immigration").on("click", function () {
`metanasteytiki_prosfygiki_politiki_index${index - 1}`,
"ΜΕΤΑΝΑΣΤΕΥΤΙΚΗ-ΠΡΟΣΦΥΓΙΚΗ ΠΟΛΙΤΙΚΗ"
);
setChoicesJs(`metanasteytiki_prosfygiki_politiki_index${index - 1}`);
});

$("#add_row_administration").on("click", function () {
Expand Down Expand Up @@ -1072,6 +1086,7 @@ $("#add_row_administration").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`dimosia_dioikisi_index${index - 1}`, "ΔΗΜΟΣΙΑ ΔΙΟΙΚΗΣΗ");
setChoicesJs(`dimosia_dioikisi_index${index - 1}`);
});

$("#add_row_security").on("click", function () {
Expand Down Expand Up @@ -1118,6 +1133,7 @@ $("#add_row_security").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`dimosia_asfaleia_index${index - 1}`, "ΔΗΜΟΣΙΑ ΑΣΦΑΛΕΙΑ");
setChoicesJs(`dimosia_asfaleia_index${index - 1}`);
});

$("#add_row_justice").on("click", function () {
Expand Down Expand Up @@ -1164,6 +1180,7 @@ $("#add_row_justice").on("click", function () {
<td><button class="btn remove float-right" type="button"><img src="/img/delete.png" width="50px"></button></td>
</tr>`);
populateIndexSelect(`dikaiosini_index${index - 1}`, "ΔΙΚΑΙΟΣΥΝΗ");
setChoicesJs(`dikaiosini_index${index - 1}`);
});

$("#add_row_investments").on("click", function () {
Expand Down Expand Up @@ -1214,6 +1231,7 @@ $("#add_row_investments").on("click", function () {
`ependytiki_drastiriotita_index${index - 1}`,
"ΕΠΙΧΕΙΡΗΜΑΤΙΚΗ/ΕΠΕΝΔΥΤΙΚΗ ΔΡΑΣΤΗΡΙΟΤΗΤΑ"
);
setChoicesJs(`ependytiki_drastiriotita_index${index - 1}`);
});

$("#add_row_energy").on("click", function () {
Expand Down Expand Up @@ -1263,6 +1281,7 @@ $("#add_row_energy").on("click", function () {
`perivallon_energeia_index${index - 1}`,
"ΠΕΡΙΒΑΛΛΟΝ – ΕΝΕΡΓΕΙΑ"
);
setChoicesJs(`ependytiki_drastiriotita_index${index - 1}`);
});

//TODO: remove after field_9 refactoring
Expand Down
4 changes: 0 additions & 4 deletions public/js/common_form_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,4 @@ function ministerNameOnChange(
break;
}
}
}

function setChoicesJs(element) {
const choices = new Choices($(`#${element}`)[0]);
}
3 changes: 3 additions & 0 deletions public/js/common_scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function setChoicesJs(element) {
const choices = new Choices($(`#${element}`)[0]);
}
Loading

0 comments on commit 025e014

Please sign in to comment.