Skip to content

Commit 85da424

Browse files
committed
Hide app title settings when it should not be visible
1 parent 868e541 commit 85da424

File tree

1 file changed

+57
-40
lines changed
  • engine-wizard/elm/Wizard/Settings/LookAndFeel

1 file changed

+57
-40
lines changed

engine-wizard/elm/Wizard/Settings/LookAndFeel/View.elm

Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Gettext exposing (gettext)
66
import Html exposing (Html, a, div, form, hr, img, label, span, text)
77
import Html.Attributes exposing (attribute, class, placeholder, src)
88
import Html.Events exposing (onClick, onSubmit)
9+
import Shared.Data.BootstrapConfig.Admin as Admin
910
import Shared.Data.BootstrapConfig.LookAndFeelConfig as LookAndFeelConfig
1011
import Shared.Data.EditableConfig.EditableLookAndFeelConfig exposing (EditableLookAndFeelConfig)
1112
import Shared.Form as Form
@@ -55,49 +56,65 @@ formView appState form =
5556
let
5657
formWrap =
5758
Html.map GenericMsgs.FormMsg
59+
60+
appTitleSettings =
61+
if Admin.isEnabled appState.config.admin then
62+
let
63+
appTitleGroup =
64+
div [ class "row" ]
65+
[ div [ class "col-8" ]
66+
[ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitle ] appState form "appTitle" (gettext "Application Title" appState.locale)
67+
, FormExtra.mdAfter (gettext "Full name of the DSW instance (displayed, for example, in the browser tab title or before login)." appState.locale)
68+
]
69+
, div
70+
[ class "col-4" ]
71+
[ img [ class "settings-img", src "/wizard/img/settings/app-title.png" ] []
72+
]
73+
]
74+
75+
appTitleShortGroup =
76+
div [ class "row mt-5" ]
77+
[ div [ class "col-8" ]
78+
[ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitleShort ] appState form "appTitleShort" (gettext "Short Application Title" appState.locale)
79+
, FormExtra.mdAfter (gettext "Short name of the DSW instance (displayed, for example, on top of the navigation bar). Short title can be the same as the application title if it is short enough." appState.locale)
80+
]
81+
, div [ class "col-4" ]
82+
[ img [ class "settings-img", src "/wizard/img/settings/app-title-short.png" ] []
83+
]
84+
]
85+
in
86+
[ appTitleGroup
87+
, appTitleShortGroup
88+
, hr [] []
89+
]
90+
91+
else
92+
[]
5893
in
5994
div []
60-
[ div [ class "row" ]
61-
[ div [ class "col-8" ]
62-
[ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitle ] appState form "appTitle" (gettext "Application Title" appState.locale)
63-
, FormExtra.mdAfter (gettext "Full name of the DSW instance (displayed, for example, in the browser tab title or before login)." appState.locale)
64-
]
65-
, div
66-
[ class "col-4" ]
67-
[ img [ class "settings-img", src "/wizard/img/settings/app-title.png" ] []
68-
]
69-
]
70-
, div [ class "row mt-5" ]
71-
[ div [ class "col-8" ]
72-
[ formWrap <| FormGroup.inputAttrs [ placeholder LookAndFeelConfig.defaultAppTitleShort ] appState form "appTitleShort" (gettext "Short Application Title" appState.locale)
73-
, FormExtra.mdAfter (gettext "Short name of the DSW instance (displayed, for example, on top of the navigation bar). Short title can be the same as the application title if it is short enough." appState.locale)
74-
]
75-
, div [ class "col-4" ]
76-
[ img [ class "settings-img", src "/wizard/img/settings/app-title-short.png" ] []
77-
]
78-
]
79-
, hr [] []
80-
, div [ class "input-table mt-5" ]
81-
[ div [ class "row" ]
82-
[ div [ class "col-8" ]
83-
[ label [] [ text (gettext "Custom Menu Links" appState.locale) ]
84-
, Markdown.toHtml [ class "form-text text-muted" ]
85-
(String.format
86-
(gettext "Configure additional links in the menu. Choose any free icon from the [Font Awesome](%s), e.g. *fas fa-magic*. Check *New window* if you want to open the link in a new window." appState.locale)
87-
[ FontAwesome.fontAwesomeLink ]
88-
)
89-
]
90-
, div [ class "col-4" ]
91-
[ img [ class "settings-img", src "/wizard/img/settings/custom-menu-links.png" ] [] ]
92-
]
93-
, div [ class "row mt-3" ]
94-
[ div [ class "col" ]
95-
[ customMenuLinksHeader appState form
96-
, formWrap <| FormGroup.list appState (customMenuLinkItemView appState) form "customMenuLinks" "" (gettext "Add link" appState.locale)
95+
(appTitleSettings
96+
++ [ div [ class "input-table mt-5" ]
97+
[ div [ class "row" ]
98+
[ div [ class "col-8" ]
99+
[ label [] [ text (gettext "Custom Menu Links" appState.locale) ]
100+
, Markdown.toHtml [ class "form-text text-muted" ]
101+
(String.format
102+
(gettext "Configure additional links in the menu. Choose any free icon from the [Font Awesome](%s), e.g. *fas fa-magic*. Check *New window* if you want to open the link in a new window." appState.locale)
103+
[ FontAwesome.fontAwesomeLink ]
104+
)
105+
]
106+
, div [ class "col-4" ]
107+
[ img [ class "settings-img", src "/wizard/img/settings/custom-menu-links.png" ] [] ]
108+
]
109+
, div [ class "row mt-3" ]
110+
[ div [ class "col" ]
111+
[ customMenuLinksHeader appState form
112+
, formWrap <| FormGroup.list appState (customMenuLinkItemView appState) form "customMenuLinks" "" (gettext "Add link" appState.locale)
113+
]
114+
]
97115
]
98-
]
99-
]
100-
]
116+
]
117+
)
101118

102119

103120
customMenuLinksHeader : AppState -> Form FormError EditableLookAndFeelConfig -> Html msg

0 commit comments

Comments
 (0)