Add legal information (fixes #721) (#2273)

This commit is contained in:
Nutomic 2022-05-19 20:32:40 +00:00 committed by GitHub
parent 60e9586530
commit 9ef0efa420
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 0 deletions

View file

@ -133,6 +133,7 @@ pub struct EditSite {
pub private_instance: Option<bool>, pub private_instance: Option<bool>,
pub default_theme: Option<String>, pub default_theme: Option<String>,
pub default_post_listing_type: Option<String>, pub default_post_listing_type: Option<String>,
pub legal_information: Option<String>,
pub auth: Sensitive<String>, pub auth: Sensitive<String>,
} }

View file

@ -84,6 +84,7 @@ impl PerformCrud for EditSite {
private_instance: data.private_instance, private_instance: data.private_instance,
default_theme: data.default_theme.clone(), default_theme: data.default_theme.clone(),
default_post_listing_type: data.default_post_listing_type.clone(), default_post_listing_type: data.default_post_listing_type.clone(),
legal_information: data.legal_information.clone(),
..SiteForm::default() ..SiteForm::default()
}; };

View file

@ -463,6 +463,7 @@ table! {
public_key -> Text, public_key -> Text,
default_theme -> Text, default_theme -> Text,
default_post_listing_type -> Text, default_post_listing_type -> Text,
legal_information -> Nullable<Text>,
} }
} }

View file

@ -31,6 +31,7 @@ pub struct Site {
pub public_key: String, pub public_key: String,
pub default_theme: String, pub default_theme: String,
pub default_post_listing_type: String, pub default_post_listing_type: String,
pub legal_information: Option<String>,
} }
#[derive(Default)] #[derive(Default)]
@ -59,4 +60,5 @@ pub struct SiteForm {
pub public_key: Option<String>, pub public_key: Option<String>,
pub default_theme: Option<String>, pub default_theme: Option<String>,
pub default_post_listing_type: Option<String>, pub default_post_listing_type: Option<String>,
pub legal_information: Option<String>,
} }

View file

@ -0,0 +1 @@
alter table site drop column legal_information;

View file

@ -0,0 +1 @@
alter table site add column legal_information text;