Skip to content

Commit d7426e9

Browse files
fix: storage projects programtype filtered block
1 parent 5d009ab commit d7426e9

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/unicms_unical_storage_handler/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@
317317
'ProjectDescription', 'ProjectAbstract',
318318
'ProjectImage', 'InfrastructureId', 'IsActive']
319319

320-
PROJECTS_PRIN_ID_LIST = []
321320
PROJECTS_PRIN_BANNER_URL = "https://www.unical.it/media/medias/2024/TESTATA_PNRR_PER_UNICAL_ok.webp"
322321

323322
INITIAL_STRUCTURE_FATHER = ''
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
@change="{{ id }}.search()">
5151
<option value="">- {% trans 'Choose an option' %} -</option>
5252
<option v-for="item in programtypes"
53-
v-if="!excluded_programtypes.includes(String(item.TypeProgramId))"
53+
v-if="programtypes_filter.includes(String(item.TypeProgramId))"
5454
:value="item.TypeProgramId"
5555
:selected="item.TypeProgramId == selected_programtype">
5656
[[ item.TypeProgramDescription ]]
@@ -210,7 +210,6 @@ <h5>
210210
{% storage_api_root "CMS_STORAGE_PROJECTS_PROGRAMS_TYPES_API" as programtypes_api %}
211211
{% storage_api_root "CMS_STORAGE_DEPARTMENTS_API" as departments_api %}
212212
{% storage_api_root "CMS_STORAGE_PROJECTS_INFRASTRUCTURES_API" as infrastructures_api %}
213-
{% storage_settings_value "PROJECTS_PRIN_ID_LIST" as prin_id_list %}
214213

215214
search_dict: {},
216215
programtypes: [],
@@ -225,8 +224,6 @@ <h5>
225224
selected_search: this.getItemFromSession("{{ id }}", 'search'),
226225
selected_programtype: this.getItemFromSession("{{ id }}", 'programtype'),
227226
selected_infrastructure: this.getItemFromSession("{{ id }}", 'infrastructure'),
228-
229-
id_list: {{ prin_id_list|safe }},
230227
{% endblock extra_data %}
231228

232229
{% block extra_mounted %}
@@ -235,15 +232,15 @@ <h5>
235232
this.callProgramTypes();
236233
this.callInfrastructures();
237234

238-
this.excluded_programtypes = {{ id }}_get_param("-programtype").split(",");
235+
this.programtypes_filter = {{ id }}_get_param("programtype").split(",");
239236
{% endblock extra_mounted %}
240237

241238
{% block extra_methods %}
242239
callProgramTypes() {
243240
axios
244241
.get(this.loader_source_programtypes)
245242
.then(response => {
246-
this.programtypes = response.data.results.filter( p => this.id_list.includes( p.TypeProgramId ) );
243+
this.programtypes = response.data.results.filter( p => this.programtypes_filter.includes( p.TypeProgramId ) );
247244
this.is_loading_programtypes = false
248245
})
249246
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/home/francesco/websites/GIT_unical/unicms-unical-storage-handler/src/unicms_unical_storage_handler/

0 commit comments

Comments
 (0)