--- /dev/null
+drop view site_view;
+
+create view site_view as
+select *,
+(select name from user_ u where s.creator_id = u.id) as creator_name,
+(select count(*) from user_) as number_of_users,
+(select count(*) from post) as number_of_posts,
+(select count(*) from comment) as number_of_comments
+from site s;
--- /dev/null
+drop view site_view;
+
+create view site_view as
+select *,
+(select name from user_ u where s.creator_id = u.id) as creator_name,
+(select count(*) from user_) as number_of_users,
+(select count(*) from post) as number_of_posts,
+(select count(*) from comment) as number_of_comments,
+(select count(*) from community) as number_of_communities
+from site s;
number_of_users -> BigInt,
number_of_posts -> BigInt,
number_of_comments -> BigInt,
+ number_of_communities -> BigInt,
}
}
pub number_of_users: i64,
pub number_of_posts: i64,
pub number_of_comments: i64,
+ pub number_of_communities: i64,
}
impl SiteView {
number_of_users: null,
number_of_posts: null,
number_of_comments: null,
+ number_of_communities: null,
},
admins: [],
banned: [],
<li className="list-inline-item badge badge-secondary">
<T i18nKey="number_of_users" interpolation={{count: this.state.site.site.number_of_users}}>#</T>
</li>
+ <li className="list-inline-item badge badge-secondary">
+ <T i18nKey="number_of_communities" interpolation={{count: this.state.site.site.number_of_communities}}>#</T>
+ </li>
<li className="list-inline-item badge badge-secondary">
<T i18nKey="number_of_posts" interpolation={{count: this.state.site.site.number_of_posts}}>#</T>
</li>
number_of_users: number;
number_of_posts: number;
number_of_comments: number;
+ number_of_communities: number;
}
export interface FollowCommunityForm {
subscribed_to_communities:'Subscribed to <1>communities</1>',
trending_communities:'Trending <1>communities</1>',
list_of_communities: 'List of communities',
+ number_of_communities:'{{count}} Communities',
community_reqs: 'lowercase, underscores, and no spaces.',
edit: 'edit',
reply: 'reply',