From 86c0dec0c00e429d6968a1813b34d609d834bf8a Mon Sep 17 00:00:00 2001 From: Tomasz Gieniusz Date: Sun, 21 Oct 2012 16:13:56 +0200 Subject: [PATCH] index redirect to general --- lib/git_stats/stats_view/view.rb | 10 +++++++++- templates/activity.haml | 6 +++--- templates/{index.haml => general.haml} | 0 templates/static/index.html | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) rename templates/{index.haml => general.haml} (100%) create mode 100644 templates/static/index.html diff --git a/lib/git_stats/stats_view/view.rb b/lib/git_stats/stats_view/view.rb index 9ece87abf..505f9186a 100644 --- a/lib/git_stats/stats_view/view.rb +++ b/lib/git_stats/stats_view/view.rb @@ -6,6 +6,7 @@ module GitStats end def render_all + prepare_static_content prepare_assets layout = Tilt.new("templates/layout.haml") @@ -16,8 +17,15 @@ module GitStats end end + + private + def all_templates - %w(index activity authors files lines) + %w(general activity authors files lines) + end + + def prepare_static_content + FileUtils.cp_r(Dir['templates/static/*'], @out_path) end def prepare_assets diff --git a/templates/activity.haml b/templates/activity.haml index 33ff9a755..c80335eb6 100644 --- a/templates/activity.haml +++ b/templates/activity.haml @@ -37,7 +37,7 @@ %tr %th= :percentage.t - repo.activity.by_hour_array.each do |commits| - %td= (commits * 100.0 / repo.activity.by_hour_array.sum).round(2) + %td= (commits * 100.0 / repo.activity.by_hour_array.sum).round(1) = high_chart("charts.activity_by_hour", charts.activity_by_hour) .tab-pane{id: 'day_of_week'} @@ -55,7 +55,7 @@ %tr %th= :percentage.t - repo.activity.by_wday_array.each do |commits| - %td= (commits * 100.0 / repo.activity.by_wday_array.sum).round(2) + %td= (commits * 100.0 / repo.activity.by_wday_array.sum).round(1) = high_chart("charts.activity_by_wday", charts.activity_by_wday) @@ -88,7 +88,7 @@ %tr %th= :percentage.t - repo.activity.by_month_array.each do |commits| - %td= (commits * 100.0 / repo.activity.by_month_array.sum).round(2) + %td= (commits * 100.0 / repo.activity.by_month_array.sum).round(1) = high_chart("charts.activity_by_month", charts.activity_by_month) diff --git a/templates/index.haml b/templates/general.haml similarity index 100% rename from templates/index.haml rename to templates/general.haml diff --git a/templates/static/index.html b/templates/static/index.html new file mode 100644 index 000000000..25bf1f642 --- /dev/null +++ b/templates/static/index.html @@ -0,0 +1,5 @@ + + + + +