Markdown spoilers and post footers on videos

This commit is contained in:
spikecodes 2021-01-08 21:57:36 -08:00
parent ef1ad17234
commit fac56d7f87
3 changed files with 17 additions and 5 deletions

View File

@ -25,13 +25,13 @@ pub async fn profile(req: HttpRequest) -> HttpResponse {
let username = req.match_info().get("username").unwrap_or("").to_string(); let username = req.match_info().get("username").unwrap_or("").to_string();
// Request user profile data and user posts/comments from Reddit // Request user profile data and user posts/comments from Reddit
let user = user(&username).await; let user = user(&username).await.unwrap_or_default();
let posts = fetch_posts(&path, "Comment".to_string()).await; let posts = fetch_posts(&path, "Comment".to_string()).await;
match posts { match posts {
Ok((posts, after)) => { Ok((posts, after)) => {
let s = UserTemplate { let s = UserTemplate {
user: user.unwrap_or_default(), user,
posts, posts,
sort: (sort, param(&path, "t")), sort: (sort, param(&path, "t")),
ends: (param(&path, "after"), after), ends: (param(&path, "after"), after),

View File

@ -16,7 +16,8 @@
background: var(--accent); background: var(--accent);
} }
* { html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote,
pre, form, fieldset, table, th, td, select, input {
margin: 0; margin: 0;
color: var(--text); color: var(--text);
font-family: sans-serif; font-family: sans-serif;
@ -698,10 +699,20 @@ input[type="submit"] {
border-left: 4px solid var(--highlighted); border-left: 4px solid var(--highlighted);
} }
.md a { .md a, .md a * {
color: var(--accent); color: var(--accent);
} }
.md .md-spoiler-text {
background: var(--highlighted);
color: transparent;
}
.md .md-spoiler-text:hover {
background: var(--foreground);
color: var(--text);
}
.md li { margin: 10px 0; } .md li { margin: 10px 0; }
.toc_child { list-style: none; } .toc_child { list-style: none; }

View File

@ -67,7 +67,7 @@
{% if post.post_type == "image" %} {% if post.post_type == "image" %}
<img class="post_media" src="{{ post.media }}"/> <img class="post_media" src="{{ post.media }}"/>
{% else if post.post_type == "video" %} {% else if post.post_type == "video" %}
<video class="post_media" src="{{ post.media }}" controls autoplay loop> <video class="post_media" src="{{ post.media }}" controls autoplay loop></video>
{% else if post.post_type == "link" %} {% else if post.post_type == "link" %}
<a id="post_url" href="{{ post.media }}">{{ post.media }}</a> <a id="post_url" href="{{ post.media }}">{{ post.media }}</a>
{% endif %} {% endif %}
@ -81,6 +81,7 @@
</ul> </ul>
<p>{{ post.upvote_ratio }}% Upvoted</p> <p>{{ post.upvote_ratio }}% Upvoted</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>