Skip to content

Commit

Permalink
[wip] #208
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub committed Oct 18, 2024
1 parent 1b3116c commit 5523116
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 12 deletions.
104 changes: 103 additions & 1 deletion i18n/en.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,105 @@
sign_in = "Sign In"
sign_out = "Sign Out"
sign_up = "Sign Up"
sign_up = "Sign Up"

site_settings = "Site Settings"
db_view = "DB View"
stats = "Stats"

site_name = "Site Name"
domain = "Domain"
description = "Description"
read_only = "Read Only"
title_max_length = "Title Max Length"
article_max_length = "Article Max Length"
comment_max_length = "Comment Max Length"
solo_interval = "Solo Interval"
post_interval = "Post Interval"
comment_interval = "Comment Interval"
per_page = "Per Page"
captcha_difficulty = "Captcha Difficulty"
about = "About"
captcha = "Captcha"
easy = "Easy"
medium = "Medium"
hard = "Hard"
captcha_type = "Captcha Type"
default_home_page = "Default Home Page"

all = "All"
joined = "Joined"
following = "Following"
explore_all = "Explore All"

save = "Save"

delete_permanently = "Delete Permanently"
delete_sure = "Are you sure you want to delete this?"
delete = "Delete"
prev = "Prev"
next = "Next"
error = "Error"

star = "Star"
unread = "Unread"
subscribe = "Subscribe"
unsubscribe = "Unsubscribe"

url = "URL"
folder = "Folder"
new = "New"
new_folder = "New Folder"
is_public = "Is Public"
add = "Add"
source = "Source"
load_image = "Load Image"

new_post = "New Post"
exit = "Exit"
limited = "Limited"
rejected = "Rejected"
pending = "Pending"

members = "Members"
mod = "Mod"
join = "Join"
active = "Active"
users = "Users"
topics = "Topics"

public = "Public"
apply = "Apply"
hidden = "Hidden"
private = "Private"
private_help = "The Private inn can not be changed to other type."
private_hidden = "Private Hidden"
limited_edit_seconds = "Limited Edit Seconds"
limited_edit_seconds_help = "How long before users are blocked from editing? (set 0 to allow anytime)"

avatar_help = "Please clear browser cache"
upload = "Upload"
inn_name = "Inn Name"
inn_type = "Inn Type"
inn_feed_help = "Submit url again to unsubscribe."

edit = "Edit"
new_comment = "New Comment"
submit = "Submit"
preview = "Preview"
join_to_comment = "Join to comment"
sign_in_to_comment = "Sign in to comment"
save_draft = "Save Draft"
delete_draft = "Delete Draft"
draft = "Draft"
uname_or_id = "Username or uid"
recovery_code = "Recovery Code"
new_password = "New Password"
confirm = "Confirm"
change = "Change"
search = "Search"
post = "Post"
comment = "Comment"

