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();
// 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;
match posts {
Ok((posts, after)) => {
let s = UserTemplate {
user: user.unwrap_or_default(),
user,
posts,
sort: (sort, param(&path, "t")),
ends: (param(&path, "after"), after),

View File

@ -16,7 +16,8 @@
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;
color: var(--text);
font-family: sans-serif;
@ -698,10 +699,20 @@ input[type="submit"] {
border-left: 4px solid var(--highlighted);
}
.md a {
.md a, .md a * {
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; }
.toc_child { list-style: none; }

View File

@ -67,7 +67,7 @@
{% if post.post_type == "image" %}
<img class="post_media" src="{{ post.media }}"/>
{% 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" %}
<a id="post_url" href="{{ post.media }}">{{ post.media }}</a>
{% endif %}
@ -81,6 +81,7 @@
</ul>
<p>{{ post.upvote_ratio }}% Upvoted</p>
</div>
</div>
</div>
</div>