From 56c23ebd3361fc16bb1edf5c06688d97b49ec4c3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 28 Aug 2020 14:00:35 +0200 Subject: [PATCH] style: minor frontend cleanup wrt. monospace fonts --- frontend/src/_common.sass | 2 +- frontend/src/app.sass | 25 +++++++++++-------- frontend/src/utils/form/datepicker.css | 4 +-- frontend/src/utils/inputs/inputs.sass | 2 +- package-lock.json | 5 ++++ package.json | 1 + src/Foundation/Yesod/ErrorHandler.hs | 13 +++------- src/Handler/Admin/ErrorMessage.hs | 3 ++- src/Handler/Admin/Test.hs | 2 +- src/Handler/Health.hs | 4 +-- .../lecturerMassInput/cellInvitation.hamlet | 2 +- templates/external-exam-show.hamlet | 2 +- .../staffMassInput/cellInvitation.hamlet | 2 +- templates/mail/support.hamlet | 6 ++++- templates/mail/userAuthModeUpdate.hamlet | 9 +++++-- .../courseInvitationAlreadyRegistered.hamlet | 3 ++- ...rseInvitationRegisteredWithoutField.hamlet | 3 ++- ...nvitationNotRegisteredWithoutCourse.hamlet | 3 ++- ...ionInvitationRegisteredWithoutField.hamlet | 3 ++- .../messages/submissionFilesIgnored.hamlet | 5 ++-- templates/metrics.hamlet | 16 ++++++++---- .../tutorMassInput/cellInvitation.hamlet | 2 +- templates/widgets/email.hamlet | 2 +- templates/widgets/genericFileField.hamlet | 3 ++- .../examCorrectors/cellInvitation.hamlet | 2 +- .../examOfficeUsers/cellInvitation.hamlet | 2 +- .../submissionUsers/cellInvitation.hamlet | 2 +- templates/widgets/specificFileField.hamlet | 3 ++- templates/widgets/zipFileField.hamlet | 3 ++- 29 files changed, 81 insertions(+), 53 deletions(-) diff --git a/frontend/src/_common.sass b/frontend/src/_common.sass index cf4fab2cf..00bf18dfe 100644 --- a/frontend/src/_common.sass +++ b/frontend/src/_common.sass @@ -5,5 +5,5 @@ @use "~@fortawesome/fontawesome-pro/scss/solid" @use "~typeface-roboto" as roboto - @use "~typeface-source-sans-pro" as source-sans-pro +@use "~typeface-source-code-pro" as source-code-pro diff --git a/frontend/src/app.sass b/frontend/src/app.sass index ae859585b..56f4d7028 100644 --- a/frontend/src/app.sass +++ b/frontend/src/app.sass @@ -22,6 +22,7 @@ // FONTS --font-base: "Source Sans Pro", "Trebuchet MS", sans-serif --font-logo: "Roboto", var(--font-base) + --font-monospace: "Source Code Pro", monospace // DIMENSIONS --header-height: 100px @@ -585,9 +586,6 @@ section border-bottom: none padding-bottom: 0px -.pseudonym - font-family: monospace - .headline-one margin-bottom: 10px @@ -717,8 +715,13 @@ section background-color: hsla($hue, 75%, 50%, $opacity) !important -.uuid - font-family: monospace +.uuid, .pseudonym, .ldap-primary-key, .email, .file-path, .metric-value, .metric-label + font-family: var(--font-monospace) + +.token + font-family: var(--font-monospace) + white-space: pre-wrap + word-break: break-all .form--inline display: inline-block @@ -832,7 +835,7 @@ section .comment, .literal-error white-space: pre-wrap - font-family: monospace + font-family: var(--font-monospace) th vertical-align: top @@ -1099,12 +1102,12 @@ th, td #changelog font-size: 14px white-space: pre-wrap - font-family: monospace + font-family: var(--font-monospace) #gitrev font-size: 12px white-space: pre-wrap - font-family: monospace + font-family: var(--font-monospace) .breadcrumbs__container position: relative @@ -1225,12 +1228,12 @@ a.breadcrumbs__home top: 5px .table__td--csv, .table__th--csv - font-family: monospace + font-family: var(--font-monospace) .confirmationText white-space: pre-wrap font-size: 14px - font-family: monospace + font-family: var(--font-monospace) .func-field__wrapper, .allocation-missing-prios, .allocation-users__accept, .corrections-overview__section max-height: 75vh @@ -1295,7 +1298,7 @@ a.breadcrumbs__home .csv-parse-error white-space: pre-wrap - font-family: monospace + font-family: var(--font-monospace) overflow: auto max-height: 75vh diff --git a/frontend/src/utils/form/datepicker.css b/frontend/src/utils/form/datepicker.css index 7c1172da1..b052a1e7c 100644 --- a/frontend/src/utils/form/datepicker.css +++ b/frontend/src/utils/form/datepicker.css @@ -29,7 +29,7 @@ visibility: hidden; direction: ltr; border-collapse: separate; - font-family: "Open Sans", Calibri, Arial, sans-serif; + /* font-family: "Open Sans", Calibri, Arial, sans-serif; */ background-color: white; border-width: 0; border-style: solid; @@ -724,4 +724,4 @@ } /* @end RTL */ -/*# sourceMappingURL=tail.datetime-default-green.map */ \ No newline at end of file +/*# sourceMappingURL=tail.datetime-default-green.map */ diff --git a/frontend/src/utils/inputs/inputs.sass b/frontend/src/utils/inputs/inputs.sass index 374d37189..022efa71d 100644 --- a/frontend/src/utils/inputs/inputs.sass +++ b/frontend/src/utils/inputs/inputs.sass @@ -235,7 +235,7 @@ option padding-bottom: 0 .file-input__list-item - font-family: monospace + font-family: var(--font-monospace) font-size: 15px // PREVIOUSLY UPLOADED FILES diff --git a/package-lock.json b/package-lock.json index 220155f3f..ed5bc0fea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20773,6 +20773,11 @@ "integrity": "sha512-VrR/IiH00Z1tFP4vDGfwZ1esNqTiDMchBEXYY9kilT6wRGgFoCAlgkEUMHb1E3mB0FsfZhv756IF0+R+SFPfdg==", "dev": true }, + "typeface-source-code-pro": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/typeface-source-code-pro/-/typeface-source-code-pro-1.1.3.tgz", + "integrity": "sha512-BAQ8I7Xy5zS5+KuG+gjRPNYCdfwL8vSF9jT8q9wzCRiiOG4h7id5zt8wcQx59riGRbRsgycRfs/ubyAm2z/FJQ==" + }, "typeface-source-sans-pro": { "version": "0.0.75", "resolved": "https://registry.npmjs.org/typeface-source-sans-pro/-/typeface-source-sans-pro-0.0.75.tgz", diff --git a/package.json b/package.json index 06e071f99..8fc0589ff 100644 --- a/package.json +++ b/package.json @@ -109,6 +109,7 @@ "tmp": "^0.1.0", "typeface-roboto": "0.0.75", "typeface-source-sans-pro": "0.0.75", + "typeface-source-code-pro": "^1.1.3", "webpack": "^4.44.1", "webpack-cli": "^3.3.12", "webpack-manifest-plugin": "^2.2.0", diff --git a/src/Foundation/Yesod/ErrorHandler.hs b/src/Foundation/Yesod/ErrorHandler.hs index 025b4098d..f24a7ea85 100644 --- a/src/Foundation/Yesod/ErrorHandler.hs +++ b/src/Foundation/Yesod/ErrorHandler.hs @@ -44,29 +44,24 @@ errorHandler err = do [whamlet|

_{MsgErrorResponseEncrypted} -

+                  
                     #{ciphertext}
                 |]
             | otherwise -> plaintext
 
         errPage = case err of
           NotFound -> [whamlet|

_{MsgErrorResponseNotFound}|] - InternalError err' -> encrypted err' [whamlet|

#{err'}|] + InternalError err' -> encrypted err' [whamlet|

#{err'}|] InvalidArgs errs -> [whamlet|

    $forall err' <- errs -
  • #{err'} +
  • + #{err'} |] NotAuthenticated -> [whamlet|

    _{MsgErrorResponseNotAuthenticated}|] PermissionDenied err' -> [whamlet|

    #{err'}|] BadMethod method -> [whamlet|

    _{MsgErrorResponseBadMethod (decodeUtf8 method)}|] siteLayout (toWgt . mr $ ErrorResponseTitle err) $ do - toWidget - [cassius| - .errMsg - white-space: pre-wrap - font-family: monospace - |] errPage provideRep . fmap PrettyValue $ case err of PermissionDenied err' -> return $ object [ "message" JSON..= err' ] diff --git a/src/Handler/Admin/ErrorMessage.hs b/src/Handler/Admin/ErrorMessage.hs index 64d0d538c..681388175 100644 --- a/src/Handler/Admin/ErrorMessage.hs +++ b/src/Handler/Admin/ErrorMessage.hs @@ -18,8 +18,9 @@ postAdminErrMsgR = do let ctView' = wrapForm ctView def{ formAction = Just . SomeRoute $ AdminErrMsgR, formEncoding = ctEncoding } defaultLayout [whamlet| + $newline never $maybe t <- plaintext -

    +        
               $case t
                 $of String t'
                   #{t'}
    diff --git a/src/Handler/Admin/Test.hs b/src/Handler/Admin/Test.hs
    index 645152b0e..fdfe301ec 100644
    --- a/src/Handler/Admin/Test.hs
    +++ b/src/Handler/Admin/Test.hs
    @@ -224,7 +224,7 @@ postAdminTestR = do
                 $forall err <- errs
                   
  • #{err} $of FormSuccess res -

    +

    #{tshow res} |] diff --git a/src/Handler/Health.hs b/src/Handler/Health.hs index 72a04eee4..050644330 100644 --- a/src/Handler/Health.hs +++ b/src/Handler/Health.hs @@ -88,9 +88,9 @@ getInstanceR = do $newline never

    _{MsgClusterId} -
    #{UUID.toText clusterId} +
    #{UUID.toText clusterId}
    _{MsgInstanceId} -
    #{UUID.toText instanceId} +
    #{UUID.toText instanceId} |] provideJson instanceInfo provideRep . return $ tshow instanceInfo diff --git a/templates/course/lecturerMassInput/cellInvitation.hamlet b/templates/course/lecturerMassInput/cellInvitation.hamlet index 6e95bcf1f..24e43a5a7 100644 --- a/templates/course/lecturerMassInput/cellInvitation.hamlet +++ b/templates/course/lecturerMassInput/cellInvitation.hamlet @@ -1,7 +1,7 @@ $newline never #{csrf} - + #{lEmail} ^{messageTooltip invWarnMsg} diff --git a/templates/external-exam-show.hamlet b/templates/external-exam-show.hamlet index e9fbf5c95..9604f7be4 100644 --- a/templates/external-exam-show.hamlet +++ b/templates/external-exam-show.hamlet @@ -51,6 +51,6 @@ $maybe ExternalExamResult{externalExamResultResult} <- mResult
  • ^{nameEmailWidget userDisplayEmail userDisplayName userSurname} $of Left email -
  • +
  • #{email} diff --git a/templates/external-exam/staffMassInput/cellInvitation.hamlet b/templates/external-exam/staffMassInput/cellInvitation.hamlet index df7df418a..284762127 100644 --- a/templates/external-exam/staffMassInput/cellInvitation.hamlet +++ b/templates/external-exam/staffMassInput/cellInvitation.hamlet @@ -1,6 +1,6 @@ $newline never - + #{email} ^{messageTooltip invWarnMsg} diff --git a/templates/mail/support.hamlet b/templates/mail/support.hamlet index 623ba907f..f85790925 100644 --- a/templates/mail/support.hamlet +++ b/templates/mail/support.hamlet @@ -3,6 +3,10 @@ $newline never +