diff --git a/messages/faq/de-de-formal.msg b/messages/faq/de-de-formal.msg index c8f5976fe..67db65216 100644 --- a/messages/faq/de-de-formal.msg +++ b/messages/faq/de-de-formal.msg @@ -1,3 +1,5 @@ FAQNoCampusAccount: Ich habe keine LMU-Benutzerkennung (ehem. Campus-Kennung); kann ich trotzdem Zugang zum System erhalten? FAQForgottenPassword: Ich habe mein Passwort vergessen -FAQCampusCantLogin: Ich kann mich mit meiner LMU-Benutzerkennung (ehem. Campus-Kennung) nicht anmelden \ No newline at end of file +FAQCampusCantLogin: Ich kann mich mit meiner LMU-Benutzerkennung (ehem. Campus-Kennung) nicht anmelden +FAQCourseCorrectorsTutors: Wie kann ich Tutoren oder Korrektoren für meinen Kurs einstellen? +FAQNotLecturerHowToCreateCourses: Wie kann ich einen neuen Kurs anlegen? \ No newline at end of file diff --git a/messages/faq/en-eu.msg b/messages/faq/en-eu.msg index 98cfc6b1e..7c0c3d80e 100644 --- a/messages/faq/en-eu.msg +++ b/messages/faq/en-eu.msg @@ -1,3 +1,5 @@ FAQNoCampusAccount: I don't have a LMU user ID (formerly Campus-ID); can I still get access to Uni2work? FAQForgottenPassword: I have forgotten my password FAQCampusCantLogin: I can't log in using my LMU user ID (formerly Campus-ID) +FAQCourseCorrectorsTutors: How can I add tutors or correctors to my course? +FAQNotLecturerHowToCreateCourses: How can I create new courses? diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 3fc27849b..744cd9cb7 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -1075,6 +1075,10 @@ HelpRequest: Support request / Suggestion HelpProblemPage: Problematic page HelpIntroduction: If you have trouble using this website or if you find something that could be improved, please contact us even if you were already able to solve your problem by yourself! We are continually making changes and try to keep the site as intuitive as possible even for new users. HelpSent: Your support request has been sent. +HelpSendLastError: Attach last error message +HelpError: Last error message +HelpErrorYamlFilename mailId: error-#{toPathPiece mailId}.yaml +HelpErrorOrRequestRequired: Please attach either the last error message or submit a support request or a suggestion InfoLecturerTitle: Information for lecturers diff --git a/missing-translations.sh b/missing-translations.sh index cd061c6a5..558d027bb 100755 --- a/missing-translations.sh +++ b/missing-translations.sh @@ -124,28 +124,45 @@ for templateDirectory (templates/i18n/**/*(FN)); do fi done + typeset -a templatePrefixes + templatePrefixes=() + for templateFile (${templateFiles}); do + [[ ${templateFile:h} == ${templateDirectory} ]] || continue + + templatePrefix=$(sed -r 's/^(.*\.)?[^.]+\.[^.]+$/\1/' <<<"${templateFile:t}") + + if ! ((${templatePrefixes[(Ie)${templatePrefix}]})); then + templatePrefixes+=("${templatePrefix}") + fi + done + + # printf "%d %s\n" ${#templatePrefixes} "${templatePrefixes}" + for ext (${templateExtensions}); do for lang (${requiredLangs}); do - # printf ">> %s %s\n" ${ext} ${lang} - - foundLang=0 - for templateFile (${templateDirectory}/*.${ext}); do - # printf "%s\n" ${templateFile} - [[ ${templateFile:t} =~ "(^|\.)${lang}[-.]" ]] || continue - foundLang=1 - break - done - - # printf ">> %s\n" ${foundLang} - - if [[ $foundLang -ne 1 ]]; then - templateDifference=1 - [[ $fix != 0 ]] && printf "%s: %s (%s)\n" $templateDirectory $lang $ext - - if [[ $fix == 0 ]]; then - ./translate.hs dir $templateDirectory && templateDifference=0 - fi - fi + for prefix (${templatePrefixes}); do + # printf ">> %s %s %s\n" ${prefix} ${lang} ${ext} + + foundLang=1 + for templateFile (${templateDirectory}/*.${ext}); do + # printf "%s\n" ${templateFile} + [[ ${templateFile:t} =~ "^${prefix}${lang}[-.]" ]] || continue + # printf "match\n" + foundLang=0 + break + done + + # printf ">> %s\n" ${foundLang} + + if [[ $foundLang -ne 0 ]]; then + templateDifference=1 + [[ $fix != 0 ]] && printf "%s: %s*.%s (%s)\n" $templateDirectory $prefix $ext $lang + + if [[ $fix == 0 ]]; then + ./translate.hs dir $templateDirectory && templateDifference=0 + fi + fi + done done done done diff --git a/src/Handler/Info.hs b/src/Handler/Info.hs index 36d8657d3..0414808ca 100644 --- a/src/Handler/Info.hs +++ b/src/Handler/Info.hs @@ -90,7 +90,9 @@ getGlossaryR = mkFaqItems "faq" mkMessageFor "UniWorX" "FAQItem" "messages/faq" "de-de-formal" -faqsWidget :: ( MonadHandler m, HandlerSite m ~ UniWorX ) +faqsWidget :: ( MonadHandler m, HandlerSite m ~ UniWorX + , MonadThrow m + ) => Maybe Natural -> Maybe (Route UniWorX) -> m (Maybe Widget, Bool) faqsWidget mLimit route = do faqs <- for route $ \route' -> filterM (showFAQ route') universeF @@ -137,17 +139,29 @@ getFaqR = fromMaybe mempty . view _1 =<< faqsWidget Nothing Nothing -showFAQ :: ( MonadHandler m, HandlerSite m ~ UniWorX ) +showFAQ :: ( MonadHandler m, HandlerSite m ~ UniWorX + , MonadThrow m + ) => Route UniWorX -> FAQItem -> m Bool showFAQ _ FAQNoCampusAccount = is _Nothing <$> maybeAuthId showFAQ (AuthR _) FAQCampusCantLogin = return True showFAQ _ FAQCampusCantLogin = is _Nothing <$> maybeAuthId showFAQ (AuthR _) FAQForgottenPassword = return True showFAQ _ FAQForgottenPassword = is _Nothing <$> maybeAuthId --- showFAQ _ _ = return False +showFAQ _ FAQNotLecturerHowToCreateCourses + = and2M (is _Just <$> maybeAuthId) + (not <$> hasWriteAccessTo CourseNewR) +showFAQ (CourseR tid ssh csh _) FAQCourseCorrectorsTutors + = and2M (is _Just <$> maybeAuthId) + (or2M (hasWriteAccessTo $ CourseR tid ssh csh SheetNewR) + (hasWriteAccessTo $ CourseR tid ssh csh CTutorialNewR) + ) +showFAQ _ _ = return False prioFAQ :: Monad m => Route UniWorX -> FAQItem -> m Rational prioFAQ _ FAQNoCampusAccount = return 1 prioFAQ _ FAQCampusCantLogin = return 1 prioFAQ _ FAQForgottenPassword = return 1 +prioFAQ _ FAQNotLecturerHowToCreateCourses = return 1 +prioFAQ _ FAQCourseCorrectorsTutors = return 1 diff --git a/templates/i18n/faq/course-correctors-tutors.de-de-formal.hamlet b/templates/i18n/faq/course-correctors-tutors.de-de-formal.hamlet new file mode 100644 index 000000000..725e25674 --- /dev/null +++ b/templates/i18n/faq/course-correctors-tutors.de-de-formal.hamlet @@ -0,0 +1,5 @@ +$newline never +
+ Tutoren und Korrektoren werden beim Anlegen oder Editieren des # + jeweiligen Tutoriums bzw. Übungsblattes angegeben. + diff --git a/templates/i18n/faq/course-correctors-tutors.en-eu.hamlet b/templates/i18n/faq/course-correctors-tutors.en-eu.hamlet new file mode 100644 index 000000000..4b5ad5e82 --- /dev/null +++ b/templates/i18n/faq/course-correctors-tutors.en-eu.hamlet @@ -0,0 +1,4 @@ +$newline never +
+ Tutors and correctors are assigned when creating or editing the # + respective tutorial or exercise sheet. diff --git a/templates/i18n/faq/not-lecturer-how-to-create-courses.de-de-formal.hamlet b/templates/i18n/faq/not-lecturer-how-to-create-courses.de-de-formal.hamlet new file mode 100644 index 000000000..ee4c66c89 --- /dev/null +++ b/templates/i18n/faq/not-lecturer-how-to-create-courses.de-de-formal.hamlet @@ -0,0 +1,6 @@ +$newline never +
+ Die Berechtigung neue Kurse anzulegen wird manuell eingeräumt.
+
+ Wenden Sie sich dafür über das Hilfe-Formular, #
+ oben rechts auf jeder Seite, an die Uni2work-Administration.
diff --git a/templates/i18n/faq/not-lecturer-how-to-create-courses.en-eu.hamlet b/templates/i18n/faq/not-lecturer-how-to-create-courses.en-eu.hamlet
new file mode 100644
index 000000000..57f45eab2
--- /dev/null
+++ b/templates/i18n/faq/not-lecturer-how-to-create-courses.en-eu.hamlet
@@ -0,0 +1,6 @@
+$newline never
+
+ The permission to create new courses is granted manually.
+
+ Please use the Support form (at the top right #
+ of every page) to contact a Uni2work-administrator.