diff --git a/app/views/performance/index.html.erb b/app/views/performance/index.html.erb index 65b0d6f..51ac658 100644 --- a/app/views/performance/index.html.erb +++ b/app/views/performance/index.html.erb @@ -1,50 +1,187 @@ -
-
-
-
-
-
-
- Performance History Visualization -
-
-
-
-
-
+
+
+
+

+ Performance Reviews +

+

Track your performance history and feedback

+
+
+ + +
+ <% + total_reviews = @perf.count + avg_score = @perf.any? ? (@perf.sum(&:score).to_f / total_reviews).round(1) : 0 + latest_score = @perf.last&.score || 0 + highest_score = @perf.any? ? @perf.max_by(&:score).score : 0 + %> + +
+
+
+
+
-
-
-
-
-
- Performance History -
-
-
- - +
+ Average Score +
+

+ <%= avg_score %> +

+

Out of 5.0

+ + + + +
+
+
+
+ +
+
+ Highest Score +
+

+ <%= highest_score %> +

+

Best performance

+
+
+
+ +
+
+
+
+ +
+
+ Latest Score +
+

+ <%= latest_score %> +

+

Most recent review

+
+
+
+ +
+
+
+
+ +
+
+ Total Reviews +
+

+ <%= total_reviews %> +

+

Performance evaluations

+
+
+
+ + + +
+
+
+
+

+ Performance Trend +

+

Your performance scores over time

+
+
+
+
+
+
+
+ + +
+
+
+
+

+ Performance History +

+

Detailed review feedback and comments

+
+
+
+
+ + + + + + + + + + <% if @perf.any? %> + <% @perf.each do |p| %> + + + + + + + <% end %> + <% else %> - - - - - - - - <% @perf.each do |p| %> - - - - - + <% end %> - -
+ Reviewer + + Date + + Score + + Comments +
+
+
+ +
+ <%= p.reviewer_name %> +
+
+ + <%= p.date_submitted %> + + + <% + score_color = case p.score + when 5 then 'success' + when 4 then 'primary' + when 3 then 'warning' + else 'danger' + end + %> + + <%= p.score %> / 5 + + +
+ <%= p.comments %> +
+
ReviewerDateScoreComments
<%= p.reviewer_name %><%= p.date_submitted %><%= p.score %><%= p.comments %> + +

No performance reviews available yet

+
-
+ +
+
@@ -79,47 +216,52 @@ function drawChart2() { var options = { min: 1, max: 5, - width: 'auto', - height: '160', + width: '100%', + height: 300, backgroundColor: 'transparent', - colors: ['#e26666', '#579da9', '#1e825e', '#b5799e', '#dba26b'], + colors: ['#e63946'], tooltip: { textStyle: { color: '#666666', - fontSize: 11 + fontSize: 12 }, showColorCode: true }, legend: { textStyle: { - color: 'black', - fontSize: 12 + color: '#333333', + fontSize: 13 } }, chartArea: { - left: 100, - top: 10 + left: 60, + top: 20, + right: 20, + bottom: 50, + width: '90%', + height: '70%' }, focusTarget: 'category', hAxis: { textStyle: { - color: 'black', - fontSize: 12 - } + color: '#666666', + fontSize: 11 + }, + slantedText: true, + slantedTextAngle: 45 }, vAxis: { textStyle: { - color: 'black', - fontSize: 12 + color: '#666666', + fontSize: 11 + }, + gridlines: { + color: '#f0f0f0' } }, - pointSize: 8, - chartArea: { - left: 60, - top: 10, - height: '80%' - }, - lineWidth: 2, + pointSize: 6, + lineWidth: 3, + curveType: 'function' }; var chart = new google.visualization.LineChart(chartElement); @@ -159,4 +301,31 @@ $(document).on('turbolinks:load', function() { initializeChart(); }); - \ No newline at end of file + + +