diff --git a/app/assets/stylesheets/statistics.css.scss b/app/assets/stylesheets/statistics.css.scss index bf5e5c05..dd66f0e6 100644 --- a/app/assets/stylesheets/statistics.css.scss +++ b/app/assets/stylesheets/statistics.css.scss @@ -71,25 +71,29 @@ div.negative-result { grid-auto-rows: 150px; grid-gap: 10px; - > div { - border: 2px solid #0055ba; - border-radius: 5px; - background-color: #008cba; - padding: 1em; + > a { color: #fff; - display: flex; - flex-flow: column-reverse; - text-align: center; + text-decoration: none; - > .data { - flex-grow: 1; - font-size: 40px; - vertical-align: middle; - line-height: 50px; - } + > div { + border: 2px solid #0055ba; + border-radius: 5px; + background-color: #008cba; + padding: 1em; + display: flex; + flex-flow: column-reverse; + text-align: center; - > .title { - height: 42px; + > .data { + flex-grow: 1; + font-size: 40px; + vertical-align: middle; + line-height: 50px; + } + + > .title { + height: 42px; + } } } } diff --git a/app/helpers/statistics_helper.rb b/app/helpers/statistics_helper.rb index 0b91b808..08e7ee88 100644 --- a/app/helpers/statistics_helper.rb +++ b/app/helpers/statistics_helper.rb @@ -25,12 +25,14 @@ module StatisticsHelper { key: 'internal_users', name: t('activerecord.models.internal_user.other'), - data: InternalUser.count + data: InternalUser.count, + url: internal_users_path }, { key: 'external_users', name: t('activerecord.models.external_user.other'), - data: ExternalUser.count + data: ExternalUser.count, + url: external_users_path } ] end @@ -40,7 +42,8 @@ module StatisticsHelper { key: 'exercises', name: t('activerecord.models.exercise.other'), - data: Exercise.count + data: Exercise.count, + url: exercises_path }, { key: 'average_submissions', @@ -55,13 +58,15 @@ module StatisticsHelper { key: 'rfcs', name: t('activerecord.models.request_for_comment.other'), - data: RequestForComment.count + data: RequestForComment.count, + url: request_for_comments_path }, { key: 'percent_solved', name: t('statistics.entries.request_for_comments.percent_solved'), data: (100.0 / RequestForComment.count * RequestForComment.where(solved: true).count).round(2), - unit: '%' + unit: '%', + url: request_for_comments_path + '?q%5Bsolved_not_eq%5D=0' }, { key: 'comments', diff --git a/app/views/statistics/show.html.slim b/app/views/statistics/show.html.slim index 8846457b..bf06d2e0 100644 --- a/app/views/statistics/show.html.slim +++ b/app/views/statistics/show.html.slim @@ -4,6 +4,7 @@ h2 = section[:name] .statistics-wrapper data-key=section[:key] - section[:entries].each do | entry | - div data-key=entry[:key] - .title = entry[:name] - .data = entry[:data].to_s + (entry[:unit] or '') + a href=entry[:url] + div data-key=entry[:key] + .title = entry[:name] + .data = entry[:data].to_s + (entry[:unit] or '')