Skip to content
Snippets Groups Projects
Commit 18b3d8b1 authored by HeJ's avatar HeJ
Browse files

c3nav export: use non-i18n public_url, add tags

parent 7a350688
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView): ...@@ -159,7 +159,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView):
'name': assembly.name, 'name': assembly.name,
'is_official': assembly.is_official, 'is_official': assembly.is_official,
'description': {'de': assembly.description_de, 'en': assembly.description_en}, 'description': {'de': assembly.description_de, 'en': assembly.description_en},
'public_url': hub_absolute('plainui:assembly', assembly_slug=assembly.slug), 'public_url': hub_absolute('plainui:assembly', assembly_slug=assembly.slug, i18n=False),
'parent_id': assembly.parent_id, 'parent_id': assembly.parent_id,
'children': get_exportable_assemblies(conference=self.conference).filter(parent=assembly).values_list('slug', flat=True) 'children': get_exportable_assemblies(conference=self.conference).filter(parent=assembly).values_list('slug', flat=True)
if assembly.is_cluster if assembly.is_cluster
...@@ -169,6 +169,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView): ...@@ -169,6 +169,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView):
'is_preview': assembly.location_state != Assembly.LocationState.FINAL, 'is_preview': assembly.location_state != Assembly.LocationState.FINAL,
'location': loc_data.get('point'), # assembly.get_location_point_xy(), 'location': loc_data.get('point'), # assembly.get_location_point_xy(),
'polygons': loc_data.get('boundaries'), # assembly.get_location_boundaries_xy(), 'polygons': loc_data.get('boundaries'), # assembly.get_location_boundaries_xy(),
'tags': assembly.tags.filter(tag__is_public=True).values_list('tag__slug', flat=True),
} }
) )
...@@ -180,11 +181,13 @@ class C3NavExportView(ConferenceSlugMixin, APIView): ...@@ -180,11 +181,13 @@ class C3NavExportView(ConferenceSlugMixin, APIView):
'slug': project.slug, 'slug': project.slug,
'name': project.name, 'name': project.name,
'description': {'de': project.description_de, 'en': project.description_en}, 'description': {'de': project.description_de, 'en': project.description_en},
'public_url': hub_absolute('plainui:project', slug=project.slug), 'public_url': hub_absolute('plainui:project', slug=project.slug, i18n=False),
'assembly_id': str(assembly.pk), 'assembly_id': str(assembly.pk),
'floor': assembly.get_location_floor_index(), # TODO: allow project-specific location floor 'floor': assembly.get_location_floor_index(), # TODO: allow project-specific location floor
'is_preview': assembly.location_state != Assembly.LocationState.FINAL,
'location': loc_data.get('point'), # TODO: allow project-specific location point 'location': loc_data.get('point'), # TODO: allow project-specific location point
'location_text': project.location, 'location_text': project.location,
'tags': project.tags.filter(tag__is_public=True).values_list('tag__slug', flat=True),
} }
) )
...@@ -202,6 +205,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView): ...@@ -202,6 +205,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView):
'floor': room.get_location_floor_index(), 'floor': room.get_location_floor_index(),
'location': room.get_location_point_xy(), 'location': room.get_location_point_xy(),
'polygons': room.get_location_boundaries_xy(), 'polygons': room.get_location_boundaries_xy(),
'tags': room.tags.filter(tag__is_public=True).values_list('tag__slug', flat=True),
} }
) )
...@@ -213,6 +217,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView): ...@@ -213,6 +217,7 @@ class C3NavExportView(ConferenceSlugMixin, APIView):
'name': {'de': poi.name_de, 'en': poi.name_en}, 'name': {'de': poi.name_de, 'en': poi.name_en},
'is_official': poi.is_official, 'is_official': poi.is_official,
'description': {'de': poi.description_de, 'en': poi.description_en}, 'description': {'de': poi.description_de, 'en': poi.description_en},
'is_preview': False,
'floor': poi.get_location_floor_index(), 'floor': poi.get_location_floor_index(),
'location': poi.get_location_point_xy(), 'location': poi.get_location_point_xy(),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment