feat: Add admin flag to user and templates
Passes an `is_admin` flag to the `CaseRecordingsTemplate` and `case_page.html`. This flag determines whether the full case ID is displayed in the meta section for administrative users. It also influences the header display on the case page to prioritize the oneliner when available.
This commit is contained in:
@@ -153,6 +153,7 @@ struct CaseRecordingsTemplate {
|
||||
oneliner: Option<String>,
|
||||
recordings: Vec<RecordingView>,
|
||||
transcribe_busy: bool,
|
||||
is_admin: bool,
|
||||
}
|
||||
|
||||
/// Flags derived from filesystem state + config.
|
||||
@@ -349,6 +350,7 @@ pub async fn handle_case_recordings(
|
||||
|
||||
let t_busy = pipeline.transcribe_busy.0.load(Ordering::Acquire);
|
||||
let case_id_short = case_id_str.chars().take(8).collect();
|
||||
let is_admin = user.is_admin();
|
||||
|
||||
CaseRecordingsTemplate {
|
||||
slug: user.slug,
|
||||
@@ -357,6 +359,7 @@ pub async fn handle_case_recordings(
|
||||
oneliner,
|
||||
recordings,
|
||||
transcribe_busy: t_busy,
|
||||
is_admin,
|
||||
}
|
||||
.render()
|
||||
.map(Html)
|
||||
|
||||
Reference in New Issue
Block a user