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::{ use std::process::{Command, ExitStatus, Output};
process::{Command, ExitStatus, Output},
};
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
use std::os::unix::process::ExitStatusExt; use std::os::unix::process::ExitStatusExt;

View File

@ -90,7 +90,7 @@ impl Config {
default_use_hls: parse("LIBREDDIT_DEFAULT_USE_HLS"), default_use_hls: parse("LIBREDDIT_DEFAULT_USE_HLS"),
default_hide_hls_notification: parse("LIBREDDIT_DEFAULT_HIDE_HLS"), default_hide_hls_notification: parse("LIBREDDIT_DEFAULT_HIDE_HLS"),
default_hide_awards: parse("LIBREDDIT_DEFAULT_HIDE_AWARDS"), 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_subscriptions: parse("LIBREDDIT_DEFAULT_SUBSCRIPTIONS"),
default_disable_visit_reddit_confirmation: parse("LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION"), default_disable_visit_reddit_confirmation: parse("LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION"),
banner: parse("LIBREDDIT_BANNER"), 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_HIDE_HLS_NOTIFICATION" => config.default_hide_hls_notification.clone(),
"LIBREDDIT_DEFAULT_WIDE" => config.default_wide.clone(), "LIBREDDIT_DEFAULT_WIDE" => config.default_wide.clone(),
"LIBREDDIT_DEFAULT_HIDE_AWARDS" => config.default_hide_awards.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_SUBSCRIPTIONS" => config.default_subscriptions.clone(),
"LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION" => config.default_disable_visit_reddit_confirmation.clone(), "LIBREDDIT_DEFAULT_DISABLE_VISIT_REDDIT_CONFIRMATION" => config.default_disable_visit_reddit_confirmation.clone(),
"LIBREDDIT_BANNER" => config.banner.clone(), "LIBREDDIT_BANNER" => config.banner.clone(),

View File

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

View File

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

View File

@ -5,9 +5,13 @@
{% else if kind == "t1" %} {% else if kind == "t1" %}
<div id="{{ id }}" class="comment"> <div id="{{ id }}" class="comment">
<div class="comment_left"> <div class="comment_left">
{% if prefs.hide_score != "on" %} <p class="comment_score" title="{{ score.1 }}">
<p class="comment_score" title="{{ score.1 }}">{{ score.0 }}</p> {% if prefs.hide_score != "on" %}
{% endif %} {{ score.0 }}
{% else %}
&#x2022;
{% endif %}
</p>
<div class="line"></div> <div class="line"></div>
</div> </div>
<details class="comment_right" {% if !collapsed || highlighted %}open{% endif %}> <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 %} <a href="{{ post.permalink }}">{{ post.title }}</a>{% if post.flags.nsfw %} <small class="nsfw">NSFW</small>{% endif %}
</h2> </h2>
{% if prefs.hide_score != "on" %} <div class="post_score" title="{{ post.score.1 }}">
<div class="post_score" title="{{ post.score.1 }}">{{ post.score.0 }}<span class="label"> Upvotes</span></div> {% if prefs.hide_score != "on" %}
{% endif %} {{ post.score.0 }}
{% else %}
&#x2022;
{% endif %}
<span class="label"> Upvotes</span></div>
<div class="post_footer"> <div class="post_footer">
<a href="{{ post.permalink }}" class="post_comments" title="{{ post.comments.1 }} comments">{{ post.comments.0 }} comments</a> <a href="{{ post.permalink }}" class="post_comments" title="{{ post.comments.1 }} comments">{{ post.comments.0 }} comments</a>
</div> </div>

View File

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

View File

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

View File

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