TermHoliday Placeholder
This commit is contained in:
parent
f5fb82de3e
commit
066328c56c
@ -45,6 +45,7 @@ TermStartDayTooltip: Üblicherweise immer 1.April oder 1.Oktober
|
|||||||
TermEndDay: Letzter Tag
|
TermEndDay: Letzter Tag
|
||||||
TermEndDayTooltip: Üblicherweise immer 30.September oder 31.März
|
TermEndDayTooltip: Üblicherweise immer 30.September oder 31.März
|
||||||
TermHolidays: Feiertage
|
TermHolidays: Feiertage
|
||||||
|
TermHolidayPlaceholder: Feiertag
|
||||||
TermLectureStart: Beginn Vorlesungen
|
TermLectureStart: Beginn Vorlesungen
|
||||||
TermLectureEnd: Ende Vorlesungen
|
TermLectureEnd: Ende Vorlesungen
|
||||||
TermLectureEndTooltip: Meistens dauer das Sommersemester 14 Wochen und das Wintersemester 15 Wochen.
|
TermLectureEndTooltip: Meistens dauer das Sommersemester 14 Wochen und das Wintersemester 15 Wochen.
|
||||||
|
|||||||
@ -255,7 +255,7 @@ newTermForm template html = do
|
|||||||
= aforced termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) tid
|
= aforced termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) tid
|
||||||
| otherwise
|
| otherwise
|
||||||
= areq termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) Nothing
|
= areq termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) Nothing
|
||||||
holidayForm = formToAForm . over (mapped._2) pure $ massInputList dayField (\_ -> "") (\_ -> Nothing) (fslI MsgTermHolidays) True (tftHolidays template) mempty
|
holidayForm = formToAForm . over (mapped._2) pure $ massInputList dayField (\_ -> "" & addPlaceholder (mr MsgTermHolidayPlaceholder)) (\_ -> Nothing) (fslI MsgTermHolidays) True (tftHolidays template) mempty
|
||||||
(result, widget) <- flip (renderAForm FormStandard) html $ Term
|
(result, widget) <- flip (renderAForm FormStandard) html $ Term
|
||||||
<$> tidForm
|
<$> tidForm
|
||||||
<*> areq dayField (fslI MsgTermStartDay & setTooltip MsgTermStartDayTooltip) (tftStart template)
|
<*> areq dayField (fslI MsgTermStartDay & setTooltip MsgTermStartDayTooltip) (tftStart template)
|
||||||
|
|||||||
@ -99,6 +99,11 @@ addAttrs attr valus fs = fs { fsAttrs = newAttrs $ fsAttrs fs }
|
|||||||
| attr==a = ( a, T.intercalate " " $ v : valus ) : t
|
| attr==a = ( a, T.intercalate " " $ v : valus ) : t
|
||||||
| otherwise = p : newAttrs t
|
| otherwise = p : newAttrs t
|
||||||
|
|
||||||
|
addPlaceholder :: Text -> FieldSettings site -> FieldSettings site
|
||||||
|
addPlaceholder placeholder fs = fs { fsAttrs = (placeholderAttr, placeholder) : filter ((/= placeholderAttr) . fst) (fsAttrs fs) }
|
||||||
|
where
|
||||||
|
placeholderAttr = "placeholder"
|
||||||
|
|
||||||
addClass :: Text -> FieldSettings site -> FieldSettings site
|
addClass :: Text -> FieldSettings site -> FieldSettings site
|
||||||
addClass = addAttr "class"
|
addClass = addAttr "class"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user