Merge branch 'master' into mobile-margins

should fix build issues
mobile-margins
Trinity Pointard 4 years ago
commit b637db8a24

34
Cargo.lock generated

@ -756,8 +756,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "email"
version = "0.0.19"
source = "git+https://github.com/lettre/rust-email#3086d7bcda2c3b3fa4b1297cba216151ce4a3efc"
version = "0.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1342,13 +1342,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lettre"
version = "0.9.0"
source = "git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49#c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"fast_chemail 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1361,14 +1359,12 @@ dependencies = [
[[package]]
name = "lettre_email"
version = "0.9.0"
source = "git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49#c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"email 0.0.19 (git+https://github.com/lettre/rust-email)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49)",
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"email 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1966,8 +1962,8 @@ dependencies = [
"gettext-utils 0.1.0 (git+https://github.com/Plume-org/gettext-macros/?rev=a7c605f7edd6bfbfbfe7778026bfefd88d82db10)",
"guid-create 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49)",
"lettre_email 0.9.0 (git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49)",
"lettre 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lettre_email 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"multipart 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"plume-api 0.3.0",
@ -3785,7 +3781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e"
"checksum either 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a39bffec1e2015c5d8a6773cb0cf48d0d758c842398f624c34969071f5499ea7"
"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b"
"checksum email 0.0.19 (git+https://github.com/lettre/rust-email)" = "<none>"
"checksum email 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "91549a51bb0241165f13d57fc4c72cef063b4088fb078b019ecbf464a45f22e4"
"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
"checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
"checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
@ -3851,8 +3847,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
"checksum lettre 0.9.0 (git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49)" = "<none>"
"checksum lettre_email 0.9.0 (git+https://github.com/lettre/lettre?rev=c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49)" = "<none>"
"checksum lettre 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c66afaa5dfadbb81d4e00fd1d1ab057c7cd4c799c5a44e0009386d553587e728"
"checksum lettre_email 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bbb68ca999042d965476e47bbdbacd52db0927348b6f8062c44dd04a3b1fd43b"
"checksum levenshtein_automata 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73a004f877f468548d8d0ac4977456a249d8fabbdb8416c36db163dfc8f2e8ca"
"checksum libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319"
"checksum libsqlite3-sys 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd6457c70bbff456d9fe49deaba35ec47c3e598bf8d7950ff0575ceb7a8a6ad1"

@ -16,8 +16,8 @@ gettext-macros = { git = "https://github.com/Plume-org/gettext-macros/", rev = "
gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
guid-create = "0.1"
heck = "0.3.0"
lettre = { git = "https://github.com/lettre/lettre", rev = "c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49" }
lettre_email = { git = "https://github.com/lettre/lettre", rev = "c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49" }
lettre = "0.9.2"
lettre_email = "0.9.2"
num_cpus = "1.10"
rocket = "0.4.0"
rocket_contrib = { version = "0.4.0", features = ["json"] }

@ -1,4 +1,4 @@
// Heading
/* Heading */
main header.article {
overflow: hidden;
background: $background;
@ -73,7 +73,7 @@ main .article-info {
}
}
// The article itself
/* The article itself */
main article {
max-width: $article-width;
margin: 2.5em auto;
@ -104,7 +104,7 @@ main article {
}
}
// Metadata under the article
/* Metadata under the article */
main .article-meta, main .article-meta button {
padding: 0;
font-size: 1.1em;
@ -129,7 +129,7 @@ main .article-meta {
font-size: 0.9em;
}
// Article Tags
/* Article Tags */
.tags {
list-style: none;
padding: 0px;
@ -154,7 +154,7 @@ main .article-meta {
}
}
// Likes & Boosts
/* Likes & Boosts */
.actions {
display: flex;
flex-direction: row;
@ -257,7 +257,7 @@ main .article-meta {
}
}
// Comments
/* Comments */
.comments {
margin: 0 $horizontal-margin;
@ -271,7 +271,7 @@ main .article-meta {
cursor: pointer;
}
// New comment form
/* New comment form */
> form input[type="submit"] {
font-size: 1em;
-webkit-appearance: none;
@ -421,7 +421,7 @@ main .article-meta {
}
// content warning
/* Content warning */
.cw-container {
position: relative;
display: inline-block;
@ -459,7 +459,7 @@ input:checked ~ .cw-container > .cw-text {
transform: translateY(-50%);
}
// Bottom action bar
/* Bottom action bar */
.bottom-bar {
z-index: 10;
@ -482,11 +482,11 @@ input:checked ~ .cw-container > .cw-text {
}
}
// Footnote related styles
/* Footnote related styles */
.footnote-definition {
p {
font-size: smaller;
// Make sur the definition is inline with the label-definition
/* Make sure the definition is inline with the label-definition */
display: inline;
}
}

@ -1,6 +1,6 @@
@import '_variables';
// Color Scheme
/* Color Scheme */
$gray: #1a3854;
$black: #102e4a;
$white: #F8F8F8;

@ -44,7 +44,7 @@ input[type="checkbox"] {
-webkit-appearance: checkbox;
}
/** Inline forms (containing only CSRF token and a <submit>, for protected links) **/
/* Inline forms (containing only CSRF token and a <submit>, for protected links) */
form.inline {
display: inline;
@ -111,7 +111,7 @@ input[type="submit"] {
-webkit-appearance: none;
}
// Writing page
/* The writing page */
form.new-post {
max-width: 60em;
.title {

@ -68,7 +68,7 @@ small {
appearance: none;
}
/// Main
/* Main */
body > main > *, .h-feed > * {
margin: 1em $horizontal-margin;
}
@ -137,13 +137,13 @@ main {
}
}
/// Errors
/* Errors */
p.error {
color: $red;
font-weight: bold;
}
/// User page
/* User page */
.user h1 {
display: flex;
flex-direction: row;
@ -170,7 +170,7 @@ p.error {
margin: 2em 0px;
}
/// Cards
/* Cards */
.cards {
display: flex;
flex-direction: row;
@ -249,7 +249,7 @@ p.error {
}
}
/// Instance presentation
/* Instance presentation */
.presentation {
max-width: none;
@ -263,7 +263,7 @@ p.error {
}
}
// Stats
/* Stats */
.stats {
display: flex;
justify-content: space-around;
@ -287,7 +287,7 @@ p.error {
}
}
/// Pagination
/* Pagination */
.pagination {
display: flex;
justify-content: space-evenly;
@ -297,7 +297,7 @@ p.error {
}
}
/// Flex boxes
/* Flex boxes */
.flex {
display: flex;
flex-direction: row;
@ -332,7 +332,7 @@ p.error {
margin-right: 2em;
}
/// Footer
/* Footer */
body > footer {
display: flex;
align-content: center;

@ -101,7 +101,7 @@ body > header {
}
}
// Only enable label animations on normal screens
/* Only enable label animations on large screens */
@media screen and (min-width: 600px) {
header nav a {
i {

@ -1,4 +1,4 @@
// Color Scheme
/* Color Scheme */
$gray: #F3F3F3;
$black: #242424;
$white: #F8F8F8;
@ -16,13 +16,13 @@ $primary: $purple;
$primary-text-color: $white; // text color on primary background (buttons for instance)
$success-color: $green;
// Dimensions
/* Dimensions */
$article-width: 70ch;
$horizontal-margin: 20%;
$margin: 0 $horizontal-margin;
// Fonts
/* Fonts */
$route159: "Route159", serif;
$playfair: "Playfair Display", serif;

@ -1,6 +0,0 @@
-- This file should undo anything in `up.sql`
--#!|_conn, path: &Path| {
--#! let mut pb = path.to_path_buf();
--#! pb.push("search_index");
--#! std::fs::remove_dir_all(pb).map_err(Error::from)
--#!}

@ -1,10 +0,0 @@
-- Your SQL goes here
--#!|conn: &Connection, path: &Path| {
--#! use std::env::var;
--#! let mut pb = Path::new(&var("SEARCH_INDEX")
--#! .unwrap_or_else(|_|"search_index".to_owned())).to_path_buf();
--#! let searcher = super::search::Searcher::create(&pb)?;
--#! searcher.fill(conn)?;
--#! searcher.commit();
--#! Ok(())
--#!}

@ -1,17 +1,6 @@
-- Your SQL goes here
--#!|conn: &Connection, path: &Path| {
--#! super::timeline::Timeline::new_for_instance(conn, "Local feed".into(), "local".into()).expect("Local feed creation error");
--#! super::timeline::Timeline::new_for_instance(conn, "Federated feed".into(), "all".into()).expect("Federated feed creation error");
--#!
--#! for i in 0.. {
--#! if let Some(users) = super::users::User::get_local_page(conn, (i * 20, (i + 1) * 20)).ok().filter(|l| !l.is_empty()) {
--#! for u in users {
--#! super::timeline::Timeline::new_for_user(conn, u.id, "Your feed".into(), format!("followed or author in [ {} ]", u.fqn)).expect("User feed creation error");
--#! }
--#! } else {
--#! break;
--#! }
--#! }
--#!
--#! Ok(())
--#!}
INSERT INTO timeline_definition (name, query) VALUES
('Local feed', 'local'),
('Federated feed', 'all');
INSERT INTO timeline_definition (user_id,name,query)
select id,'Your feed',CONCAT('followed or [',fqn,']') from users;

@ -0,0 +1,8 @@
DELETE FROM timeline WHERE id IN
(
SELECT timeline.id FROM timeline
INNER JOIN timeline_definition ON timeline.timeline_id = timeline_definition.id
WHERE timeline_definition.query LIKE 'followed or [%]' OR
timeline_definition.query = 'local' OR
timeline_definition.query = 'all'
);

@ -0,0 +1,18 @@
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts,timeline_definition
WHERE timeline_definition.query = 'all';
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts
CROSS JOIN timeline_definition
INNER JOIN blogs ON posts.blog_id = blogs.id
INNER JOIN instances ON blogs.instance_id = instances.id
WHERE timeline_definition.query = 'local' and instances.local = true;
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts
INNER JOIN blog_authors ON posts.blog_id = blog_authors.blog_id
LEFT JOIN follows ON blog_authors.author_id = follows.following_id
INNER JOIN timeline_definition ON follows.follower_id = timeline_definition.user_id
or blog_authors.author_id = timeline_definition.user_id
WHERE timeline_definition.query LIKE 'followed or [%]';

@ -1,6 +0,0 @@
-- This file should undo anything in `up.sql`
--#!|_conn, path: &Path| {
--#! let mut pb = path.to_path_buf();
--#! pb.push("search_index");
--#! std::fs::remove_dir_all(pb).map_err(Error::from)
--#!}

@ -1,10 +0,0 @@
-- Your SQL goes here
--#!|conn: &Connection, path: &Path| {
--#! use std::env::var;
--#! let mut pb = Path::new(&var("SEARCH_INDEX")
--#! .unwrap_or_else(|_|"search_index".to_owned())).to_path_buf();
--#! let searcher = super::search::Searcher::create(&pb)?;
--#! searcher.fill(conn)?;
--#! searcher.commit();
--#! Ok(())
--#!}

@ -1,17 +1,6 @@
-- Your SQL goes here
--#!|conn: &Connection, path: &Path| {
--#! super::timeline::Timeline::new_for_instance(conn, "Local feed".into(), "local".into()).expect("Local feed creation error");
--#! super::timeline::Timeline::new_for_instance(conn, "Federated feed".into(), "all".into()).expect("Federated feed creation error");
--#!
--#! for i in 0.. {
--#! if let Some(users) = super::users::User::get_local_page(conn, (i * 20, (i + 1) * 20)).ok().filter(|l| !l.is_empty()) {
--#! for u in users {
--#! super::timeline::Timeline::new_for_user(conn, u.id, "Your feed".into(), format!("followed or author in [ {} ]", u.fqn)).expect("User feed creation error");
--#! }
--#! } else {
--#! break;
--#! }
--#! }
--#!
--#! Ok(())
--#!}
INSERT INTO timeline_definition (name, query) VALUES
('Local feed', 'local'),
('Federated feed', 'all');
INSERT INTO timeline_definition (user_id,name,query)
select id,'Your feed','followed or ['||fqn||']' from users;

@ -0,0 +1,8 @@
DELETE FROM timeline WHERE id IN
(
SELECT timeline.id FROM timeline
INNER JOIN timeline_definition ON timeline.timeline_id = timeline_definition.id
WHERE timeline_definition.query LIKE 'followed or [%]' OR
timeline_definition.query = 'local' OR
timeline_definition.query = 'all'
);

@ -0,0 +1,17 @@
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts,timeline_definition
WHERE timeline_definition.query = 'all';
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts,timeline_definition
INNER JOIN blogs ON posts.blog_id = blogs.id
INNER JOIN instances ON blogs.instance_id = instances.id
WHERE timeline_definition.query = 'local' and instances.local = 1;
INSERT INTO timeline (post_id, timeline_id)
SELECT posts.id,timeline_definition.id FROM posts
INNER JOIN blog_authors ON posts.blog_id = blog_authors.blog_id
LEFT JOIN follows ON blog_authors.author_id = follows.following_id
INNER JOIN timeline_definition ON follows.follower_id = timeline_definition.user_id
or blog_authors.author_id = timeline_definition.user_id
WHERE timeline_definition.query LIKE 'followed or [%]';

@ -5,6 +5,7 @@ export ROCKET_SECRET_KEY="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
plm migration run
plm migration redo
plm search init
plm instance new -d plume-test.local -n plume-test
plm users new -n admin -N 'Admin' -e 'email@exemple.com' -p 'password'

@ -24,6 +24,7 @@
<link href='@Instance::get_local().unwrap().compute_box("~", &blog.fqn, "atom.xml")' rel='alternate' type='application/atom+xml'>
<link href='@blog.ap_url' rel='alternate' type='application/activity+json'>
<link href='@blog.ap_url' rel='canonical'>
@if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) {
@if let Some(ref theme) = blog.theme {
<link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(theme).join("theme.css"), _build_id = CACHE_NAME)">
@ -61,7 +62,7 @@
<a href="@uri!(blogs::edit: name = &blog.fqn)" class="button" dir="auto">@i18n!(ctx.1, "Edit")</a>
}
</div>
<main class="user-summary" dir="auto">
<p>
@i18n!(ctx.1, "There's one author on this blog: ", "There are {0} authors on this blog: "; authors.len())

@ -20,6 +20,7 @@
}
<meta property="og:url" content="@uri!(posts::details: blog = &blog.fqn, slug = &article.slug, responding_to = _)"/>
<meta property="og:description" content="@article.subtitle"/>
<link rel="canonical" href="@article.ap_url"/>
@if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) {
@if let Some(ref theme) = blog.theme {

@ -22,6 +22,7 @@
<link href='@Instance::get_local().unwrap().compute_box("@", &user.fqn, "atom.xml")' rel='alternate' type='application/atom+xml'>
<link href='@user.ap_url' rel='alternate' type='application/activity+json'>
<link rel="canonical" href="@user.ap_url"/>
}, {}, {
@:header(ctx, &user, follows, is_remote, remote_url)

Loading…
Cancel
Save