Compare commits

..

3 Commits

Author SHA1 Message Date
Ana Gelez 7d7a867bd1 Let's try with a comma 2020-01-31 08:44:16 +01:00
Ana Gelez c5fa90176c Add a "ci" feature to make clippy ignore docs warnings 2020-01-31 08:25:25 +01:00
Ana Gelez 55ccd1b4e4 Add warning for missing documentation 2020-01-21 17:41:32 +01:00
50 changed files with 11940 additions and 15692 deletions
+1 -2
View File
@@ -19,7 +19,7 @@ executors:
working_directory: ~/projects/Plume working_directory: ~/projects/Plume
environment: environment:
RUST_TEST_THREADS: 1 RUST_TEST_THREADS: 1
FEATURES: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>> FEATURES: <<#parameters.postgres>>postgres<</ parameters.postgres>><<^parameters.postgres>>sqlite<</parameters.postgres>>,ci
DATABASE_URL: <<#parameters.postgres>>postgres://postgres@localhost/plume<</parameters.postgres>><<^parameters.postgres>>plume.sqlite<</parameters.postgres>> DATABASE_URL: <<#parameters.postgres>>postgres://postgres@localhost/plume<</parameters.postgres>><<^parameters.postgres>>plume.sqlite<</parameters.postgres>>
@@ -226,7 +226,6 @@ jobs:
steps: steps:
- restore_env: - restore_env:
cache: none cache: none
- run: cargo build
- run: crowdin upload -b master - run: crowdin upload -b master
workflows: workflows:
-1
View File
@@ -18,4 +18,3 @@ tags.*
search_index search_index
.buildconfig .buildconfig
__pycache__ __pycache__
/.vscode/
Generated
+1204 -1170
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -79,6 +79,7 @@ postgres = ["plume-models/postgres", "diesel/postgres"]
sqlite = ["plume-models/sqlite", "diesel/sqlite"] sqlite = ["plume-models/sqlite", "diesel/sqlite"]
debug-mailer = [] debug-mailer = []
test = [] test = []
ci = ["plume-models/ci", "plume-api/ci", "plume-common/ci"]
[workspace] [workspace]
members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front", "plume-macro"] members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front", "plume-macro"]
+88 -22
View File
@@ -190,28 +190,7 @@ p.error {
background: $gray; background: $gray;
text-overflow: ellipsis; text-overflow: ellipsis;
footer.authors {
div {
float: left;
margin-right: 0.25em;
}
.likes { color: $red; }
.reshares { color: $primary; }
span.likes, span.resahres {
font-family: "Route159",serif;
font-size: 1em;
}
svg.feather {
width: 0.85em;
height: 0.85em;
}
}
> * { > * {
margin: 20px; margin: 20px;
@@ -490,6 +469,93 @@ figure {
/// Small screens /// Small screens
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}
body > header {
flex-direction: column;
nav#menu {
display: inline-flex;
z-index: 21;
}
#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}
body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
animation: 0.2s menuOpening;
&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;
z-index: -10;
background: $primary;
}
> nav {
flex-direction: column;
align-items: flex-start;
a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;
&.title { font-size: 1.8em; }
> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}
main .article-meta { main .article-meta {
> *, .comments { > *, .comments {
margin: 0 5%; margin: 0 5%;
-90
View File
@@ -101,96 +101,6 @@ body > header {
} }
} }
/// Small screens
@media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}
body > header {
flex-direction: column;
nav#menu {
display: inline-flex;
z-index: 21;
}
#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}
body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
animation: 0.2s menuOpening;
&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;
z-index: -10;
background: $primary;
}
> nav {
flex-direction: column;
align-items: flex-start;
a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;
&.title { font-size: 1.8em; }
> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}
}
/* Only enable label animations on large screens */ /* Only enable label animations on large screens */
@media screen and (min-width: 600px) { @media screen and (min-width: 600px) {
header nav a { header nav a {
+3
View File
@@ -7,3 +7,6 @@ edition = "2018"
[dependencies] [dependencies]
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
[features]
ci = []
+2
View File
@@ -1,3 +1,5 @@
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
+1
View File
@@ -23,3 +23,4 @@ path = "../plume-models"
[features] [features]
postgres = ["plume-models/postgres", "diesel/postgres"] postgres = ["plume-models/postgres", "diesel/postgres"]
sqlite = ["plume-models/sqlite", "diesel/sqlite"] sqlite = ["plume-models/sqlite", "diesel/sqlite"]
ci = ["plume-models/ci"]
+2 -1
View File
@@ -1,7 +1,8 @@
use dotenv; #![cfg_attr(not(feature = "ci"), warn(missing_docs))]
use clap::App; use clap::App;
use diesel::Connection; use diesel::Connection;
use dotenv;
use plume_models::{instance::Instance, Connection as Conn, CONFIG}; use plume_models::{instance::Instance, Connection as Conn, CONFIG};
use std::io::{self, prelude::*}; use std::io::{self, prelude::*};
+3
View File
@@ -30,3 +30,6 @@ version = "0.4"
[dependencies.pulldown-cmark] [dependencies.pulldown-cmark]
default-features = false default-features = false
version = "0.2.0" version = "0.2.0"
[features]
ci = []
+1
View File
@@ -1,3 +1,4 @@
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
#[macro_use] #[macro_use]
+3
View File
@@ -13,3 +13,6 @@ gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a
lazy_static = "1.3" lazy_static = "1.3"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
[features]
ci = []
+1
View File
@@ -1,5 +1,6 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
#![feature(decl_macro, proc_macro_hygiene, try_trait)] #![feature(decl_macro, proc_macro_hygiene, try_trait)]
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#[macro_use] #[macro_use]
extern crate gettext_macros; extern crate gettext_macros;
+1
View File
@@ -19,3 +19,4 @@ syn = "0.15.27"
default = [] default = []
postgres = [] postgres = []
sqlite = [] sqlite = []
ci = []
+1
View File
@@ -1,4 +1,5 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#[macro_use] #[macro_use]
extern crate quote; extern crate quote;
+1
View File
@@ -54,3 +54,4 @@ diesel_migrations = "1.3.0"
[features] [features]
postgres = ["diesel/postgres", "plume-macro/postgres" ] postgres = ["diesel/postgres", "plume-macro/postgres" ]
sqlite = ["diesel/sqlite", "plume-macro/sqlite" ] sqlite = ["diesel/sqlite", "plume-macro/sqlite" ]
ci = ["plume-macro/ci"]
+1
View File
@@ -1,6 +1,7 @@
#![feature(try_trait)] #![feature(try_trait)]
#![feature(never_type)] #![feature(never_type)]
#![feature(proc_macro_hygiene)] #![feature(proc_macro_hygiene)]
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#[macro_use] #[macro_use]
extern crate diesel; extern crate diesel;
-1
View File
@@ -54,7 +54,6 @@ pub enum Role {
} }
#[derive(Queryable, Identifiable, Clone, Debug, AsChangeset)] #[derive(Queryable, Identifiable, Clone, Debug, AsChangeset)]
#[changeset_options(treat_none_as_null = "true")]
pub struct User { pub struct User {
pub id: i32, pub id: i32,
pub username: String, pub username: String,
+481 -630
View File
File diff suppressed because it is too large Load Diff
+475 -645
View File
File diff suppressed because it is too large Load Diff
+466 -600
View File
File diff suppressed because it is too large Load Diff
+477 -688
View File
File diff suppressed because it is too large Load Diff
+470 -682
View File
File diff suppressed because it is too large Load Diff
+421 -549
View File
File diff suppressed because it is too large Load Diff
+433 -562
View File
File diff suppressed because it is too large Load Diff
+481 -641
View File
File diff suppressed because it is too large Load Diff
+471 -693
View File
File diff suppressed because it is too large Load Diff
+480 -684
View File
File diff suppressed because it is too large Load Diff
+469 -610
View File
File diff suppressed because it is too large Load Diff
+434 -565
View File
File diff suppressed because it is too large Load Diff
+470 -684
View File
File diff suppressed because it is too large Load Diff
+453 -659
View File
File diff suppressed because it is too large Load Diff
+542 -658
View File
File diff suppressed because it is too large Load Diff
+477 -691
View File
File diff suppressed because it is too large Load Diff
+395 -464
View File
File diff suppressed because it is too large Load Diff
+480 -686
View File
File diff suppressed because it is too large Load Diff
+441 -574
View File
File diff suppressed because it is too large Load Diff
+457 -594
View File
File diff suppressed because it is too large Load Diff
+477 -693
View File
File diff suppressed because it is too large Load Diff
+424 -553
View File
File diff suppressed because it is too large Load Diff
+430 -561
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -24,9 +24,9 @@ if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
apt-get install -y --no-install-recommends build-essential subversion ninja-build cmake apt-get install -y --no-install-recommends build-essential subversion ninja-build cmake
mkdir -p /scratch/src mkdir -p /scratch/src
cd /scratch/src cd /scratch/src
svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_900/final/ llvm svn co http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_800/final/ llvm
cd /scratch/src/llvm/tools cd /scratch/src/llvm/tools
svn co http://llvm.org/svn/llvm-project/lld/tags/RELEASE_900/final/ lld svn co http://llvm.org/svn/llvm-project/lld/tags/RELEASE_800/final/ lld
mkdir -p /scratch/build/arm mkdir -p /scratch/build/arm
cd /scratch/build/arm cd /scratch/build/arm
if [ "$ARCH" == "aarch64" ] ; then if [ "$ARCH" == "aarch64" ] ; then
+3 -4
View File
@@ -8,7 +8,7 @@ description: |
* Media management: you can upload pictures to illustrate your articles, but also audio files if you host a podcast, and manage them all from Plume. * Media management: you can upload pictures to illustrate your articles, but also audio files if you host a podcast, and manage them all from Plume.
* Federation: Plume is part of a network of interconnected websites called the Fediverse. Each of these websites (often called instances) have their own rules and thematics, but they can all communicate with each other. * Federation: Plume is part of a network of interconnected websites called the Fediverse. Each of these websites (often called instances) have their own rules and thematics, but they can all communicate with each other.
* Collaborative writing: invite other people to your blogs, and write articles together. * Collaborative writing: invite other people to your blogs, and write articles together.
grade: stable grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict confinement: strict
apps: apps:
@@ -25,13 +25,12 @@ parts:
plume: plume:
plugin: rust plugin: rust
source: . source: .
rust-revision: nightly-2020-01-15 rust-revision: nightly-2019-03-23
build-packages: build-packages:
- libssl-dev - libssl-dev
- pkg-config - pkg-config
- libsqlite3-dev - libsqlite3-dev
- gettext - gettext
- libclang-8-dev
- on arm64,armhf,ppc64el,s390x: - on arm64,armhf,ppc64el,s390x:
- lld-8 - lld-8
override-build: | override-build: |
@@ -43,7 +42,7 @@ parts:
# Only Tier 1 Rust platforms get rust-lld # Only Tier 1 Rust platforms get rust-lld
# On the others (arm64, armhf, powerpc64, s390x) fall back to using # On the others (arm64, armhf, powerpc64, s390x) fall back to using
# the system LLD we've installed earlier. # the system LLD we've installed earlier.
case ${SNAPCRAFT_ARCH_TRIPLET} in \ case ${SNAPCRAFT_ARCH_TRIPLE} in \
aarch64-linux-gnu|arm-linux-gnueabihf|powerpc64-linux-gnu|s390x-linux-gnu) \ aarch64-linux-gnu|arm-linux-gnueabihf|powerpc64-linux-gnu|s390x-linux-gnu) \
RUSTFLAGS="-C linker=lld-8" cargo web deploy -p plume-front --release \ RUSTFLAGS="-C linker=lld-8" cargo web deploy -p plume-front --release \
;; \ ;; \
+1
View File
@@ -1,4 +1,5 @@
#![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_arguments)]
#![cfg_attr(not(feature = "ci"), warn(missing_docs))]
#![feature(decl_macro, proc_macro_hygiene, try_trait)] #![feature(decl_macro, proc_macro_hygiene, try_trait)]
#[macro_use] #[macro_use]
+3 -3
View File
@@ -3,7 +3,7 @@ use lettre::Transport;
use rocket::http::ext::IntoOwned; use rocket::http::ext::IntoOwned;
use rocket::{ use rocket::{
http::{uri::Uri, Cookie, Cookies, SameSite}, http::{uri::Uri, Cookie, Cookies, SameSite},
request::LenientForm, request::{Form, LenientForm},
response::{Flash, Redirect}, response::{Flash, Redirect},
State, State,
}; };
@@ -159,7 +159,7 @@ pub struct ResetForm {
#[post("/password-reset", data = "<form>")] #[post("/password-reset", data = "<form>")]
pub fn password_reset_request( pub fn password_reset_request(
mail: State<'_, Arc<Mutex<Mailer>>>, mail: State<'_, Arc<Mutex<Mailer>>>,
form: LenientForm<ResetForm>, form: Form<ResetForm>,
rockets: PlumeRocket, rockets: PlumeRocket,
) -> Ructe { ) -> Ructe {
if User::find_by_email(&*rockets.conn, &form.email).is_ok() { if User::find_by_email(&*rockets.conn, &form.email).is_ok() {
@@ -216,7 +216,7 @@ fn passwords_match(form: &NewPasswordForm) -> Result<(), ValidationError> {
#[post("/password-reset/<token>", data = "<form>")] #[post("/password-reset/<token>", data = "<form>")]
pub fn password_reset( pub fn password_reset(
token: String, token: String,
form: LenientForm<NewPasswordForm>, form: Form<NewPasswordForm>,
rockets: PlumeRocket, rockets: PlumeRocket,
) -> Result<Flash<Redirect>, Ructe> { ) -> Result<Flash<Redirect>, Ructe> {
form.validate() form.validate()
+1 -4
View File
@@ -399,10 +399,7 @@ pub fn update(
) )
.0, .0,
); );
user.preferred_theme = form user.preferred_theme = form.theme.clone();
.theme
.clone()
.and_then(|t| if &t == "" { None } else { Some(t) });
user.hide_custom_css = form.hide_custom_css; user.hide_custom_css = form.hide_custom_css;
let _: User = user.save_changes(&*conn).map_err(Error::from)?; let _: User = user.save_changes(&*conn).map_err(Error::from)?;
+2 -2
View File
@@ -32,9 +32,9 @@
<form method="post" action="@uri!(instance::delete_email_blocklist)"> <form method="post" action="@uri!(instance::delete_email_blocklist)">
<header> <header>
@if emails.is_empty() { @if emails.is_empty() {
<p class="center" >@i18n!(ctx.1, "There are no blocked emails on your instance")</p>
} else {
<input type="submit" class="destructive" value='@i18n!(ctx.1, "Delete selected emails")'> <input type="submit" class="destructive" value='@i18n!(ctx.1, "Delete selected emails")'>
} else {
<p class="center" >@i18n!(ctx.1, "There are no blocked emails on your instance")</p>
} }
</header> </header>
<div class="list"> <div class="list">
+10 -23
View File
@@ -17,30 +17,17 @@
<p class="p-summary" dir="auto">@article.subtitle</p> <p class="p-summary" dir="auto">@article.subtitle</p>
</main> </main>
<footer class="authors"> <footer class="authors">
<div> @Html(i18n!(ctx.1, "By {0}"; format!(
@Html(i18n!(ctx.1, "By {0}"; format!( "<a class=\"p-author h-card\" href=\"{}\">{}</a>",
"<a class=\"p-author h-card\" href=\"{}\">{}</a>", uri!(user::details: name = &article.get_authors(ctx.0).unwrap_or_default()[0].fqn),
uri!(user::details: name = &article.get_authors(ctx.0).unwrap_or_default()[0].fqn), escape(&article.get_authors(ctx.0).unwrap_or_default()[0].name())
escape(&article.get_authors(ctx.0).unwrap_or_default()[0].name()) )))
))) @if article.published {
@if article.published { <span class="dt-published" datetime="@article.creation_date.format("%F %T")">@article.creation_date.format("%B %e, %Y")</span>
<span class="dt-published" datetime="@article.creation_date.format("%F %T")">@article.creation_date.format("%B %e, %Y")</span> }
} <a href="@uri!(blogs::details: name = &article.get_blog(ctx.0).unwrap().fqn, page = _)">@article.get_blog(ctx.0).unwrap().title</a>
<a href="@uri!(blogs::details: name = &article.get_blog(ctx.0).unwrap().fqn, page = _)">@article.get_blog(ctx.0).unwrap().title</a>
</div>
@if !article.published { @if !article.published {
<div>⋅ @i18n!(ctx.1, "Draft")</div> ⋅ @i18n!(ctx.1, "Draft")
} else {
<div>
<span class="likes" aria-label="@i18n!(ctx.1, "One like", "{0} likes"; article.count_likes(ctx.0).unwrap_or_default())" title="@i18n!(ctx.1, "One like", "{0} likes"; article.count_likes(ctx.0).unwrap_or_default())">
@icon!("heart") @article.count_likes(ctx.0).unwrap_or_default()
</span>
<span class="reshares" aria-label="@i18n!(ctx.1, "One like", "{0} boost"; article.count_reshares(ctx.0).unwrap_or_default())" title="@i18n!(ctx.1, "One boost", "{0} boosts"; article.count_reshares(ctx.0).unwrap_or_default())">
@icon!("repeat") @article.count_reshares(ctx.0).unwrap_or_default()
</span>
</div>
} }
</footer> </footer>
</div> </div>
-1
View File
@@ -25,7 +25,6 @@
.default(login_form.password) .default(login_form.password)
.error(&login_errs) .error(&login_errs)
.set_prop("minlength", 1) .set_prop("minlength", 1)
.input_type("password")
.html(ctx.1)) .html(ctx.1))
<input type="submit" value="@i18n!(ctx.1, "Log in")" /> <input type="submit" value="@i18n!(ctx.1, "Log in")" />
</form> </form>