add: require that users keep supporter status for profilestyle products

This commit is contained in:
trisua 2025-08-10 16:20:23 -04:00
parent 59378a4447
commit bcee3f7763
2 changed files with 15 additions and 7 deletions

View file

@ -624,9 +624,8 @@
(div (div
("class" "flex items_center") ("class" "flex items_center")
(b (b
(text "{{ self::full_username(user=user, max_width=\"calc(100% - 42px - var(--pad-4))\") }}")) (text "{{ self::full_username(user=user) }}"))
(text "{{ self::online_indicator(user=user) }}")))) (text "{{ self::online_indicator(user=user) }}"))))
(text "{%- endmacro %} {% macro pagination(page=0, items=0, key=\"\", value=\"\") -%}") (text "{%- endmacro %} {% macro pagination(page=0, items=0, key=\"\", value=\"\") -%}")
(div (div
("class" "flex justify_between gap_2 w_full") ("class" "flex justify_between gap_2 w_full")
@ -1359,7 +1358,7 @@
(text "{{ self::avatar(username=user.username, size=\"42px\", selector_type=\"username\") }}")) (text "{{ self::avatar(username=user.username, size=\"42px\", selector_type=\"username\") }}"))
(div (div
("class" "flex justify_center flex_col") ("class" "flex justify_center flex_col")
("style" "{% if show_menu or show_kick -%}width: 60%{% else %}max-width: 150px{%- endif %}") ("style" "{% if show_menu or show_kick -%}width: 60%{% else %}max-width: calc(100% - 42px - var(--pad-4)){%- endif %}")
(text "{{ self::full_username(user=user) }}") (text "{{ self::full_username(user=user) }}")
(div (div
("class" "user_status") ("class" "user_status")

View file

@ -1098,10 +1098,19 @@ impl DataManager {
let mut out = Vec::new(); let mut out = Vec::new();
for config in &user.applied_configurations { for config in &user.applied_configurations {
let product = match self.get_product_by_id(config.1).await { let product = self.get_product_by_id(config.1).await?;
Ok(x) => x, let owner = self.get_user_by_id_with_void(product.owner).await?;
Err(_) => continue,
}; if config.0 == AppliedConfigType::StyleSnippet
&& !owner.permissions.check(FinePermission::SUPPORTER)
{
out.push(format!(
"<script>console.warn(\"{} has stopped their supporter subscription, so this applied configuration no longer works.\");</script>",
owner.username
));
continue;
}
out.push(match config.0 { out.push(match config.0 {
AppliedConfigType::StyleSnippet => { AppliedConfigType::StyleSnippet => {