Allow linking to specific pages
This commit is contained in:
@ -71,25 +71,29 @@ div.negative-result {
|
|||||||
grid-auto-rows: 150px;
|
grid-auto-rows: 150px;
|
||||||
grid-gap: 10px;
|
grid-gap: 10px;
|
||||||
|
|
||||||
> div {
|
> a {
|
||||||
border: 2px solid #0055ba;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #008cba;
|
|
||||||
padding: 1em;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: flex;
|
text-decoration: none;
|
||||||
flex-flow: column-reverse;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
> .data {
|
> div {
|
||||||
flex-grow: 1;
|
border: 2px solid #0055ba;
|
||||||
font-size: 40px;
|
border-radius: 5px;
|
||||||
vertical-align: middle;
|
background-color: #008cba;
|
||||||
line-height: 50px;
|
padding: 1em;
|
||||||
}
|
display: flex;
|
||||||
|
flex-flow: column-reverse;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
> .title {
|
> .data {
|
||||||
height: 42px;
|
flex-grow: 1;
|
||||||
|
font-size: 40px;
|
||||||
|
vertical-align: middle;
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .title {
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,14 @@ module StatisticsHelper
|
|||||||
{
|
{
|
||||||
key: 'internal_users',
|
key: 'internal_users',
|
||||||
name: t('activerecord.models.internal_user.other'),
|
name: t('activerecord.models.internal_user.other'),
|
||||||
data: InternalUser.count
|
data: InternalUser.count,
|
||||||
|
url: internal_users_path
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'external_users',
|
key: 'external_users',
|
||||||
name: t('activerecord.models.external_user.other'),
|
name: t('activerecord.models.external_user.other'),
|
||||||
data: ExternalUser.count
|
data: ExternalUser.count,
|
||||||
|
url: external_users_path
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
@ -40,7 +42,8 @@ module StatisticsHelper
|
|||||||
{
|
{
|
||||||
key: 'exercises',
|
key: 'exercises',
|
||||||
name: t('activerecord.models.exercise.other'),
|
name: t('activerecord.models.exercise.other'),
|
||||||
data: Exercise.count
|
data: Exercise.count,
|
||||||
|
url: exercises_path
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'average_submissions',
|
key: 'average_submissions',
|
||||||
@ -55,13 +58,15 @@ module StatisticsHelper
|
|||||||
{
|
{
|
||||||
key: 'rfcs',
|
key: 'rfcs',
|
||||||
name: t('activerecord.models.request_for_comment.other'),
|
name: t('activerecord.models.request_for_comment.other'),
|
||||||
data: RequestForComment.count
|
data: RequestForComment.count,
|
||||||
|
url: request_for_comments_path
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'percent_solved',
|
key: 'percent_solved',
|
||||||
name: t('statistics.entries.request_for_comments.percent_solved'),
|
name: t('statistics.entries.request_for_comments.percent_solved'),
|
||||||
data: (100.0 / RequestForComment.count * RequestForComment.where(solved: true).count).round(2),
|
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',
|
key: 'comments',
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
h2 = section[:name]
|
h2 = section[:name]
|
||||||
.statistics-wrapper data-key=section[:key]
|
.statistics-wrapper data-key=section[:key]
|
||||||
- section[:entries].each do | entry |
|
- section[:entries].each do | entry |
|
||||||
div data-key=entry[:key]
|
a href=entry[:url]
|
||||||
.title = entry[:name]
|
div data-key=entry[:key]
|
||||||
.data = entry[:data].to_s + (entry[:unit] or '')
|
.title = entry[:name]
|
||||||
|
.data = entry[:data].to_s + (entry[:unit] or '')
|
||||||
|
Reference in New Issue
Block a user