Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legal category #116

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions clomonitor-apiserver/src/filters.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
/// Template filter that returns the section score x-axis translate value for
/// the score bar.
pub fn rs_section_score_arrow_t_x(score: &usize) -> ::askama::Result<usize> {
let v = score + 19;
if v < 23 {
return Ok(23);
}
Ok(v)
pub fn rs_section_score_arrow_t_x(score: &usize) -> ::askama::Result<f64> {
Ok((158.0 + *score as f64 * 1.21).round())
}

/// Template filter that returns the width of the section score bar.
pub fn rs_section_score_width(score: &usize) -> ::askama::Result<usize> {
if *score < 100 {
return Ok(score.saturating_sub(4));
}
Ok(*score)
pub fn rs_section_score_width(score: &usize) -> ::askama::Result<f64> {
Ok((*score as f64 * 1.21).round())
}

/// Template filter that returns the rating letter corresponding to the score
Expand Down
206 changes: 126 additions & 80 deletions clomonitor-apiserver/templates/report-summary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading