add(ui): show community owner in member list
fix: don't show replies on profile
This commit is contained in:
parent
fd33c0c7d8
commit
f14f84773e
3 changed files with 19 additions and 1 deletions
|
@ -8,6 +8,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card flex flex-col gap-4">
|
<div class="card flex flex-col gap-4">
|
||||||
|
{% if page == 0 %}
|
||||||
|
<div class="card-nest">
|
||||||
|
<div class="card small flex items-center gap-2">
|
||||||
|
{{ icon "crown" }}
|
||||||
|
<span>Owner</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ components::user_card(user=owner) }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
{% for item in list %}
|
{% for item in list %}
|
||||||
<div class="card-nest">
|
<div class="card-nest">
|
||||||
|
|
|
@ -464,6 +464,12 @@ pub async fn members_request(
|
||||||
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
|
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// get community owner
|
||||||
|
let owner = match data.0.get_user_by_id(community.owner).await {
|
||||||
|
Ok(ua) => ua,
|
||||||
|
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
|
||||||
|
};
|
||||||
|
|
||||||
// init context
|
// init context
|
||||||
let lang = get_lang!(jar, data.0);
|
let lang = get_lang!(jar, data.0);
|
||||||
let mut context = initial_context(&data.0.0, lang, &user).await;
|
let mut context = initial_context(&data.0.0, lang, &user).await;
|
||||||
|
@ -480,6 +486,7 @@ pub async fn members_request(
|
||||||
|
|
||||||
context.insert("list", &list);
|
context.insert("list", &list);
|
||||||
context.insert("page", &props.page);
|
context.insert("page", &props.page);
|
||||||
|
context.insert("owner", &owner);
|
||||||
community_context(
|
community_context(
|
||||||
&mut context,
|
&mut context,
|
||||||
&community,
|
&community,
|
||||||
|
|
|
@ -144,7 +144,7 @@ impl DataManager {
|
||||||
|
|
||||||
let res = query_rows!(
|
let res = query_rows!(
|
||||||
&conn,
|
&conn,
|
||||||
"SELECT * FROM posts WHERE owner = $1 AND NOT context LIKE '%\"is_profile_pinned\":true%' AND NOT context LIKE '%\"is_nsfw\":true%' ORDER BY created DESC LIMIT $2 OFFSET $3",
|
"SELECT * FROM posts WHERE owner = $1 AND replying_to = 0 AND NOT context LIKE '%\"is_profile_pinned\":true%' AND NOT context LIKE '%\"is_nsfw\":true%' ORDER BY created DESC LIMIT $2 OFFSET $3",
|
||||||
&[&(id as i64), &(batch as i64), &((page * batch) as i64)],
|
&[&(id as i64), &(batch as i64), &((page * batch) as i64)],
|
||||||
|x| { Self::get_post_from_row(x) }
|
|x| { Self::get_post_from_row(x) }
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue