refactor(firm): fix build too
This commit is contained in:
parent
c5c4a62de0
commit
400a3449c5
@ -3,6 +3,8 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
FirmAssociates: Firmenangehörige
|
FirmAssociates: Firmenangehörige
|
||||||
|
FirmContact: Firmenkontakt
|
||||||
|
FirmNoContact: Keine allgemeinen Kontaktinformationen bekannt.
|
||||||
FirmEmail: Allgemeine Email
|
FirmEmail: Allgemeine Email
|
||||||
FirmAddress: Postanschrift
|
FirmAddress: Postanschrift
|
||||||
FirmDefaultPreferenceInfo: Diese Voreinstellungen gelten nur für neue Firmenangehörige
|
FirmDefaultPreferenceInfo: Diese Voreinstellungen gelten nur für neue Firmenangehörige
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
FirmAssociates: Company associated users
|
FirmAssociates: Company associated users
|
||||||
|
FirmContact: Company Contact
|
||||||
|
FirmNoContact: No general contact information known.
|
||||||
FirmEmail: General company email
|
FirmEmail: General company email
|
||||||
FirmAddress: Postal address
|
FirmAddress: Postal address
|
||||||
FirmDefaultPreferenceInfo: Default setting for new company associates only
|
FirmDefaultPreferenceInfo: Default setting for new company associates only
|
||||||
|
|||||||
@ -806,6 +806,7 @@ postFirmUsersR fsh = do
|
|||||||
|
|
||||||
siteLayout (citext2widget companyName) $ do
|
siteLayout (citext2widget companyName) $ do
|
||||||
setTitle $ toHtml $ CI.original companyShorthand <> "-" <> tshow companyAvsId
|
setTitle $ toHtml $ CI.original companyShorthand <> "-" <> tshow companyAvsId
|
||||||
|
let firmContactInfo = $(widgetFile "firm-contact-info")
|
||||||
$(widgetFile "firm-users")
|
$(widgetFile "firm-users")
|
||||||
|
|
||||||
|
|
||||||
@ -1053,6 +1054,7 @@ postFirmSupersR fsh = do
|
|||||||
|
|
||||||
siteLayout (citext2widget fsh) $ do
|
siteLayout (citext2widget fsh) $ do
|
||||||
setTitle $ citext2Html $ fsh <> " Supers"
|
setTitle $ citext2Html $ fsh <> " Supers"
|
||||||
|
let firmContactInfo = $(widgetFile "firm-contact-info")
|
||||||
$(i18nWidgetFile "firm-supervisors")
|
$(i18nWidgetFile "firm-supervisors")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -475,11 +475,11 @@ serveProfileR (uid, user@User{..}) = do
|
|||||||
, UserWarningDays =. stgWarningDays
|
, UserWarningDays =. stgWarningDays
|
||||||
, UserNotificationSettings =. stgNotificationSettings
|
, UserNotificationSettings =. stgNotificationSettings
|
||||||
, UserShowSex =. stgShowSex
|
, UserShowSex =. stgShowSex
|
||||||
, UserPinPassword =. stgPinPassword -- TODO & canonical
|
, UserPinPassword =. (stgPinPassword & canonical)
|
||||||
, UserPostAddress =. stgPostAddress -- TODO & canonical
|
, UserPostAddress =. (stgPostAddress & canonical)
|
||||||
, UserPrefersPostal =. stgPrefersPostal
|
, UserPrefersPostal =. stgPrefersPostal
|
||||||
, UserTelephone =. stgTelephone & canonical
|
, UserTelephone =. (stgTelephone & canonical)
|
||||||
, UserMobile =. stgMobile & canonical
|
, UserMobile =. (stgMobile & canonical)
|
||||||
, UserExamOfficeGetSynced =. (stgExamOfficeSettings & eosettingsGetSynced)
|
, UserExamOfficeGetSynced =. (stgExamOfficeSettings & eosettingsGetSynced)
|
||||||
, UserExamOfficeGetLabels =. (stgExamOfficeSettings & eosettingsGetLabels)
|
, UserExamOfficeGetLabels =. (stgExamOfficeSettings & eosettingsGetLabels)
|
||||||
]
|
]
|
||||||
|
|||||||
@ -50,6 +50,13 @@ data StoredMarkup = StoredMarkup
|
|||||||
deriving (Read, Show, Generic)
|
deriving (Read, Show, Generic)
|
||||||
deriving anyclass (Binary, Hashable, NFData)
|
deriving anyclass (Binary, Hashable, NFData)
|
||||||
|
|
||||||
|
instance Canonical (Maybe StoredMarkup) where
|
||||||
|
canonical Nothing = Nothing
|
||||||
|
canonical r@(Just s@StoredMarkup{..}) = let mi' = LT.strip markupInput in if
|
||||||
|
| LT.null mi' -> Nothing
|
||||||
|
| markupInput == mi' -> r
|
||||||
|
| otherwise -> Just s{markupInput = mi'}
|
||||||
|
|
||||||
htmlToStoredMarkup :: Html -> StoredMarkup
|
htmlToStoredMarkup :: Html -> StoredMarkup
|
||||||
htmlToStoredMarkup html = StoredMarkup
|
htmlToStoredMarkup html = StoredMarkup
|
||||||
{ markupInputFormat = MarkupHtml
|
{ markupInputFormat = MarkupHtml
|
||||||
|
|||||||
11
src/Utils.hs
11
src/Utils.hs
@ -1987,8 +1987,9 @@ instance {-# OVERLAPPABLE #-} (Canonical mono, MonoFoldable mono, Eq mono) => Ca
|
|||||||
instance (Ord a, Canonical a) => Canonical (Set a) where
|
instance (Ord a, Canonical a) => Canonical (Set a) where
|
||||||
canonical = Set.map canonical
|
canonical = Set.map canonical
|
||||||
|
|
||||||
instance Canonical (Maybe Text) where
|
instance Canonical (Maybe Text) where -- a split into Canonical Text and Canonical a => Maybe seems nicer, but the latter instance would be troublesome
|
||||||
canonical Nothing = Nothing
|
canonical Nothing = Nothing
|
||||||
canonical (Just t) =
|
canonical r@(Just t) = let t' = Text.strip t in if
|
||||||
let t' = Text.strip t
|
| Text.null t' -> Nothing
|
||||||
in if Text.null t' then Nothing else Just t'
|
| t == t' -> r
|
||||||
|
| otherwise -> Just t'
|
||||||
|
|||||||
23
templates/firm-contact-info.hamlet
Normal file
23
templates/firm-contact-info.hamlet
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
$newline never
|
||||||
|
|
||||||
|
$# SPDX-FileCopyrightText: 2023 Steffen Jost <jost@tcs.ifi.lmu.de>
|
||||||
|
$#
|
||||||
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
<section .profile>
|
||||||
|
<h2>_{MsgFirmContact}
|
||||||
|
<dl .deflist.profile-dl>
|
||||||
|
$maybe fem <- companyEmail
|
||||||
|
<dt .deflist__dt>
|
||||||
|
_{MsgFirmEmail} #{iconLetterOrEmail False}
|
||||||
|
<dd .deflist__dd .email>
|
||||||
|
#{mailtoHtml fem}
|
||||||
|
$maybe addr <- companyPostAddress
|
||||||
|
<dt .deflist__dt>
|
||||||
|
_{MsgFirmAddress} #{iconLetterOrEmail True}
|
||||||
|
<dd .deflist__dd>
|
||||||
|
#{addr}
|
||||||
|
$nothing
|
||||||
|
$maybe _ <- companyEmail
|
||||||
|
$nothing
|
||||||
|
_{MsgFirmNoContact}
|
||||||
@ -4,18 +4,7 @@ $# SPDX-FileCopyrightText: 2023 Steffen Jost <jost@tcs.ifi.lmu.de>
|
|||||||
$#
|
$#
|
||||||
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
<section .profile>
|
^{firmContactInfo}
|
||||||
<dl .deflist.profile-dl>
|
|
||||||
$maybe fem <- companyEmail
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmEmail} #{iconLetterOrEmail False}
|
|
||||||
<dd .deflist__dd .email>
|
|
||||||
#{mailtoHtml fem}
|
|
||||||
$maybe addr <- companyPostAddress
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmAddress} #{iconLetterOrEmail True}
|
|
||||||
<dd .deflist__dd>
|
|
||||||
#{addr}
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<div .scrolltable .scrolltable--bordered>
|
<div .scrolltable .scrolltable--bordered>
|
||||||
|
|||||||
@ -9,19 +9,11 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
Daraus folgt zum Beispiel, dass wenn <em>x</em> ein Standard-Ansprechpartner für Firma <em>a</em> ist
|
Daraus folgt zum Beispiel, dass wenn <em>x</em> ein Standard-Ansprechpartner für Firma <em>a</em> ist
|
||||||
und wenn <em>y</em> sowohl Firma <em>a</em> als auch <em>b</em> angehört,
|
und wenn <em>y</em> sowohl Firma <em>a</em> als auch <em>b</em> angehört,
|
||||||
dass dann <em>x</em> als firmenfremd in der Liste der Ansprechpartner von Firma <em>b</em> angezeigt wird.
|
dass dann <em>x</em> als firmenfremd in der Liste der Ansprechpartner von Firma <em>b</em> angezeigt wird.
|
||||||
<section .profile>
|
|
||||||
<dl .deflist.profile-dl>
|
^{firmContactInfo}
|
||||||
$maybe fem <- companyEmail
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmEmail} #{iconLetterOrEmail False}
|
|
||||||
<dd .deflist__dd .email>
|
|
||||||
#{mailtoHtml fem}
|
|
||||||
$maybe addr <- companyPostAddress
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmAddress} #{iconLetterOrEmail True}
|
|
||||||
<dd .deflist__dd>
|
|
||||||
#{addr}
|
|
||||||
<section>
|
<section>
|
||||||
^{fsprTable}
|
^{fsprTable}
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
^{addSuperForm}
|
^{addSuperForm}
|
||||||
@ -8,19 +8,11 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
Note that supervision is company independent.
|
Note that supervision is company independent.
|
||||||
For example, if <em>x</em> is a regular supervisor for company <em>a</em> and <em>y</em> belongs to companies <em>a</em> and <em>b</em>,
|
For example, if <em>x</em> is a regular supervisor for company <em>a</em> and <em>y</em> belongs to companies <em>a</em> and <em>b</em>,
|
||||||
then <em>x</em> will be listed as a foreign supervisor for company <em>b</em>.
|
then <em>x</em> will be listed as a foreign supervisor for company <em>b</em>.
|
||||||
<section .profile>
|
|
||||||
<dl .deflist.profile-dl>
|
^{firmContactInfo}
|
||||||
$maybe fem <- companyEmail
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmEmail} #{iconLetterOrEmail False}
|
|
||||||
<dd .deflist__dd .email>
|
|
||||||
#{mailtoHtml fem}
|
|
||||||
$maybe addr <- companyPostAddress
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgFirmAddress} #{iconLetterOrEmail True}
|
|
||||||
<dd .deflist__dd>
|
|
||||||
#{addr}
|
|
||||||
<section>
|
<section>
|
||||||
^{fsprTable}
|
^{fsprTable}
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
^{addSuperForm}
|
^{addSuperForm}
|
||||||
|
|||||||
Reference in New Issue
Block a user