Project Colors (#512)

* Inital tests

* Finish project colors

* Run fmt + clippy + prepare

* Fix dp+rp fmting
This commit is contained in:
Geometrically
2022-12-29 17:20:50 -07:00
committed by GitHub
parent 60bb6f105d
commit 5bb188a822
16 changed files with 1422 additions and 1062 deletions

View File

@@ -16,7 +16,7 @@ pub async fn index_local(
"
SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,
m.icon_url icon_url, m.published published, m.approved approved, m.updated updated,
m.team_id team_id, m.license license, m.slug slug, m.status status_name,
m.team_id team_id, m.license license, m.slug slug, m.status status_name, m.color color,
cs.name client_side_type, ss.name server_side_type, pt.name project_type_name, u.username username,
ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null and mc.is_additional is false) categories,
ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null and mc.is_additional is true) additional_categories,
@@ -96,6 +96,7 @@ pub async fn index_local(
gallery,
display_categories,
open_source,
color: m.color.map(|x| x as u32),
}
}))
})

View File

@@ -98,6 +98,7 @@ pub struct UploadSearchProject {
/// Unix timestamp of the last major modification
pub modified_timestamp: i64,
pub open_source: bool,
pub color: Option<u32>,
}
#[derive(Serialize, Deserialize, Debug)]
@@ -132,6 +133,7 @@ pub struct ResultSearchProject {
pub client_side: String,
pub server_side: String,
pub gallery: Vec<String>,
pub color: Option<u32>,
}
impl Document for UploadSearchProject {