Support RTL page direction in WebAdmin for Hebrew (#650)
This commit is contained in:
parent
f4376671ac
commit
65551afcba
|
@ -296,7 +296,7 @@ make_xhtml(Els, Host, Node, Lang, JID) ->
|
||||||
#xmlel{name = <<"html">>,
|
#xmlel{name = <<"html">>,
|
||||||
attrs =
|
attrs =
|
||||||
[{<<"xmlns">>, <<"http://www.w3.org/1999/xhtml">>},
|
[{<<"xmlns">>, <<"http://www.w3.org/1999/xhtml">>},
|
||||||
{<<"xml:lang">>, Lang}, {<<"lang">>, Lang}],
|
{<<"xml:lang">>, Lang}, {<<"lang">>, Lang}]++direction(Lang),
|
||||||
children =
|
children =
|
||||||
[#xmlel{name = <<"head">>, attrs = [],
|
[#xmlel{name = <<"head">>, attrs = [],
|
||||||
children =
|
children =
|
||||||
|
@ -346,6 +346,10 @@ make_xhtml(Els, Host, Node, Lang, JID) ->
|
||||||
?AC(<<"https://www.process-one.net/">>, <<"ProcessOne">>)]
|
?AC(<<"https://www.process-one.net/">>, <<"ProcessOne">>)]
|
||||||
)])])])]}}.
|
)])])])]}}.
|
||||||
|
|
||||||
|
direction(ltr) -> [{<<"dir">>, <<"ltr">>}];
|
||||||
|
direction(<<"he">>) -> [{<<"dir">>, <<"rtl">>}];
|
||||||
|
direction(_) -> [].
|
||||||
|
|
||||||
get_base_path(global, cluster) -> <<"/admin/">>;
|
get_base_path(global, cluster) -> <<"/admin/">>;
|
||||||
get_base_path(Host, cluster) ->
|
get_base_path(Host, cluster) ->
|
||||||
<<"/admin/server/", Host/binary, "/">>;
|
<<"/admin/server/", Host/binary, "/">>;
|
||||||
|
@ -513,7 +517,7 @@ css(Host) ->
|
||||||
"0px;\n}\n\nh3 {\n color: #000044;\n "
|
"0px;\n}\n\nh3 {\n color: #000044;\n "
|
||||||
" font-family: Verdana, Arial, Helvetica, "
|
" font-family: Verdana, Arial, Helvetica, "
|
||||||
"sans-serif; \n font-size: 10pt;\n "
|
"sans-serif; \n font-size: 10pt;\n "
|
||||||
"font-weight: bold;\n text-align: left;\n "
|
"font-weight: bold;\n "
|
||||||
" padding-top: 20px;\n padding-bottom: "
|
" padding-top: 20px;\n padding-bottom: "
|
||||||
"2px;\n margin-top: 0px;\n margin-bottom: "
|
"2px;\n margin-top: 0px;\n margin-bottom: "
|
||||||
"0px;\n}\n\n#content a:link {\n color: "
|
"0px;\n}\n\n#content a:link {\n color: "
|
||||||
|
@ -671,7 +675,7 @@ process_admin(Host,
|
||||||
end
|
end
|
||||||
++
|
++
|
||||||
[?XAE(<<"form">>,
|
[?XAE(<<"form">>,
|
||||||
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
|
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}]++direction(ltr),
|
||||||
[?TEXTAREA(<<"acls">>,
|
[?TEXTAREA(<<"acls">>,
|
||||||
(iolist_to_binary(integer_to_list(lists:max([16,
|
(iolist_to_binary(integer_to_list(lists:max([16,
|
||||||
NumLines])))),
|
NumLines])))),
|
||||||
|
@ -708,7 +712,7 @@ process_admin(Host,
|
||||||
++
|
++
|
||||||
[?XAE(<<"p">>, direction(ltr), [?ACT(<<"../acls-raw/">>, <<"Raw">>)])] ++
|
[?XAE(<<"p">>, direction(ltr), [?ACT(<<"../acls-raw/">>, <<"Raw">>)])] ++
|
||||||
[?XAE(<<"form">>,
|
[?XAE(<<"form">>,
|
||||||
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
|
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}]++direction(ltr),
|
||||||
[acls_to_xhtml(ACLs), ?BR,
|
[acls_to_xhtml(ACLs), ?BR,
|
||||||
?INPUTT(<<"submit">>, <<"delete">>,
|
?INPUTT(<<"submit">>, <<"delete">>,
|
||||||
<<"Delete Selected">>),
|
<<"Delete Selected">>),
|
||||||
|
@ -773,7 +777,7 @@ process_admin(Host,
|
||||||
end
|
end
|
||||||
++
|
++
|
||||||
[?XAE(<<"form">>,
|
[?XAE(<<"form">>,
|
||||||
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
|
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}]++direction(ltr),
|
||||||
[?TEXTAREA(<<"access">>,
|
[?TEXTAREA(<<"access">>,
|
||||||
(iolist_to_binary(integer_to_list(lists:max([16,
|
(iolist_to_binary(integer_to_list(lists:max([16,
|
||||||
NumLines])))),
|
NumLines])))),
|
||||||
|
@ -808,7 +812,7 @@ process_admin(Host,
|
||||||
[?XAE(<<"p">>, direction(ltr), [?ACT(<<"../access-raw/">>, <<"Raw">>)])]
|
[?XAE(<<"p">>, direction(ltr), [?ACT(<<"../access-raw/">>, <<"Raw">>)])]
|
||||||
++
|
++
|
||||||
[?XAE(<<"form">>,
|
[?XAE(<<"form">>,
|
||||||
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}],
|
[{<<"action">>, <<"">>}, {<<"method">>, <<"post">>}]++direction(ltr),
|
||||||
[access_rules_to_xhtml(AccessRules, Lang), ?BR,
|
[access_rules_to_xhtml(AccessRules, Lang), ?BR,
|
||||||
?INPUTT(<<"submit">>, <<"delete">>,
|
?INPUTT(<<"submit">>, <<"delete">>,
|
||||||
<<"Delete Selected">>)])],
|
<<"Delete Selected">>)])],
|
||||||
|
@ -2384,7 +2388,7 @@ node_ports_to_xhtml(Ports, Lang) ->
|
||||||
[?INPUTS(<<"text">>,
|
[?INPUTS(<<"text">>,
|
||||||
<<"module", SSPort/binary>>,
|
<<"module", SSPort/binary>>,
|
||||||
SModule, <<"15">>)]),
|
SModule, <<"15">>)]),
|
||||||
?XE(<<"td">>,
|
?XAE(<<"td">>, direction(ltr),
|
||||||
[?TEXTAREA(<<"opts", SSPort/binary>>,
|
[?TEXTAREA(<<"opts", SSPort/binary>>,
|
||||||
(iolist_to_binary(integer_to_list(NumLines))),
|
(iolist_to_binary(integer_to_list(NumLines))),
|
||||||
<<"35">>, SOptsClean)]),
|
<<"35">>, SOptsClean)]),
|
||||||
|
@ -2410,7 +2414,7 @@ node_ports_to_xhtml(Ports, Lang) ->
|
||||||
?XE(<<"td">>,
|
?XE(<<"td">>,
|
||||||
[?INPUTS(<<"text">>, <<"modulenew">>, <<"">>,
|
[?INPUTS(<<"text">>, <<"modulenew">>, <<"">>,
|
||||||
<<"15">>)]),
|
<<"15">>)]),
|
||||||
?XE(<<"td">>,
|
?XAE(<<"td">>, direction(ltr),
|
||||||
[?TEXTAREA(<<"optsnew">>, <<"2">>, <<"35">>,
|
[?TEXTAREA(<<"optsnew">>, <<"2">>, <<"35">>,
|
||||||
<<"[]">>)]),
|
<<"[]">>)]),
|
||||||
?XAE(<<"td">>, [{<<"colspan">>, <<"2">>}],
|
?XAE(<<"td">>, [{<<"colspan">>, <<"2">>}],
|
||||||
|
@ -2527,7 +2531,7 @@ node_modules_to_xhtml(Modules, Lang) ->
|
||||||
40),
|
40),
|
||||||
?XE(<<"tr">>,
|
?XE(<<"tr">>,
|
||||||
[?XC(<<"td">>, SModule),
|
[?XC(<<"td">>, SModule),
|
||||||
?XE(<<"td">>,
|
?XAE(<<"td">>, direction(ltr),
|
||||||
[?TEXTAREA(<<"opts", SModule/binary>>,
|
[?TEXTAREA(<<"opts", SModule/binary>>,
|
||||||
(iolist_to_binary(integer_to_list(NumLines))),
|
(iolist_to_binary(integer_to_list(NumLines))),
|
||||||
<<"40">>, SOpts)]),
|
<<"40">>, SOpts)]),
|
||||||
|
@ -2546,7 +2550,7 @@ node_modules_to_xhtml(Modules, Lang) ->
|
||||||
[?XE(<<"tr">>,
|
[?XE(<<"tr">>,
|
||||||
[?XE(<<"td">>,
|
[?XE(<<"td">>,
|
||||||
[?INPUT(<<"text">>, <<"modulenew">>, <<"">>)]),
|
[?INPUT(<<"text">>, <<"modulenew">>, <<"">>)]),
|
||||||
?XE(<<"td">>,
|
?XAE(<<"td">>, direction(ltr),
|
||||||
[?TEXTAREA(<<"optsnew">>, <<"2">>, <<"40">>,
|
[?TEXTAREA(<<"optsnew">>, <<"2">>, <<"40">>,
|
||||||
<<"[]">>)]),
|
<<"[]">>)]),
|
||||||
?XAE(<<"td">>, [{<<"colspan">>, <<"2">>}],
|
?XAE(<<"td">>, [{<<"colspan">>, <<"2">>}],
|
||||||
|
|
Loading…
Reference in New Issue