Compare commits
9 Commits
6b0ee8eafb
...
main
Author | SHA1 | Date | |
---|---|---|---|
12a1cf386d | |||
7f6994883e | |||
641121789f | |||
026e456855 | |||
d8b547547b | |||
28fd37e74b | |||
e13ad30fdf | |||
b3f0449d4d | |||
2286ef5a1f |
16
README.md
16
README.md
@ -1,7 +1,7 @@
|
||||
<img align="left" width="128" height="128" src="https://git.stardust.wtf/attachments/842086e3-b718-4379-b718-c3a542842152" alt="logo">
|
||||
|
||||
# Redsunlib
|
||||
> An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some <sup><sub>(minor)</sub></sup> function and cosmetic changes.
|
||||
> An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some <sup><sub>(minor)</sub></sup> function and cosmetic changes. [(See.)](#additional-features)
|
||||
|
||||
<br>
|
||||
|
||||
@ -27,6 +27,7 @@ There are rapid changes/features in this fork that can<sup>(will)</sup> change w
|
||||
- [Teddit](#teddit)
|
||||
- [Libreddit](#libreddit)
|
||||
5. [Comparison](#comparison)
|
||||
- [Additional features](#additional-features)
|
||||
- [Speed](#speed)
|
||||
- [Privacy](#privacy)
|
||||
- [Reddit](#reddit)
|
||||
@ -98,6 +99,19 @@ Several technical improvements have also been made, including:
|
||||
|
||||
# Comparison
|
||||
|
||||
## Additional features
|
||||
|
||||
|Quick Access Feeds<br>*<sup>(Beta)</sup>*|<br>*Toolbar*<br><br>*Dropdown*
|
||||
|:-:|---|
|
||||
|**Video Downloads**<br>*using FFmpeg.wasm*|<img align="left" width="400" src="https://git.stardust.wtf/attachments/2d5356dc-ce99-4e5e-bb64-b6e7cc343862" alt="Video Downloads">
|
||||
|**Mascot Overlays**<br>*A friendly companion while you browse*|<img align="left" width="400" src="https://git.stardust.wtf/attachments/d8e1507d-8fde-4bf1-9150-6ec08b843f85" alt="Mascot Overlays (Image of boymoder)">
|
||||
|**Extra Themes**<br>*Well... One.*|***Catppuccin*** <img width="400" src="https://git.stardust.wtf/attachments/ccf81f52-e653-4722-94b9-b370c58d6359" alt="Catppuccin">
|
||||
|**Extra Layouts**|<br>***Waterfall*** <img width="400" src="https://git.stardust.wtf/attachments/b4f9e41e-27a9-4bd0-bb1e-f7aa025ffd38" alt="Waterfall"><br>***Old <sup>(Beta)</sup>*** <img width="400" src="https://git.stardust.wtf/attachments/fa4d78b9-17dd-4b64-90c9-510a75b3bc8e" alt="Old">
|
||||
|**Tweaked Interface Elements**|<img width="200" src="https://git.stardust.wtf/attachments/1148dd14-63cf-481e-99f0-a2236f9414cd"><img width="200" src="https://git.stardust.wtf/attachments/c2055e09-fa96-46c6-9724-41a0bad28bc6"><br><br><img width="200" src="https://git.stardust.wtf/attachments/e99365d5-64d2-458e-a572-90ef030a0cfa"><img width="200" src="https://git.stardust.wtf/attachments/9248dfaa-28c2-443b-98f9-ed736f663701">
|
||||
|**QoL**<br>*Quality of life*| Option to skip gated/quarantined <br> Option to disable banners to save bandwidth <br> Display more information <br> Mute Users [?](## "Automaticly collapse content (A Weaker filter)") |
|
||||
|
||||
---
|
||||
|
||||
This section outlines how Redlib compares to Reddit in terms of speed and privacy.
|
||||
|
||||
## Speed
|
||||
|
@ -3,7 +3,7 @@
|
||||
use crate::{config, utils};
|
||||
// CRATES
|
||||
use crate::utils::{
|
||||
catch_random, error, filter_posts, format_num, format_url, get_filters, info, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences,
|
||||
catch_random, error, filter_posts, format_num, format_url, get_filters, info, infobox, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences,
|
||||
Subreddit,
|
||||
};
|
||||
use crate::{client::json, server::RequestExt, server::ResponseExt};
|
||||
@ -85,7 +85,7 @@ pub async fn community(req: Request<Body>) -> Result<Response<Body>, String> {
|
||||
|
||||
if (sub_name == "popular" || sub_name == "all") && remove_default_feeds {
|
||||
if subscribed.is_empty() {
|
||||
return info(req, "Subscribe to some subreddits! (Default feeds disabled in settings)").await;
|
||||
return infobox(req, "Subscribe to some subreddits!","Default feeds disabled in settings").await;
|
||||
} else {
|
||||
// If there are subscribed subs, but we get here, then the problem is that front_page pref is set to something besides default.
|
||||
// Tell user to go to settings and change front page to default.
|
||||
|
24
src/utils.rs
24
src/utils.rs
@ -561,6 +561,15 @@ pub struct InfoTemplate {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "infobox.html")]
|
||||
pub struct InfoBoxTemplate {
|
||||
pub msg: String,
|
||||
pub sub_msg: String,
|
||||
pub prefs: Preferences,
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
/// Template for NSFW landing page. The landing page is displayed when a page's
|
||||
/// content is wholly NSFW, but a user has not enabled the option to view NSFW
|
||||
/// posts.
|
||||
@ -1380,6 +1389,21 @@ pub async fn info(req: Request<Body>, msg: &str) -> Result<Response<Body>, Strin
|
||||
Ok(Response::builder().status(200).header("content-type", "text/html").body(body.into()).unwrap_or_default())
|
||||
}
|
||||
|
||||
/// Renders a styled info landing page.
|
||||
pub async fn infobox(req: Request<Body>, msg: &str, sub_msg: &str) -> Result<Response<Body>, String> {
|
||||
let url = req.uri().to_string();
|
||||
let body = InfoBoxTemplate {
|
||||
msg: msg.to_string(),
|
||||
sub_msg: sub_msg.to_string(),
|
||||
prefs: Preferences::new(&req),
|
||||
url,
|
||||
}
|
||||
.render()
|
||||
.unwrap_or_default();
|
||||
|
||||
Ok(Response::builder().status(200).header("content-type", "text/html").body(body.into()).unwrap_or_default())
|
||||
}
|
||||
|
||||
/// Returns true if the config/env variable `REDLIB_SFW_ONLY` carries the
|
||||
/// value `on`.
|
||||
///
|
||||
|
@ -1460,6 +1460,7 @@ a.search_subreddit:hover {
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
unicode-bidi: isolate;
|
||||
}
|
||||
|
||||
.comment_score {
|
||||
@ -2004,6 +2005,15 @@ th {
|
||||
#error a {
|
||||
color: var(--accent);
|
||||
}
|
||||
#post_error {
|
||||
text-align: center;
|
||||
background: var(--post);
|
||||
border-radius: 5px;
|
||||
padding: 30px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
width: 60em;
|
||||
}
|
||||
|
||||
#issue_warning {
|
||||
color: var(--popup-toreddit-text);
|
||||
|
20
templates/infobox.html
Normal file
20
templates/infobox.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
{% import "utils.html" as utils %}
|
||||
|
||||
{% block title %}Info: {{ msg }},{{ sub_msg }}{% endblock %}
|
||||
{% block sortstyle %}{% endblock %}
|
||||
|
||||
{% block subscriptions %}
|
||||
{% call utils::sub_list("") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block search %}
|
||||
{% call utils::search("".to_owned(), "") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="post_error">
|
||||
<h2>{{ msg }}</h2>
|
||||
<h3><i>{{ sub_msg }}</i></h3>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user