|
15 | 15 | = check_box_tag :include_subgroups, "true", statistic.include_subgroups?, class: "form-check-input", data: { submit: true } |
16 | 16 | = label_tag :include_subgroups, t(".include_subgroups"), class: "form-check-label" |
17 | 17 |
|
18 | | -.card.mb-3 |
19 | | - .card-header.d-flex.justify-content-between.align-items-center |
20 | | - %h3.card-title.mb-0 |
21 | | - = statistic.group.to_s |
22 | | - = t(".including_subgroups") if statistic.includes_subgroups? |
23 | | - %span |
24 | | - = t(".persons_count", count: statistic.total_count) |
25 | | - .card-body |
26 | | - = render_card title: t('.overview') do |
27 | | - %dl.row |
28 | | - - rows = [ | |
29 | | - { label_key: t('.total_count'), value: statistic.total_count }, | |
30 | | - { label_key: t('.magazine_subscribers_count'), value: statistic.magazine_subscribers_count } | |
31 | | - ] | |
32 | | - = render partial: 'overview_row', collection: rows, as: :row |
33 | | - %p.text-muted.small= t('.magazine_subscribers_hint') |
34 | | - .row |
35 | | - .col-lg-6 |
36 | | - = render_card statistic.language_breakdown, title: t('.language_title') do |breakdown| |
37 | | - %table.table.table-bordered.text-end |
38 | | - %colgroup |
39 | | - %col{style: "width: 40%"} |
40 | | - %col{style: "width: 20%"} |
41 | | - %col{style: "width: 40%"} |
42 | | - %thead |
43 | | - %tr |
44 | | - %th.text-start= t('.language') |
45 | | - %th= t('.count') |
46 | | - %th= t('.share') |
47 | | - %tbody |
48 | | - - breakdown.each do |bucket| |
49 | | - %tr |
50 | | - %td.text-start= bucket.label |
51 | | - %td= bucket.count |
52 | | - %td= number_to_percentage(bucket.percent, precision: 1) |
53 | | - .col-lg-6 |
54 | | - = render_card statistic.gender_breakdown, title: t('.gender_title') do |gender_breakdown| |
55 | | - %table.table.table-bordered.text-end |
56 | | - %colgroup |
57 | | - %col{style: "width: 40%"} |
58 | | - %col{style: "width: 20%"} |
59 | | - %col{style: "width: 40%"} |
60 | | - %thead |
61 | | - %tr |
62 | | - %th.text-start= t('.gender') |
63 | | - %th= t('.count') |
64 | | - %th= t('.share') |
65 | | - %tbody |
66 | | - - gender_breakdown.each do |bucket| |
67 | | - %tr |
68 | | - %td.text-start= bucket.label |
69 | | - %td= bucket.count |
70 | | - %td= number_to_percentage(bucket.percent, precision: 1) |
71 | | - |
72 | | - = render_card statistic.age_groups, title: t('.age_structure_title') do |age_groups| |
| 18 | += render_card title: t('.overview') do |
| 19 | + %dl.row |
| 20 | + - rows = [ | |
| 21 | + { label_key: t('.total_count'), value: statistic.total_count }, | |
| 22 | + { label_key: t('.magazine_subscribers_count'), value: statistic.magazine_subscribers_count } | |
| 23 | + ] | |
| 24 | + = render partial: 'overview_row', collection: rows, as: :row |
| 25 | + %p.text-muted.small= t('.magazine_subscribers_hint') |
| 26 | +.row |
| 27 | + .col-lg-6 |
| 28 | + = render_card statistic.language_breakdown, title: t('.language_title') do |breakdown| |
73 | 29 | %table.table.table-bordered.text-end |
74 | 30 | %colgroup |
75 | | - %col{style: "width: 15%"} |
76 | | - %col{style: "width: 10%"} |
77 | | - %col{style: "width: 15%"} |
78 | | - %col{style: "width: 60%"} |
| 31 | + %col{style: "width: 40%"} |
| 32 | + %col{style: "width: 20%"} |
| 33 | + %col{style: "width: 40%"} |
79 | 34 | %thead |
80 | 35 | %tr |
81 | | - %th |
| 36 | + %th.text-start= t('.language') |
82 | 37 | %th= t('.count') |
83 | | - %th |
84 | | - %span.pe-2= t('.share') |
| 38 | + %th= t('.share') |
85 | 39 | %tbody |
86 | | - - age_groups.each do |bucket| |
| 40 | + - breakdown.each do |bucket| |
87 | 41 | %tr |
88 | | - %td= bucket.label |
| 42 | + %td.text-start= bucket.label |
89 | 43 | %td= bucket.count |
90 | 44 | %td= number_to_percentage(bucket.percent, precision: 1) |
91 | | - %td |
92 | | - .progress.ms-2 |
93 | | - .progress-bar{style: "width: #{distribution_bar_width(bucket.percent / 100.0, 1.0)}"} |
| 45 | + .col-lg-6 |
| 46 | + = render_card statistic.gender_breakdown, title: t('.gender_title') do |gender_breakdown| |
| 47 | + %table.table.table-bordered.text-end |
| 48 | + %colgroup |
| 49 | + %col{style: "width: 40%"} |
| 50 | + %col{style: "width: 20%"} |
| 51 | + %col{style: "width: 40%"} |
| 52 | + %thead |
| 53 | + %tr |
| 54 | + %th.text-start= t('.gender') |
| 55 | + %th= t('.count') |
| 56 | + %th= t('.share') |
| 57 | + %tbody |
| 58 | + - gender_breakdown.each do |bucket| |
| 59 | + %tr |
| 60 | + %td.text-start= bucket.label |
| 61 | + %td= bucket.count |
| 62 | + %td= number_to_percentage(bucket.percent, precision: 1) |
| 63 | + |
| 64 | += render_card statistic.age_groups, title: t('.age_structure_title') do |age_groups| |
| 65 | + %table.table.table-bordered.text-end |
| 66 | + %colgroup |
| 67 | + %col{style: "width: 15%"} |
| 68 | + %col{style: "width: 10%"} |
| 69 | + %col{style: "width: 15%"} |
| 70 | + %col{style: "width: 60%"} |
| 71 | + %thead |
| 72 | + %tr |
| 73 | + %th |
| 74 | + %th= t('.count') |
| 75 | + %th |
| 76 | + %span.pe-2= t('.share') |
| 77 | + %tbody |
| 78 | + - age_groups.each do |bucket| |
| 79 | + %tr |
| 80 | + %td= bucket.label |
| 81 | + %td= bucket.count |
| 82 | + %td= number_to_percentage(bucket.percent, precision: 1) |
| 83 | + %td |
| 84 | + .progress.ms-2 |
| 85 | + .progress-bar{style: "width: #{distribution_bar_width(bucket.percent / 100.0, 1.0)}"} |
0 commit comments