Count items in database as much as possible (#344)

* Count items in database as much as possible

* Fix the tests

* Remove two useless queries

* Run pragma directive before each sqlite connection

* Pragma for tests too

* Remove debug messages
This commit is contained in:
Baptiste Gelez
2018-12-14 23:16:18 +01:00
committed by GitHub
parent b0089e59b7
commit 38302203f4
19 changed files with 109 additions and 60 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
@use template_utils::*;
@use routes::*;
@(ctx: BaseContext, blog: Blog, fqn: String, authors: &Vec<User>, total_articles: usize, page: i32, n_pages: i32, is_author: bool, posts: Vec<Post>)
@(ctx: BaseContext, blog: Blog, fqn: String, authors: &Vec<User>, total_articles: i64, page: i32, n_pages: i32, is_author: bool, posts: Vec<Post>)
@:base(ctx, blog.title.as_ref(), {}, {
<a href="@uri!(blogs::details: name = &fqn, page = _)">@blog.title</a>
+1 -1
View File
@@ -3,7 +3,7 @@
@use template_utils::*;
@use routes::*;
@(ctx: BaseContext, instance: Instance, admin: User, n_users: usize, n_articles: usize, n_instances: i64)
@(ctx: BaseContext, instance: Instance, admin: User, n_users: i64, n_articles: i64, n_instances: i64)
@:base(ctx, i18n!(ctx.1, "About {0}"; instance.name.clone()).as_str(), {}, {}, {
<h1>@i18n!(ctx.1, "About {0}"; instance.name)</h1>
+1 -1
View File
@@ -4,7 +4,7 @@
@use plume_models::posts::Post;
@use routes::*;
@(ctx: BaseContext, instance: Instance, n_users: i32, n_articles: i32, local: Vec<Post>, federated: Vec<Post>, user_feed: Option<Vec<Post>>)
@(ctx: BaseContext, instance: Instance, n_users: i64, n_articles: i64, local: Vec<Post>, federated: Vec<Post>, user_feed: Option<Vec<Post>>)
@:base(ctx, instance.name.clone().as_ref(), {}, {}, {
<h1>@i18n!(ctx.1, "Welcome on {}"; instance.name.as_str())</h1>
@@ -2,7 +2,7 @@
@use plume_models::instance::Instance;
@use routes::*;
@(ctx: BaseContext, instance: Instance, n_users: i32, n_articles: i32)
@(ctx: BaseContext, instance: Instance, n_users: i64, n_articles: i64)
<section class="spaced">
<div class="cards">
+1 -1
View File
@@ -9,7 +9,7 @@
@use routes::comments::NewCommentForm;
@use routes::*;
@(ctx: BaseContext, article: Post, blog: Blog, comment_form: &NewCommentForm, comment_errors: ValidationErrors, tags: Vec<Tag>, comments: Vec<Comment>, previous_comment: Option<Comment>, n_likes: usize, n_reshares: usize, has_liked: bool, has_reshared: bool, is_following: bool, author: User)
@(ctx: BaseContext, article: Post, blog: Blog, comment_form: &NewCommentForm, comment_errors: ValidationErrors, tags: Vec<Tag>, comments: Vec<Comment>, previous_comment: Option<Comment>, n_likes: i64, n_reshares: i64, has_liked: bool, has_reshared: bool, is_following: bool, author: User)
@:base(ctx, &article.title.clone(), {
<meta property="og:title" content="@article.title"/>