From 4a04548c1c285ccf8fd64227058c0b4c803a0aa1 Mon Sep 17 00:00:00 2001 From: 778a69cd <778a69cd@potsda.mn> Date: Mon, 3 Apr 2023 13:18:45 +0200 Subject: [PATCH] Revert "Extracting sorting modes into its own model" This reverts commit 839f9fd3f23027bfc00551f22ab0e52c5b63087f. --- js/src/types/sorting.model.ts | 19 ------------- js/src/views/Home.vue | 52 +++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 37 deletions(-) delete mode 100644 js/src/types/sorting.model.ts diff --git a/js/src/types/sorting.model.ts b/js/src/types/sorting.model.ts deleted file mode 100644 index 57271875c..000000000 --- a/js/src/types/sorting.model.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { EventSortField, SortDirection } from "./enums"; - -export interface ISorting { - title: string; - orderBy: EventSortField; - direction: SortDirection; -} - -export class SortingUpcoming implements ISorting { - title = "Upcoming Events"; - orderBy = EventSortField.BEGINS_ON; - direction = SortDirection.ASC; -} - -export class SortingCreated implements ISorting { - title = "Recently created Events"; - orderBy = EventSortField.INSERTED_AT; - direction = SortDirection.DESC; -} diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index 5dc66419d..ace64eff7 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -43,7 +43,15 @@ >

- {{ $t(this.sorting.title) }} + {{ + $t( + config && + config.instanceHomepageSorting === + InstanceHomepageSorting.UPCOMING + ? "Upcoming Events" + : "Last published events" + ) + }}

@@ -226,7 +234,15 @@ />

- {{ $t(this.sorting.title) }} + {{ + $t( + config && + config.instanceHomepageSorting === + InstanceHomepageSorting.UPCOMING + ? "Upcoming Events" + : "Last published events" + ) + }}

@@ -258,7 +274,12 @@