Skip to content

Commit

Permalink
[OS-601] WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jcougnaud committed Sep 18, 2024
1 parent e893f55 commit 1491f7d
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 301 deletions.
22 changes: 14 additions & 8 deletions templates/admission/continuing_education/checklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@
})
});
let onFirstTabLoad = true;
menuItems.on('shown.bs.tab', function (e) {
$(this).parents('.list-group-item').find('.sub-items').show();

Expand All @@ -303,8 +305,18 @@

refreshDocuments(tabPaneId);

// refresh info viewer (e.target = active && e.relatedTarget = previous)
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// refresh info viewer
if (onFirstTabLoad) {
onFirstTabLoad = false;
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// move info from the current tab to the info viewer
$('#infos-shortcut').click();
} else {
// hide the info viewer
$('#info-viewer-tab').hide();
}
} else if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// (e.target = active && e.relatedTarget = previous)
const $info = $('#info-viewer-tab .info-content');
// move old info from info viewer to old tab
const oldTabPanel = $($(e.relatedTarget).parent().attr('href')).find('.info-part');
Expand Down Expand Up @@ -341,12 +353,6 @@
// Activate tab from hash on first load
$(`#checklist-menu *[data-toggle="tab"][href="${defaultTab}"]`).click();

if (configurationCache.getItem('side-tab', 'documents') === 'info') {
$('#infos-shortcut').click();
} else {
$('#info-viewer-tab').hide();
}

$('textarea[name="comment"]:visible').each(autogrow);
});

Expand Down
44 changes: 34 additions & 10 deletions templates/admission/doctorate/checklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

{% can_update_tab 'person' as can_update_person_tab %}
{% can_update_tab 'coordonnees' as can_update_coordonnees_tab %}
{% can_update_tab 'languages' as can_update_languages_tab %}
{% can_update_tab 'accounting' as can_update_accounting_tab %}
{% can_update_tab 'training-choice' as can_update_training_choice_tab %}
{% can_update_tab 'curriculum' as can_update_curriculum %}
Expand Down Expand Up @@ -90,6 +91,12 @@
{% url base_namespace|add:":training-choice" view.kwargs.uuid as training_choice_url %}
{% endif %}

{% if can_update_languages_tab %}
{% url base_namespace|add:":update:languages" view.kwargs.uuid as languages_url %}
{% else %}
{% url base_namespace|add:":languages" view.kwargs.uuid as languages_url %}
{% endif %}

{% concat "#choix_formation" as checklist_training_choice_url %}

<div
Expand Down Expand Up @@ -249,9 +256,20 @@
{% endif %}
</strong>
{% include 'admission/general_education/includes/checklist/financeabilty_info.html' with current=original_admission.checklist.current.financabilite %}

<div class="panel panel-default mt-1">
<div class="panel-heading flex-content-no-wrap">
<div class="panel-title">{% translate 'Knowledge of languages' %}</div>
{% concat languages_url next_url as contextual_languages_url %}
<span>{{ ''|edit_button:contextual_languages_url|safe }}</span>
</div>
<div class="panel-body">
{% include 'admission/exports/recap/includes/languages.html' with connaissances_langues=resume_proposition.connaissances_langues %}
</div>
</div>
<div class="mt-1">
{% if can_update_curriculum %}
{% url 'admission:general-education:update:curriculum' view.kwargs.uuid as global_curriculum_update_url %}
{% url 'admission:doctorate:update:curriculum' view.kwargs.uuid as global_curriculum_update_url %}
{% endif %}
{% multiple_field_data specific_questions_by_tab|get_item:'CURRICULUM' edit_link_button=global_curriculum_update_url|add:next_url %}
</div>
Expand Down Expand Up @@ -299,7 +317,7 @@
{% else %}
{% include 'admission/general_education/includes/checklist/previous_experience_single.html' with current=child authentication_form=authentication_forms|get_item_or_none:child.extra.identifiant experience_authentication_history_entry=all_experience_authentication_history_entries|get_item_or_none:child.extra.identifiant %}
<div>
{% experience_details_template resume_proposition=resume_proposition experience=experience with_edit_link_button=True can_update_curriculum=can_update_curriculum can_update_education=can_update_education specific_questions=specific_questions_by_tab can_delete_curriculum=can_delete_curriculum %}
{% experience_details_template resume_proposition=resume_proposition experience=experience with_edit_link_button=True specific_questions=specific_questions_by_tab %}
</div>
{% endif %}
{% endwith %}
Expand Down Expand Up @@ -596,6 +614,8 @@
})
});
let onFirstTabLoad = true;
menuItems.on('shown.bs.tab', function (e) {
$(this).parents('.list-group-item').find('.sub-items').show();

Expand All @@ -607,8 +627,18 @@

refreshDocuments(tabPaneId);

// refresh info viewer (e.target = active && e.relatedTarget = previous)
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// refresh info viewer
if (onFirstTabLoad) {
onFirstTabLoad = false;
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// move info from the current tab to the info viewer
$('#infos-shortcut').click();
} else {
// hide the info viewer
$('#info-viewer-tab').hide();
}
} else if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// (e.target = active && e.relatedTarget = previous)
const $info = $('#info-viewer-tab .info-content');
// move old info from info viewer to old tab
const oldTabPanel = $($(e.relatedTarget).parent().attr('href')).find('.info-part');
Expand Down Expand Up @@ -645,12 +675,6 @@
// Activate tab from hash on first load
$(`#checklist-menu *[data-toggle="tab"][href="${defaultTab}"]`).click();

if (configurationCache.getItem('side-tab', 'documents') === 'info') {
$('#infos-shortcut').click();
} else {
$('#info-viewer-tab').hide();
}

$('textarea[name="comment"]:visible').each(autogrow);

$('[data-toggle=popover]').popover();
Expand Down
24 changes: 15 additions & 9 deletions templates/admission/general_education/checklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
{% else %}
{% include 'admission/general_education/includes/checklist/previous_experience_single.html' with current=child authentication_form=authentication_forms|get_item_or_none:child.extra.identifiant experience_authentication_history_entry=all_experience_authentication_history_entries|get_item_or_none:child.extra.identifiant %}
<div>
{% experience_details_template resume_proposition=resume_proposition experience=experience with_edit_link_button=True can_update_curriculum=can_update_curriculum can_update_education=can_update_education specific_questions=specific_questions_by_tab can_delete_curriculum=can_delete_curriculum %}
{% experience_details_template resume_proposition=resume_proposition experience=experience with_edit_link_button=True specific_questions=specific_questions_by_tab %}
</div>
{% endif %}
{% endwith %}
Expand Down Expand Up @@ -693,6 +693,8 @@
})
});
let onFirstTabLoad = true;
menuItems.on('shown.bs.tab', function (e) {
$(this).parents('.list-group-item').find('.sub-items').show();

Expand All @@ -704,8 +706,18 @@

refreshDocuments(tabPaneId);

// refresh info viewer (e.target = active && e.relatedTarget = previous)
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// refresh info viewer
if (onFirstTabLoad) {
onFirstTabLoad = false;
if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// move info from the current tab to the info viewer
$('#infos-shortcut').click();
} else {
// hide the info viewer
$('#info-viewer-tab').hide();
}
} else if (configurationCache.getItem('side-tab', 'documents') === 'info') {
// (e.target = active && e.relatedTarget = previous)
const $info = $('#info-viewer-tab .info-content');
// move old info from info viewer to old tab
const oldTabPanel = $($(e.relatedTarget).parent().attr('href')).find('.info-part');
Expand Down Expand Up @@ -742,12 +754,6 @@
// Activate tab from hash on first load
$(`#checklist-menu *[data-toggle="tab"][href="${defaultTab}"]`).click();

if (configurationCache.getItem('side-tab', 'documents') === 'info') {
$('#infos-shortcut').click();
} else {
$('#info-viewer-tab').hide();
}

$('textarea[name="comment"]:visible').each(autogrow);

$('[data-toggle=popover]').popover();
Expand Down
Loading

0 comments on commit 1491f7d

Please sign in to comment.