From b06014bc6962822c2cb284ac68cc928b4b2763a1 Mon Sep 17 00:00:00 2001 From: SJost Date: Fri, 13 Jul 2018 12:05:10 +0200 Subject: [PATCH 1/3] Minor typos in feature List --- templates/featureList.hamlet | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/featureList.hamlet b/templates/featureList.hamlet index 8b0ddc647..7b9f151c3 100644 --- a/templates/featureList.hamlet +++ b/templates/featureList.hamlet @@ -9,10 +9,12 @@
  • Studiengänge von Benutzern werden noch ignoriert
  • Übungsgruppen
  • Klausuren +
  • Zentralanmeldungen
  • neue geplante Features:
      -
    • Studenplan/Kalender +
    • Stundenplan/Kalender
    • Vollständige Vorlesungshomepages
    • Vollständige Internationalisierung deutsch/englisch/... + From 1c78032f1e5a795d3772564c6db8f76b1b5d3c71 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Jul 2018 10:01:29 +0200 Subject: [PATCH 2/3] Additional information in rating files --- src/Handler/Utils/Rating.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Handler/Utils/Rating.hs b/src/Handler/Utils/Rating.hs index dfe7845c3..2bb15c23f 100644 --- a/src/Handler/Utils/Rating.hs +++ b/src/Handler/Utils/Rating.hs @@ -68,6 +68,8 @@ instance Pretty x => Pretty (CI x) where data Rating = Rating { ratingCourseName :: Text , ratingSheetName :: Text + , ratingCorrectorName :: Maybe Text + , ratingSheetType :: SheetType , ratingValues :: Rating' } deriving (Read, Show, Eq, Generic, Typeable) @@ -89,15 +91,18 @@ instance Exception RatingException getRating :: SubmissionId -> YesodDB UniWorX (Maybe Rating) getRating submissionId = runMaybeT $ do - let query = E.select . E.from $ \(submission `E.InnerJoin` sheet `E.InnerJoin` course) -> do + let query = E.select . E.from $ \(corrector `E.RightOuterJoin` (submission `E.InnerJoin` sheet `E.InnerJoin` course)) -> do E.on $ course E.^. CourseId E.==. sheet E.^. SheetCourse E.on $ sheet E.^. SheetId E.==. submission E.^. SubmissionSheet + E.on $ corrector E.?. UserId E.==. submission E.^. SubmissionRatingBy E.where_ $ submission E.^. SubmissionId E.==. E.val submissionId -- Yes, we can only pass a tuple through 'E.select' return ( course E.^. CourseName , sheet E.^. SheetName + , corrector E.?. UserDisplayName + , sheet E.^. SheetType , submission E.^. SubmissionRatingPoints , submission E.^. SubmissionRatingComment , submission E.^. SubmissionRatingTime @@ -105,6 +110,8 @@ getRating submissionId = runMaybeT $ do [ ( E.unValue -> ratingCourseName , E.unValue -> ratingSheetName + , E.unValue -> ratingCorrectorName + , E.unValue -> ratingSheetType , E.unValue -> ratingPoints , E.unValue -> ratingComment , E.unValue -> ratingTime @@ -117,12 +124,14 @@ formatRating cID Rating{ ratingValues = Rating'{..}, ..} = let doc = renderPretty 1 45 $ foldr (<$$>) mempty [ "= Bitte nur Bewertung und Kommentare ändern =" , "=============================================" - , "========== Uni2work Bewertungsdatei ==========" + , "========== Uni2work Bewertungsdatei =========" , "======= diese Datei ist UTF8 encodiert ======" , "Informationen zum Übungsblatt:" - , indent 2 $ foldr (<$$>) mempty - [ "Veranstaltung:" <+> pretty ratingCourseName - , "Blatt:" <+> pretty ratingSheetName + , indent 2 . foldr (<$$>) mempty . catMaybes $ + [ Just $ "Veranstaltung:" <+> pretty ratingCourseName + , Just $ "Blatt:" <+> pretty ratingSheetName + , ("Korrektor:" <+>) . pretty <$> ratingCorrectorName + , Just $ "Bewertung:" <+> pretty (display ratingSheetType) ] , "Abgabe-Id:" <+> pretty (ciphertext cID) , "=============================================" From e28a0aa851f0f35a1308d10ef05cbff4a251a7e2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Jul 2018 10:05:06 +0200 Subject: [PATCH 3/3] Set .logged-in --- src/Foundation.hs | 2 ++ templates/default-layout-wrapper.hamlet | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 90fb562c2..51062691d 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -478,6 +478,8 @@ instance Yesod UniWorX where menuTypes <- filterM (menuItemAccessCallback . menuItem) menu + isAuth <- isJust <$> maybeAuthId + -- Lookup Favourites & Theme if possible -- TODO: cache this info in a cookie?! (favourites',show -> currentTheme) <- do muid <- maybeAuthPair diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 4eb2fd2c0..d963d1431 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -39,7 +39,7 @@ $newline never } - +