WIP - initial RTL support #575 (#577)

* initial RTL support

* fix dir in template-util

* fix dir in blogs new

* fix dir in blogs details

* fix dir in posts new

* fix dir in posts details

* fix dir in posts remote

* Fix dir in partials

some parts should be recheck carefully in real usage
This commit is contained in:
Mostafa Ahangarha
2019-07-11 12:04:27 +04:30
committed by Igor Galić
parent c031804464
commit 54c6d21fc5
34 changed files with 10381 additions and 11037 deletions
+7 -7
View File
@@ -146,7 +146,7 @@ pub fn avatar(
pub fn tabs(links: &[(&str, String, bool)]) -> Html<String> {
let mut res = String::from(r#"<div class="tabs">"#);
for (url, title, selected) in links {
res.push_str(r#"<a href=""#);
res.push_str(r#"<a dir="auto" href=""#);
res.push_str(url);
if *selected {
res.push_str(r#"" class="selected">"#);
@@ -176,7 +176,7 @@ pub fn paginate_param(
p
})
.unwrap_or_default();
res.push_str(r#"<div class="pagination">"#);
res.push_str(r#"<div class="pagination" dir="auto">"#);
if page != 1 {
res.push_str(
format!(
@@ -239,13 +239,13 @@ macro_rules! input {
Html(format!(
r#"
<label for="{name}">
<label for="{name}" dir="auto">
{label}
{optional}
{details}
</label>
{error}
<input type="{kind}" id="{name}" name="{name}" value="{val}" {props}/>
<input type="{kind}" id="{name}" name="{name}" value="{val}" {props} dir="auto"/>
"#,
name = stringify!($name),
label = i18n!(cat, $label),
@@ -264,7 +264,7 @@ macro_rules! input {
$err.errors().get(stringify!($name))
{
format!(
r#"<p class="error">{}</p>"#,
r#"<p class="error" dir="auto">{}</p>"#,
errs[0]
.message
.clone()
@@ -332,8 +332,8 @@ macro_rules! input {
let cat = $catalog;
Html(format!(
r#"
<label for="{name}">{label}</label>
<input type="{kind}" id="{name}" name="{name}" {props}/>
<label for="{name}" dir="auto">{label}</label>
<input type="{kind}" id="{name}" name="{name}" {props} dir="auto"/>
"#,
name = stringify!($name),
label = i18n!(cat, $label),