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
+10 -10
View File
@@ -28,8 +28,8 @@
@if article.cover_id.is_some() { style="background-image: url('@article.cover_url(ctx.0).unwrap_or_default()'" }
>
<div>
<h1 class="article p-name">@article.title</h1>
<div class="article-info">
<h1 class="article p-name" dir="auto">@article.title</h1>
<div class="article-info" dir="auto">
<span class="author">
@Html(i18n!(ctx.1, "Written by {0}"; format!("<a href=\"{}\">{}</a>",
uri!(user::details: name = &author.fqn),
@@ -38,7 +38,7 @@
&mdash;
<span class="date dt-published" datetime="@article.creation_date.format("%F %T")">@article.creation_date.format("%B %e, %Y")</span><a class="u-url" href="@article.ap_url"></a>
</div>
<h2 class="article p-summary">@article.subtitle</h2>
<h2 class="article p-summary" dir="auto">@article.subtitle</h2>
</div>
@if article.cover_id.is_some() {
<div class="shadow"></div>
@@ -46,12 +46,12 @@
}
</header>
<article class="e-content">
<article class="e-content" dir="auto">
@Html(&article.content)
</article>
<div class="article-meta">
<section class="split">
<ul class="tags">
<ul class="tags" dir="auto">
@for tag in tags {
@if !tag.is_hashtag {
<li><a class="p-category" href="@uri!(tags::tag: name = &tag.tag, page = _)">@tag.tag</a></li>
@@ -60,7 +60,7 @@
}
}
</ul>
<p class="right">
<p class="right" dir="auto">
@if article.license.is_empty() {
@i18n!(ctx.1, "All rights reserved."; &article.license)
} else {
@@ -116,7 +116,7 @@
</section>
}
<section class="banner">
<div class="flex p-author h-card user">
<div class="flex p-author h-card user" dir="auto">
@avatar(ctx.0, &author, Size::Medium, true, ctx.1)
<div class="grow">
<h2 class="p-name">
@@ -132,7 +132,7 @@
}
</div>
</section>
<section class="comments">
<section class="comments" dir="auto">
<h2>@i18n!(ctx.1, "Comments")</h2>
@if ctx.2.is_some() {
@@ -143,7 +143,7 @@
@if let Some(ref prev) = previous_comment {
<input type="hidden" name="responding_to" value="@prev.id"/>
}
<textarea id="plume-editor" name="content">@comment_form.content</textarea>
<textarea id="plume-editor" name="content" dir="auto">@comment_form.content</textarea>
<input type="submit" value="@i18n!(ctx.1, "Submit comment")" />
</form>
}
@@ -153,7 +153,7 @@
@:comment(ctx, &comm, Some(&article.ap_url), &blog.fqn, &article.slug)
}
} else {
<p class="center">@i18n!(ctx.1, "No comments yet. Be the first to react!")</p>
<p class="center" dir="auto">@i18n!(ctx.1, "No comments yet. Be the first to react!")</p>
}
</section>
</div>
+7 -7
View File
@@ -12,8 +12,8 @@
@(ctx: BaseContext, title: String, blog: Blog, editing: bool, form: &NewPostForm, is_draft: bool, article: Option<Post>, errors: ValidationErrors, medias: Vec<Media>, content_len: u64)
@:base(ctx, title.clone(), {}, {}, {
<h1 id="plume-editor-title">@title</h1>
<div id="plume-editor" style="display: none;">
<h1 id="plume-editor-title" dir="auto">@title</h1>
<div id="plume-editor" style="display: none;" dir="auto">
<header>
<button id="publish" class="button">@i18n!(ctx.1, "Publish")</button>
<p id="char-count">@content_len</p>
@@ -32,10 +32,10 @@
@format!(r#"<p class="error">{}</p>"#, errs[0].message.clone().unwrap_or_else(|| Cow::from("Unknown error")))
}
<label for="editor-content">@i18n!(ctx.1, "Content")<small>@i18n!(ctx.1, "Markdown syntax is supported")</small></label>
<textarea id="editor-content" name="content" rows="20">@Html(&form.content)</textarea>
<small id="editor-left">@content_len</small>
<p>
<label for="editor-content" dir="auto">@i18n!(ctx.1, "Content")<small>@i18n!(ctx.1, "Markdown syntax is supported")</small></label>
<textarea id="editor-content" name="content" rows="20" dir="auto">@Html(&form.content)</textarea>
<small id="editor-left" dir="auto">@content_len</small>
<p dir="auto">
@i18n!(ctx.1, "You can upload media to your gallery, and then copy their Markdown code into your articles to insert them.")
<a href="@uri!(medias::new)">@i18n!(ctx.1, "Upload media")</a>
</p>
@@ -47,7 +47,7 @@
@:image_select(ctx, "cover", i18n!(ctx.1, "Illustration"), true, medias, form.cover)
@if is_draft {
<label for="draft">
<label for="draft" dir="auto">
<input type="checkbox" name="draft" id="draft" checked>
@i18n!(ctx.1, "This is a draft, don't publish it yet.")
</label>
+1 -1
View File
@@ -9,6 +9,6 @@
@(ctx: BaseContext, post: Post, login_form: LoginForm, login_errs: ValidationErrors, remote_form: RemoteForm, remote_errs: ValidationErrors)
@:remote_interact_base(ctx, i18n!(ctx.1, "Interact with {}"; post.title.clone()), i18n!(ctx.1, "Log in to interact"), i18n!(ctx.1, "Enter your full username to interact"), {
<h1>@i18n!(ctx.1, "Interact with {}"; post.title.clone())</h1>
<h1 dir="auto">@i18n!(ctx.1, "Interact with {}"; post.title.clone())</h1>
@:post_card(ctx, post)
}, login_form, login_errs, remote_form, remote_errs)