stay_logged_in = "Stay logged in"
forgot_password = "Forgot Password?"
password_reset = "Password Reset"
2 changes: 1 addition & 1 deletion src/controller/inn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! | role | comment | post | update timeline | lock post | inn admin | protected | Note |
//! |---------|:-------:|:----:|:---------------:|:---------:|:---------:|:---------:|------------------|
//! | Pending | | | | | | | Apply or Private |
//! | Deny | | | | | | | Apply or Private |
//! | Rejected| | | | | | | Apply or Private |
//! | Limited | ✅ | | | | | | |
//! | Intern | ✅ | ✅ | | | | | |
//! | Fellow | ✅ | ✅ | ✅ | | | | |
Expand Down
6 changes: 3 additions & 3 deletions src/controller/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl Display for Role {
#[repr(u8)]
pub(super) enum InnRole {
Pending = 1,
Deny = 2,
Rejected = 2,
Limited = 3,
Intern = 4,
Fellow = 5,
Expand All @@ -263,7 +263,7 @@ impl From<u8> for InnRole {
fn from(value: u8) -> Self {
match value {
1 => InnRole::Pending,
2 => InnRole::Deny,
2 => InnRole::Rejected,
3 => InnRole::Limited,
4 => InnRole::Intern,
5 => InnRole::Fellow,
Expand Down Expand Up @@ -516,7 +516,7 @@ pub(crate) async fn role_post(
DB.open_tree("inn_apply")?.insert(&inn_users_k, &[])?;
1
}
"Deny" => 2,
"Rejected" => 2,
"Limited" => 3,
"Intern" => 4,
"Fellow" => 5,
Expand Down
2 changes: 1 addition & 1 deletion templates/feed_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<p class="title">{{item.title|truncate(100)}}</p>
<p>📅 {{item.updated}} &nbsp;&nbsp;
⚓ {{item.feed_title}} &nbsp;&nbsp;
<a href="{{item.link}}">🌐 Origin</a> &nbsp;&nbsp;
<a href="{{item.link}}">🌐 Source</a> &nbsp;&nbsp;
<a href="/feed/read/{{item.item_id}}?allow_img=true">🖼️ Load image</a>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/inn.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<button class="button is-success is-small is-rounded" title="You are limited to comment in this Inn">Limited</button>
<a href="/inn/{{iid}}/join"><button class="button is-small is-rounded is-hidden-mobile is-danger">Exit</button></a>
{% else if inn_role == 2 %}
<button class="button is-success is-small is-rounded" title="Your request to join this Inn has been denied">Denied</button>
<button class="button is-success is-small is-rounded" title="Your request to join this Inn has been rejected">Rejected</button>
{% else if inn_role == 1 %}
<button class="button is-success is-small is-rounded">Pending</button>
{% else %}
Expand Down Expand Up @@ -200,7 +200,7 @@
{% else if inn_role == 3 %}
<button class="button is-fullwidth is-rounded" title="You are limited to comment in this Inn">Limited</button>
{% else if inn_role == 2 %}
<button class="button is-fullwidth is-rounded" title="Your request to join this Inn has been denied">Denied</button>
<button class="button is-fullwidth is-rounded" title="Your request to join this Inn has been reject">Rejected</button>
{% else if inn_role == 1 %}
<button class="button is-fullwidth is-rounded">Pending</button>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion templates/notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<span class="select is-small">
<select name="role" required autocomplete="off">
<option selected>Pending</option>
<option>Deny</option>
<option>Rejected</option>
<option>Limited</option>
<option>Intern</option>
<option>Fellow</option>
Expand Down
6 changes: 3 additions & 3 deletions templates/user_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{% when Some(5) %} Fellow
{% when Some(4) %} Intern
{% when Some(3) %} Limited
{% when Some(2) %} Deny
{% when Some(2) %} Rejected
{% when Some(1) %} Pending
{% else %} Inn Role {% endmatch %}
</span>
Expand All @@ -41,7 +41,7 @@
<div class="dropdown-content">
{% if info.2 %}
<a href="/user/list?filter=inn&id={{info.0}}&role=1" class="dropdown-item">Pending</a>
<a href="/user/list?filter=inn&id={{info.0}}&role=2" class="dropdown-item">Deny</a>
<a href="/user/list?filter=inn&id={{info.0}}&role=2" class="dropdown-item">Rejected</a>
{% endif %}
<a href="/user/list?filter=inn&id={{info.0}}&role=3" class="dropdown-item">Limited</a>
<a href="/user/list?filter=inn&id={{info.0}}&role=4" class="dropdown-item">Intern</a>
Expand Down Expand Up @@ -110,7 +110,7 @@
<select name="role" required autocomplete="off">
{% if info.2 %}
<option {% if user.role == 1 %} selected {% endif %}>Pending</option>
<option {% if user.role == 2 %} selected {% endif %}>Deny</option>
<option {% if user.role == 2 %} selected {% endif %}>Rejected</option>
{% endif %}
<option {% if user.role == 3 %} selected {% endif %}>Limited</option>
<option {% if user.role == 4 %} selected {% endif %}>Intern</option>
Expand Down

0 comments on commit 5523116

Please sign in to comment.