diff --git a/app/views/problems/stat.html.haml b/app/views/problems/stat.html.haml
--- a/app/views/problems/stat.html.haml
+++ b/app/views/problems/stat.html.haml
@@ -4,28 +4,34 @@
}
%h1 Problem stat: #{@problem.name}
-%h2 Overview
+
+.row.mb-3
+ .col-md-8
+ .card
+ .card-body
+ %h2.card-title Submission History
+ %canvas#chart{height: '50px'}
-.row
- .col-md-2
- %strong Name:
- .col-md-10
- = @problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1
- = link_to_description_if_any "[#{t 'main.problem_desc'}] ".html_safe, @problem
-.row
- .col-md-2.strong
- %strong Submissions:
- .col-md-10
- = @submissions.count
-.row
- .col-md-2.strong
- %strong Solved/Attemped User
- .col-md-10
- #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%)
-
-
-%h2 Submissions Count
-= render partial: 'application/bar_graph', locals: { histogram: @histogram }
+ .col-md-4
+ .card
+ .card-body
+ %h2.card-title General Info
+ .row
+ .col-sm-6
+ Name
+ .col-sm-6
+ = @problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1
+ = link_to_description_if_any "[#{t 'main.problem_desc'}] ".html_safe, @problem
+ .row
+ .col-sm-6
+ Subs
+ .col-sm-6
+ = @submissions.count
+ .row
+ .col-sm-6
+ Solved/Attempted User
+ .col-sm-6
+ #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%)
%h2 Submissions
- if @submissions and @submissions.count > 0
@@ -58,6 +64,27 @@
No submission
:javascript
- $("#main_table").DataTable({
- paging: false
+ $(document).on('import-map-loaded',(e) => {
+ //init datatable
+ $("#main_table").DataTable({
+ paging: false
+ });
+
+ //history graph
+ data = #{@chart_dataset}
+ config = {
+ type: 'bar',
+ data: data,
+ options: {
+ plugins: {
+ legend: {
+ display: false
+ },
+ },
+ }
+ }
+ Chart.defaults.font.size = 15
+ //Chart.defaults.font.family = 'Sarabun Light'
+ chart = new Chart($('#chart'),config)
});
+