1
//! The notes under a form. They never depend on the focused field, so the dialog keeps its
2
//! size when the focus moves; the keys are listed by Help.
3

            
4
use crate::form::FormKind;
5

            
6
const DATES: &str = "Dates: YYYY-MM-DD or RFC3339.";
7
const TIME: &str = "Date: YYYY-MM-DDTHH:MM";
8

            
9
458
fn notes(kind: FormKind) -> &'static [&'static str] {
10
458
    match kind {
11
9
        FormKind::Options => &[
12
9
            "Theme: role = fg on bg. Keys: scope: key = action.",
13
9
            "One per line. A keymap applies once saved.",
14
9
        ],
15
1
        FormKind::SshKeyAdd => &["Paste one public key line."],
16
        FormKind::CsvSave => &["An existing file asks first."],
17
4
        FormKind::Report(_) | FormKind::TransactionFilter => &[DATES],
18
270
        FormKind::TransactionCreate | FormKind::TransactionEdit => &[TIME],
19
        FormKind::FilterRow(_) => &["Tag: entities split by spaces, one value per line."],
20
        FormKind::ConfigSet
21
        | FormKind::CommodityCreate
22
        | FormKind::AccountCreate
23
        | FormKind::FilterAdd
24
        | FormKind::TemplatePick
25
        | FormKind::AccountMerge
26
        | FormKind::CommodityConvert
27
        | FormKind::AccountEdit
28
        | FormKind::CommodityEdit
29
        | FormKind::TagCreate
30
        | FormKind::TagEdit
31
        | FormKind::TemplateCreate
32
        | FormKind::TemplateEdit
33
        | FormKind::ScriptCreate
34
174
        | FormKind::ScriptEdit => &[],
35
    }
36
458
}
37

            
38
/// The footer lines of a `kind` form.
39
458
pub(super) fn footer_lines(kind: FormKind) -> Vec<String> {
40
458
    notes(kind).iter().map(|note| (*note).to_string()).collect()
41
458
}