-
-
-
-
+
{{ t('askAQuestion') }}:
+
+
+
+
+
+
@@ -119,40 +124,5 @@
width: 100%;
max-width: 400px;
margin: 20px auto;
- font-family: sans-serif;
- }
-
- .input-wrapper {
- display: flex;
- align-items: center;
- border: 1px solid #ccc;
- border-radius: 999px;
- padding: 8px 12px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
- }
-
- .question-input {
- flex: 1;
- border: none;
- outline: none;
- font-size: 14px;
- background-color: transparent;
- }
-
- .question-input::placeholder {
- color: #999;
- }
-
- .send-button {
- background: none;
- border: none;
- cursor: pointer;
- font-size: 16px;
- color: #555;
- transition: color 0.2s ease;
- }
-
- .send-button:hover {
- color: #000;
}
diff --git a/frontend/src/components/SingleQuestion.vue b/frontend/src/components/SingleQuestion.vue
index 03f4e28e..2367b536 100644
--- a/frontend/src/components/SingleQuestion.vue
+++ b/frontend/src/components/SingleQuestion.vue
@@ -5,9 +5,10 @@
import UsingQueryResult from "./UsingQueryResult.vue";
import type { AnswersResponse } from "@/controllers/answers";
import type { AnswerData, AnswerDTO } from "@dwengo-1/common/interfaces/answer";
+ import type { UserDTO } from "@dwengo-1/common/interfaces/user";
import authService from "@/services/auth/auth-service";
import { useI18n } from "vue-i18n";
- import { AccountType } from "@dwengo-1/common/util/account-types"
+ import { AccountType } from "@dwengo-1/common/util/account-types";
const { t } = useI18n();
@@ -65,161 +66,119 @@
createAnswerMutation.mutate(answerData, {
onSuccess: async () => {
answer.value = "";
+ expanded.value = true;
await answersQuery.refetch();
},
});
}
}
+
+ function displayNameFor(user: UserDTO) {
+ if (user.firstName && user.lastName) {
+ return `${user.firstName} ${user.lastName}`;
+ } else {
+ return user.username;
+ }
+ }
-
- {{
- question.author.firstName + " " + question.author.lastName
- }}
- {{ formatDate(question.timestamp) }}
-
-
-
- {{ question.content }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
- {{ answer.author.username }}
- {{ formatDate(answer.timestamp) }}
-
+
+ {{ expanded ? t("answers-toggle-hide") : t("answers-toggle-show") }}
+
-
- {{ answer.content }}
-
+
+
+ {{ displayNameFor(answer.author) }}
+ {{ formatDate(answer.timestamp) }}
+
+ {{ answer.content }}
+
+
+
+
-
-
+
+
diff --git a/frontend/src/i18n/locale/de.json b/frontend/src/i18n/locale/de.json
index eb70f9f4..0ab6550e 100644
--- a/frontend/src/i18n/locale/de.json
+++ b/frontend/src/i18n/locale/de.json
@@ -169,10 +169,12 @@
"hintKeywordsSeparatedBySpaces": "Schlüsselwörter durch Leerzeichen getrennt",
"questions": "Fragen",
"view-questions": "Fragen anzeigen auf ",
- "question-input-placeholder": "Frage...",
- "answer-input-placeholder": "Antwort...",
+ "question-input-placeholder": "Ihre Frage...",
+ "answer-input-placeholder": "Ihre Antwort...",
"answers-toggle-hide": "Antworten verstecken",
"answers-toggle-show": "Antworten anzeigen",
"no-questions": "Keine Fragen",
- "no-discussion-tip": "Wählen Sie ein Lernobjekt aus, um dessen Fragen anzuzeigen"
+ "no-discussion-tip": "Wählen Sie ein Lernobjekt aus, um dessen Fragen anzuzeigen",
+ "askAQuestion": "Eine Frage stellen",
+ "questionsCapitalized": "Fragen"
}
diff --git a/frontend/src/i18n/locale/en.json b/frontend/src/i18n/locale/en.json
index 52e70595..ee5fb951 100644
--- a/frontend/src/i18n/locale/en.json
+++ b/frontend/src/i18n/locale/en.json
@@ -169,10 +169,12 @@
"hintKeywordsSeparatedBySpaces": "Keywords separated by spaces",
"questions": "questions",
"view-questions": "View questions in ",
- "question-input-placeholder": "question...",
- "answer-input-placeholder": "answer...",
+ "question-input-placeholder": "Your question...",
+ "answer-input-placeholder": "Your answer...",
"answers-toggle-hide": "Hide answers",
"answers-toggle-show": "Show answers",
"no-questions": "No questions asked yet",
- "no-discussion-tip": "Choose a learning object to view its questions"
+ "no-discussion-tip": "Choose a learning object to view its questions",
+ "askAQuestion": "Ask a question",
+ "questionsCapitalized": "Questions"
}
diff --git a/frontend/src/i18n/locale/fr.json b/frontend/src/i18n/locale/fr.json
index 0669f029..1711c91d 100644
--- a/frontend/src/i18n/locale/fr.json
+++ b/frontend/src/i18n/locale/fr.json
@@ -170,10 +170,12 @@
"hintKeywordsSeparatedBySpaces": "Mots-clés séparés par des espaces",
"questions": "Questions",
"view-questions": "Voir les questions dans ",
- "question-input-placeholder": "question...",
- "answer-input-placeholder": "réponse...",
+ "question-input-placeholder": "Votre question...",
+ "answer-input-placeholder": "Votre réponse...",
"answers-toggle-hide": "Masquer réponses",
"answers-toggle-show": "Afficher réponse",
"no-questions": "Aucune question trouvée",
- "no-discussion-tip": "Sélectionnez un objet d'apprentissage pour afficher les questions qui s'y rapportent"
+ "no-discussion-tip": "Sélectionnez un objet d'apprentissage pour afficher les questions qui s'y rapportent",
+ "askAQuestion": "Pose une question",
+ "questionsCapitalized": "Questions"
}
diff --git a/frontend/src/i18n/locale/nl.json b/frontend/src/i18n/locale/nl.json
index acc19cca..c3aaf111 100644
--- a/frontend/src/i18n/locale/nl.json
+++ b/frontend/src/i18n/locale/nl.json
@@ -169,10 +169,12 @@
"hintKeywordsSeparatedBySpaces": "Trefwoorden gescheiden door spaties",
"questions": "vragen",
"view-questions": "Bekijk vragen in ",
- "question-input-placeholder": "vraag...",
- "answer-input-placeholder": "antwoord...",
+ "question-input-placeholder": "Uw vraag...",
+ "answer-input-placeholder": "Uw antwoord...",
"answers-toggle-hide": "Verberg antwoorden",
"answers-toggle-show": "Toon antwoorden",
"no-questions": "Nog geen vragen gesteld",
- "no-discussion-tip": "Kies een leerobject om zijn vragen te bekijken"
+ "no-discussion-tip": "Kies een leerobject om zijn vragen te bekijken",
+ "askAQuestion": "Stel een vraag",
+ "questionsCapitalized": "Vragen"
}
diff --git a/frontend/src/views/discussions/SingleDiscussion.vue b/frontend/src/views/discussions/SingleDiscussion.vue
index cd6e4b64..698b5688 100644
--- a/frontend/src/views/discussions/SingleDiscussion.vue
+++ b/frontend/src/views/discussions/SingleDiscussion.vue
@@ -15,6 +15,9 @@
import type { QuestionDTO } from "@dwengo-1/common/interfaces/question";
import DiscussionsSideBar from "@/components/DiscussionsSideBar.vue";
import QuestionBox from "@/components/QuestionBox.vue";
+ import { useI18n } from "vue-i18n";
+
+ const { t } = useI18n();
const route = useRoute();
@@ -120,21 +123,29 @@
-
-
-
-
+
+
+
{{ t("questionsCapitalized") }}:
+
+
+
+