Use a bullet instead of empty margin when score is hidden

This is prettier and keeps consistency across the app.
This commit is contained in:
gmnsii 2023-03-23 11:29:28 -07:00
parent f8ba3cf815
commit e3b1c5b587
9 changed files with 39 additions and 17 deletions

View file

@ -1,6 +1,4 @@
use std::{
process::{Command, ExitStatus, Output},
};
use std::process::{Command, ExitStatus, Output};
#[cfg(not(target_os = "windows"))]
use std::os::unix::process::ExitStatusExt;

View file

@ -90,7 +90,7 @@ impl Config {
default_use_hls: parse("LIBREDDIT_DEFAULT_USE_HLS"),
default_hide_hls_notification: parse("LIBREDDIT_DEFAULT_HIDE_HLS"),
default_hide_awards: parse("LIBREDDIT_DEFAULT_HIDE_AWARDS"),
default_hide_score: parse("LIBREDDIT_DEFAULT_HIDE_SCORE"),
default_hide_score: parse("LIBREDDIT_DEFAULT_HIDE_SCORE"),
default_subscriptions: parse("LIBREDDIT_DEFAULT_SUBSCRIPTIONS"),
default_disable_visit_reddit_confirmation: parse("LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION"),
banner: parse("LIBREDDIT_BANNER"),
@ -112,7 +112,7 @@ fn get_setting_from_config(name: &str, config: &Config) -> Option<String> {
"LIBREDDIT_DEFAULT_HIDE_HLS_NOTIFICATION" => config.default_hide_hls_notification.clone(),
"LIBREDDIT_DEFAULT_WIDE" => config.default_wide.clone(),
"LIBREDDIT_DEFAULT_HIDE_AWARDS" => config.default_hide_awards.clone(),
"LIBREDDIT_DEFAULT_HIDE_SCORE" => config.default_hide_score.clone(),
"LIBREDDIT_DEFAULT_HIDE_SCORE" => config.default_hide_score.clone(),
"LIBREDDIT_DEFAULT_SUBSCRIPTIONS" => config.default_subscriptions.clone(),
"LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION" => config.default_disable_visit_reddit_confirmation.clone(),
"LIBREDDIT_BANNER" => config.banner.clone(),

View file

@ -179,7 +179,7 @@ impl InstanceInfo {
self.config.sfw_only,
self.config.banner,
self.config.default_hide_awards,
self.config.default_hide_score,
self.config.default_hide_score,
self.config.default_theme,
self.config.default_front_page,
self.config.default_layout,

View file

@ -32,7 +32,7 @@ const PREFS: [&str; 14] = [
"hide_hls_notification",
"autoplay_videos",
"hide_awards",
"hide_score",
"hide_score",
"disable_visit_reddit_confirmation",
];

View file

@ -5,9 +5,13 @@
{% else if kind == "t1" %}
<div id="{{ id }}" class="comment">
<div class="comment_left">
{% if prefs.hide_score != "on" %}
<p class="comment_score" title="{{ score.1 }}">{{ score.0 }}</p>
{% endif %}
<p class="comment_score" title="{{ score.1 }}">
{% if prefs.hide_score != "on" %}
{{ score.0 }}
{% else %}
&#x2022;
{% endif %}
</p>
<div class="line"></div>
</div>
<details class="comment_right" {% if !collapsed || highlighted %}open{% endif %}>

View file

@ -83,9 +83,13 @@
<a href="{{ post.permalink }}">{{ post.title }}</a>{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %}
</h2>
{% if prefs.hide_score != "on" %}
<div class="post_score" title="{{ post.score.1 }}">{{ post.score.0 }}<span class="label"> Upvotes</span></div>
{% endif %}
<div class="post_score" title="{{ post.score.1 }}">
{% if prefs.hide_score != "on" %}
{{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
<span class="label"> Upvotes</span></div>
<div class="post_footer">
<a href="{{ post.permalink }}" class="post_comments" title="{{ post.comments.1 }} comments">{{ post.comments.0 }} comments</a>
</div>

View file

@ -77,9 +77,13 @@
{% else %}
<div class="comment">
<div class="comment_left">
<p class="comment_score" title="{{ post.score.1 }}">
{% if prefs.hide_score != "on" %}
<p class="comment_score" title="{{ post.score.1 }}">{{ post.score.0 }}</p>
{{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
</p>
<div class="line"></div>
</div>
<details class="comment_right" open>

View file

@ -52,9 +52,13 @@
{% else %}
<div class="comment">
<div class="comment_left">
<p class="comment_score" title="{{ post.score.1 }}">
{% if prefs.hide_score != "on" %}
<p class="comment_score" title="{{ post.score.1 }}">{{ post.score.0 }}</p>
{{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
</p>
<div class="line"></div>
</div>
<details class="comment_right" open>

View file

@ -147,9 +147,13 @@
<!-- POST BODY -->
<div class="post_body">{{ post.body|safe }}</div>
<div class="post_score" title="{{ post.score.1 }}">
{% if prefs.hide_score != "on" %}
<div class="post_score" title="{{ post.score.1 }}">{{ post.score.0 }}<span class="label"> Upvotes</span></div>
{{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
<span class="label"> Upvotes</span></div>
<div class="post_footer">
<ul id="post_links">
<li class="desktop_item"><a href="{{ post.permalink }}">permalink</a></li>
@ -269,9 +273,13 @@
<span>{% if post.post_type == "link" %}{{ post.domain }}{% else %}{{ post.post_type }}{% endif %}</span>
</a>
{% endif %}
<div class="post_score" title="{{ post.score.1 }}">
{% if prefs.hide_score != "on" %}
<div class="post_score" title="{{ post.score.1 }}">{{ post.score.0 }}<span class="label"> Upvotes</span></div>
{{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
<span class="label"> Upvotes</span></div>
<div class="post_body post_preview">
{{ post.body|safe }}
</div>