Make a distinction between moderators and admins (#619)

* Make a distinction between moderators and admins

And rework the user list in the moderation interface, to be able to run the same action on many users,
and to have a huge list of actions whithout loosing space.

* Make user's role an enum + make it impossible for a moderator to escalate privileges

With the help of diesel-derive-enum (maybe it could be used in other places too?)

Also, moderators are still able to grant or revoke moderation rights to other people, but maybe only admins should be able to do it?

* Cargo fmt

* copy/pasting is bad

* Remove diesel-derive-enum and use an integer instead

It was not compatible with both Postgres and SQlite, because for one it generated a schema
with the "User_role" type, but for the other it was "Text"…

* Reset translations

* Use an enum to avoid magic numbers + fix the tests

* Reset translations

* Fix down.sql
This commit is contained in:
Ana Gelez
2019-09-13 12:28:36 +02:00
committed by Igor Galić
parent 12c80f9981
commit 309e1200d0
44 changed files with 11437 additions and 10408 deletions
+490 -460
View File
File diff suppressed because it is too large Load Diff
+461 -434
View File
File diff suppressed because it is too large Load Diff
+476 -446
View File
File diff suppressed because it is too large Load Diff
+498 -468
View File
File diff suppressed because it is too large Load Diff
+501 -471
View File
File diff suppressed because it is too large Load Diff
+438 -411
View File
File diff suppressed because it is too large Load Diff
+443 -416
View File
File diff suppressed because it is too large Load Diff
+496 -466
View File
File diff suppressed because it is too large Load Diff
+515 -485
View File
File diff suppressed because it is too large Load Diff
+500 -470
View File
File diff suppressed because it is too large Load Diff
+474 -447
View File
File diff suppressed because it is too large Load Diff
+463 -436
View File
File diff suppressed because it is too large Load Diff
+499 -469
View File
File diff suppressed because it is too large Load Diff
+505 -475
View File
File diff suppressed because it is too large Load Diff
+518 -488
View File
File diff suppressed because it is too large Load Diff
+496 -466
View File
File diff suppressed because it is too large Load Diff
+417 -397
View File
@@ -73,11 +73,11 @@ msgid "Your blog information have been updated."
msgstr ""
# src/routes/comments.rs:97
msgid "Your comment have been posted."
msgid "Your comment has been posted."
msgstr ""
# src/routes/comments.rs:172
msgid "Your comment have been deleted."
msgid "Your comment has been deleted."
msgstr ""
# src/routes/instance.rs:134
@@ -109,7 +109,7 @@ msgid "You are not allowed to delete this media."
msgstr ""
# src/routes/medias.rs:163
msgid "Your avatar have been updated."
msgid "Your avatar has been updated."
msgstr ""
# src/routes/medias.rs:168
@@ -145,11 +145,15 @@ msgid "You are not allowed to publish on this blog."
msgstr ""
# src/routes/posts.rs:350
msgid "Your article have been updated."
msgid "Your article has been updated."
msgstr ""
# src/routes/posts.rs:532
msgid "Your post have been saved."
msgid "Your article has been saved."
msgstr ""
# src/routes/posts.rs:538
msgid "New article"
msgstr ""
# src/routes/posts.rs:572
@@ -157,7 +161,7 @@ msgid "You are not allowed to delete this article."
msgstr ""
# src/routes/posts.rs:597
msgid "Your article have been deleted."
msgid "Your article has been deleted."
msgstr ""
# src/routes/posts.rs:602
@@ -208,328 +212,152 @@ msgstr ""
msgid "You are now following {}."
msgstr ""
# src/routes/user.rs:255
# src/routes/user.rs:254
msgid "To subscribe to someone, you need to be logged in"
msgstr ""
# src/routes/user.rs:357
# src/routes/user.rs:356
msgid "To edit your profile, you need to be logged in"
msgstr ""
# src/routes/user.rs:399
msgid "Your profile have been updated."
# src/routes/user.rs:398
msgid "Your profile has been updated."
msgstr ""
# src/routes/user.rs:426
msgid "Your account have been deleted."
# src/routes/user.rs:425
msgid "Your account has been deleted."
msgstr ""
# src/routes/user.rs:432
# src/routes/user.rs:431
msgid "You can't delete someone else's account."
msgstr ""
# src/routes/user.rs:504
# src/routes/user.rs:503
msgid "Registrations are closed on this instance."
msgstr ""
# src/routes/user.rs:528
msgid "Your account have been created. You just need to login before you can use it."
# src/routes/user.rs:527
msgid "Your account has been created. Now you just need to log in, before you can use it."
msgstr ""
msgid "Plume"
msgid "Internal server error"
msgstr ""
msgid "Menu"
msgid "Something broke on our side."
msgstr ""
msgid "Search"
msgid "Sorry about that. If you think this is a bug, please report it."
msgstr ""
msgid "Dashboard"
msgid "You are not authorized."
msgstr ""
msgid "Notifications"
msgid "Page not found"
msgstr ""
msgid "Log Out"
msgid "We couldn't find this page."
msgstr ""
msgid "My account"
msgid "The link that led you here may be broken."
msgstr ""
msgid "Log In"
msgid "The content you sent can't be processed."
msgstr ""
msgid "Register"
msgid "Maybe it was too long."
msgstr ""
msgid "About this instance"
msgid "Invalid CSRF token"
msgstr ""
msgid "Source code"
msgid "Something is wrong with your CSRF token. Make sure cookies are enabled in you browser, and try reloading this page. If you continue to see this error message, please report it."
msgstr ""
msgid "Matrix room"
msgid "Articles tagged \"{0}\""
msgstr ""
msgid "Administration"
msgid "There are currently no articles with such a tag"
msgstr ""
msgid "Welcome to {}"
msgid "New Blog"
msgstr ""
msgid "Latest articles"
msgstr ""
msgid "Your feed"
msgstr ""
msgid "Federated feed"
msgstr ""
msgid "Local feed"
msgstr ""
msgid "Administration of {0}"
msgstr ""
msgid "Instances"
msgstr ""
msgid "Configuration"
msgstr ""
msgid "Users"
msgstr ""
msgid "Unblock"
msgstr ""
msgid "Block"
msgstr ""
msgid "Ban"
msgstr ""
msgid "All the articles of the Fediverse"
msgstr ""
msgid "Articles from {}"
msgstr ""
msgid "Nothing to see here yet. Try subscribing to more people."
msgid "Create a blog"
msgstr ""
# src/template_utils.rs:251
msgid "Name"
msgid "Title"
msgstr ""
# src/template_utils.rs:254
msgid "Optional"
msgstr ""
msgid "Allow anyone to register here"
msgid "Create blog"
msgstr ""
msgid "Short description"
msgid "Edit \"{}\""
msgstr ""
msgid "Description"
msgstr ""
msgid "Markdown syntax is supported"
msgstr ""
msgid "Long description"
msgid "You can upload images to your gallery, to use them as blog icons, or banners."
msgstr ""
# src/template_utils.rs:251
msgid "Default article license"
msgid "Upload images"
msgstr ""
msgid "Save these settings"
msgid "Blog icon"
msgstr ""
msgid "About {0}"
msgid "Blog banner"
msgstr ""
msgid "Home to <em>{0}</em> people"
msgstr ""
msgid "Who wrote <em>{0}</em> articles"
msgstr ""
msgid "And are connected to <em>{0}</em> other instances"
msgstr ""
msgid "Administred by"
msgstr ""
msgid "Runs Plume {0}"
msgstr ""
msgid "Follow {}"
msgstr ""
msgid "Log in to follow"
msgstr ""
msgid "Enter your full username handle to follow"
msgstr ""
msgid "Edit your account"
msgstr ""
msgid "Your Profile"
msgstr ""
msgid "To change your avatar, upload it to your gallery and then select from there."
msgstr ""
msgid "Upload an avatar"
msgstr ""
# src/template_utils.rs:251
msgid "Display name"
msgstr ""
# src/template_utils.rs:251
msgid "Email"
msgstr ""
msgid "Summary"
msgstr ""
msgid "Update account"
msgid "Update blog"
msgstr ""
msgid "Danger zone"
msgstr ""
msgid "Be very careful, any action taken here can't be cancelled."
msgid "Be very careful, any action taken here can't be reversed."
msgstr ""
msgid "Delete your account"
msgid "Permanently delete this blog"
msgstr ""
msgid "Sorry, but as an admin, you can't leave your own instance."
msgid "{}'s icon"
msgstr ""
msgid "Your Dashboard"
msgid "Edit"
msgstr ""
msgid "Your Blogs"
msgid "There's one author on this blog: "
msgid_plural "There are {0} authors on this blog: "
msgstr[0] ""
msgid "Latest articles"
msgstr ""
msgid "You don't have any blog yet. Create your own, or ask to join one."
msgid "No posts to see here yet."
msgstr ""
msgid "Start a new blog"
msgid "Search result(s) for \"{0}\""
msgstr ""
msgid "Your Drafts"
msgid "Search result(s)"
msgstr ""
msgid "Your media"
msgid "No results for your query"
msgstr ""
msgid "Go to your gallery"
msgid "No more results for your query"
msgstr ""
msgid "Create your account"
msgstr ""
msgid "Create an account"
msgstr ""
# src/template_utils.rs:251
msgid "Username"
msgstr ""
# src/template_utils.rs:251
msgid "Password"
msgstr ""
# src/template_utils.rs:251
msgid "Password confirmation"
msgstr ""
msgid "Apologies, but registrations are closed on this particular instance. You can, however, find a different one."
msgstr ""
msgid "Articles"
msgstr ""
msgid "Subscribers"
msgstr ""
msgid "Subscriptions"
msgstr ""
msgid "Atom feed"
msgstr ""
msgid "Recently boosted"
msgstr ""
msgid "Admin"
msgstr ""
msgid "It is you"
msgstr ""
msgid "Edit your profile"
msgstr ""
msgid "Open on {0}"
msgstr ""
msgid "Unsubscribe"
msgstr ""
msgid "Subscribe"
msgstr ""
msgid "{0}'s subscriptions"
msgstr ""
msgid "{0}'s subscribers"
msgstr ""
msgid "Respond"
msgstr ""
msgid "Are you sure?"
msgstr ""
msgid "Delete this comment"
msgstr ""
msgid "What is Plume?"
msgstr ""
msgid "Plume is a decentralized blogging engine."
msgstr ""
msgid "Authors can manage multiple blogs, each as its own website."
msgstr ""
msgid "Articles are also visible on other Plume instances, and you can interact with them directly from other platforms like Mastodon."
msgstr ""
msgid "Read the detailed rules"
msgstr ""
msgid "None"
msgstr ""
msgid "No description"
msgstr ""
msgid "View all"
msgstr ""
msgid "By {0}"
msgstr ""
msgid "Draft"
msgid "Search"
msgstr ""
msgid "Your query"
@@ -542,9 +370,6 @@ msgstr ""
msgid "Article title matching these words"
msgstr ""
msgid "Title"
msgstr ""
# src/template_utils.rs:339
msgid "Subtitle matching these words"
msgstr ""
@@ -609,52 +434,6 @@ msgstr ""
msgid "Article license"
msgstr ""
msgid "Search result(s) for \"{0}\""
msgstr ""
msgid "Search result(s)"
msgstr ""
msgid "No results for your query"
msgstr ""
msgid "No more results for your query"
msgstr ""
msgid "Reset your password"
msgstr ""
# src/template_utils.rs:251
msgid "New password"
msgstr ""
# src/template_utils.rs:251
msgid "Confirmation"
msgstr ""
msgid "Update password"
msgstr ""
msgid "Check your inbox!"
msgstr ""
msgid "We sent a mail to the address you gave us, with a link to reset your password."
msgstr ""
# src/template_utils.rs:251
msgid "E-mail"
msgstr ""
msgid "Send password reset link"
msgstr ""
msgid "Log in"
msgstr ""
# src/template_utils.rs:251
msgid "Username, or email"
msgstr ""
msgid "Interact with {}"
msgstr ""
@@ -713,12 +492,6 @@ msgstr ""
msgid "Written by {0}"
msgstr ""
msgid "Edit"
msgstr ""
msgid "Delete this article"
msgstr ""
msgid "All rights reserved."
msgstr ""
@@ -748,6 +521,12 @@ msgstr ""
msgid "{0}Log in{1}, or {2}use your Fediverse account{3} to interact with this article"
msgstr ""
msgid "Unsubscribe"
msgstr ""
msgid "Subscribe"
msgstr ""
msgid "Comments"
msgstr ""
@@ -764,120 +543,16 @@ msgstr ""
msgid "No comments yet. Be the first to react!"
msgstr ""
msgid "Invalid CSRF token"
msgstr ""
msgid "Something is wrong with your CSRF token. Make sure cookies are enabled in you browser, and try reloading this page. If you continue to see this error message, please report it."
msgstr ""
msgid "Page not found"
msgstr ""
msgid "We couldn't find this page."
msgstr ""
msgid "The link that led you here may be broken."
msgstr ""
msgid "The content you sent can't be processed."
msgstr ""
msgid "Maybe it was too long."
msgstr ""
msgid "You are not authorized."
msgstr ""
msgid "Internal server error"
msgstr ""
msgid "Something broke on our side."
msgstr ""
msgid "Sorry about that. If you think this is a bug, please report it."
msgstr ""
msgid "Edit \"{}\""
msgstr ""
msgid "Description"
msgstr ""
msgid "You can upload images to your gallery, to use them as blog icons, or banners."
msgstr ""
msgid "Upload images"
msgstr ""
msgid "Blog icon"
msgstr ""
msgid "Blog banner"
msgstr ""
msgid "Update blog"
msgstr ""
msgid "Be very careful, any action taken here can't be reversed."
msgstr ""
msgid "Permanently delete this blog"
msgstr ""
msgid "New Blog"
msgstr ""
msgid "Create a blog"
msgstr ""
msgid "Create blog"
msgstr ""
msgid "{}'s icon"
msgstr ""
msgid "New article"
msgstr ""
msgid "There's one author on this blog: "
msgid_plural "There are {0} authors on this blog: "
msgstr[0] ""
msgid "No posts to see here yet."
msgstr ""
msgid "Articles tagged \"{0}\""
msgstr ""
msgid "There are currently no articles with such a tag"
msgstr ""
msgid "I'm from this instance"
msgstr ""
msgid "I'm from another instance"
msgstr ""
# src/template_utils.rs:259
msgid "Example: user@plu.me"
msgstr ""
msgid "Continue to your instance"
msgstr ""
msgid "Upload"
msgstr ""
msgid "You don't have any media yet."
msgstr ""
msgid "Content warning: {0}"
msgid "Are you sure?"
msgstr ""
msgid "Delete"
msgstr ""
msgid "Details"
msgid "This article is still a draft. Only you and other authors can see it."
msgstr ""
msgid "Only you and other authors can edit this article."
msgstr ""
msgid "Media upload"
@@ -895,6 +570,21 @@ msgstr ""
msgid "Send"
msgstr ""
msgid "Your media"
msgstr ""
msgid "Upload"
msgstr ""
msgid "You don't have any media yet."
msgstr ""
msgid "Content warning: {0}"
msgstr ""
msgid "Details"
msgstr ""
msgid "Media details"
msgstr ""
@@ -909,3 +599,333 @@ msgstr ""
msgid "Use as an avatar"
msgstr ""
msgid "Notifications"
msgstr ""
msgid "Plume"
msgstr ""
msgid "Menu"
msgstr ""
msgid "Dashboard"
msgstr ""
msgid "Log Out"
msgstr ""
msgid "My account"
msgstr ""
msgid "Log In"
msgstr ""
msgid "Register"
msgstr ""
msgid "About this instance"
msgstr ""
msgid "Privacy policy"
msgstr ""
msgid "Administration"
msgstr ""
msgid "Documentation"
msgstr ""
msgid "Source code"
msgstr ""
msgid "Matrix room"
msgstr ""
msgid "Your feed"
msgstr ""
msgid "Federated feed"
msgstr ""
msgid "Local feed"
msgstr ""
msgid "Nothing to see here yet. Try subscribing to more people."
msgstr ""
msgid "Articles from {}"
msgstr ""
msgid "All the articles of the Fediverse"
msgstr ""
msgid "Users"
msgstr ""
msgid "Configuration"
msgstr ""
msgid "Instances"
msgstr ""
msgid "Ban"
msgstr ""
msgid "Administration of {0}"
msgstr ""
# src/template_utils.rs:251
msgid "Name"
msgstr ""
msgid "Allow anyone to register here"
msgstr ""
msgid "Short description"
msgstr ""
msgid "Long description"
msgstr ""
# src/template_utils.rs:251
msgid "Default article license"
msgstr ""
msgid "Save these settings"
msgstr ""
msgid "About {0}"
msgstr ""
msgid "Runs Plume {0}"
msgstr ""
msgid "Home to <em>{0}</em> people"
msgstr ""
msgid "Who wrote <em>{0}</em> articles"
msgstr ""
msgid "And are connected to <em>{0}</em> other instances"
msgstr ""
msgid "Administred by"
msgstr ""
msgid "If you are browsing this site as a visitor, no data about you is collected."
msgstr ""
msgid "As a registered user, you have to provide your username (which does not have to be your real name), your functional email address and a password, in order to be able to log in, write articles and comment. The content you submit is stored until you delete it."
msgstr ""
msgid "When you log in, we store two cookies, one to keep your session open, the second to prevent other people to act on your behalf. We don't store any other cookies."
msgstr ""
msgid "Welcome to {}"
msgstr ""
msgid "Unblock"
msgstr ""
msgid "Block"
msgstr ""
msgid "Reset your password"
msgstr ""
# src/template_utils.rs:251
msgid "New password"
msgstr ""
# src/template_utils.rs:251
msgid "Confirmation"
msgstr ""
msgid "Update password"
msgstr ""
msgid "Log in"
msgstr ""
# src/template_utils.rs:251
msgid "Username, or email"
msgstr ""
# src/template_utils.rs:251
msgid "Password"
msgstr ""
# src/template_utils.rs:251
msgid "E-mail"
msgstr ""
msgid "Send password reset link"
msgstr ""
msgid "Check your inbox!"
msgstr ""
msgid "We sent a mail to the address you gave us, with a link to reset your password."
msgstr ""
msgid "Admin"
msgstr ""
msgid "It is you"
msgstr ""
msgid "Edit your profile"
msgstr ""
msgid "Open on {0}"
msgstr ""
msgid "Follow {}"
msgstr ""
msgid "Log in to follow"
msgstr ""
msgid "Enter your full username handle to follow"
msgstr ""
msgid "{0}'s subscriptions"
msgstr ""
msgid "Articles"
msgstr ""
msgid "Subscribers"
msgstr ""
msgid "Subscriptions"
msgstr ""
msgid "Create your account"
msgstr ""
msgid "Create an account"
msgstr ""
# src/template_utils.rs:251
msgid "Username"
msgstr ""
# src/template_utils.rs:251
msgid "Email"
msgstr ""
# src/template_utils.rs:251
msgid "Password confirmation"
msgstr ""
msgid "Apologies, but registrations are closed on this particular instance. You can, however, find a different one."
msgstr ""
msgid "{0}'s subscribers"
msgstr ""
msgid "Edit your account"
msgstr ""
msgid "Your Profile"
msgstr ""
msgid "To change your avatar, upload it to your gallery and then select from there."
msgstr ""
msgid "Upload an avatar"
msgstr ""
# src/template_utils.rs:251
msgid "Display name"
msgstr ""
msgid "Summary"
msgstr ""
msgid "Update account"
msgstr ""
msgid "Be very careful, any action taken here can't be cancelled."
msgstr ""
msgid "Delete your account"
msgstr ""
msgid "Sorry, but as an admin, you can't leave your own instance."
msgstr ""
msgid "Your Dashboard"
msgstr ""
msgid "Your Blogs"
msgstr ""
msgid "You don't have any blog yet. Create your own, or ask to join one."
msgstr ""
msgid "Start a new blog"
msgstr ""
msgid "Your Drafts"
msgstr ""
msgid "Go to your gallery"
msgstr ""
msgid "Atom feed"
msgstr ""
msgid "Recently boosted"
msgstr ""
msgid "What is Plume?"
msgstr ""
msgid "Plume is a decentralized blogging engine."
msgstr ""
msgid "Authors can manage multiple blogs, each as its own website."
msgstr ""
msgid "Articles are also visible on other Plume instances, and you can interact with them directly from other platforms like Mastodon."
msgstr ""
msgid "Read the detailed rules"
msgstr ""
msgid "View all"
msgstr ""
msgid "None"
msgstr ""
msgid "No description"
msgstr ""
msgid "By {0}"
msgstr ""
msgid "Draft"
msgstr ""
msgid "Respond"
msgstr ""
msgid "Delete this comment"
msgstr ""
msgid "I'm from this instance"
msgstr ""
msgid "I'm from another instance"
msgstr ""
# src/template_utils.rs:259
msgid "Example: user@plu.me"
msgstr ""
msgid "Continue to your instance"
msgstr ""
+492 -462
View File
File diff suppressed because it is too large Load Diff
+463 -436
View File
File diff suppressed because it is too large Load Diff
+468 -438
View File
File diff suppressed because it is too large Load Diff
+499 -469
View File
File diff suppressed because it is too large Load Diff
+441 -414
View File
File diff suppressed because it is too large Load Diff
+438 -411
View File
File diff suppressed because it is too large Load Diff