need to create the bar graph version, write up the remaining parts of the tutorial, and ensure it did not break the DOM vuln
This commit is contained in:
@@ -9,4 +9,18 @@ class DashboardController < ApplicationController
|
||||
cookies[:font] = params[:font]
|
||||
end
|
||||
end
|
||||
|
||||
def change_graph
|
||||
self.try(params[:graph])
|
||||
end
|
||||
|
||||
def bar_graph
|
||||
render :partial => "layouts/dashboard/bar_graph"
|
||||
end
|
||||
|
||||
def pie_charts
|
||||
@user = current_user
|
||||
render :partial => "layouts/dashboard/dashboard_stats"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,9 +2,34 @@
|
||||
<div class="main-container">
|
||||
<div class="row-fluid">
|
||||
<div class="span12"> <!--begin span12 -->
|
||||
<div class="widget">
|
||||
<div class="widget-header">
|
||||
<div class="title">
|
||||
<span class="fs1" aria-hidden="true" data-icon=""></span> Current Statistics
|
||||
</div>
|
||||
<!-- Begin Title Buttons-->
|
||||
<div class="tools pull-right">
|
||||
<div class="btn-group">
|
||||
<a id="change_to_bar_graph" class="btn btn-small">
|
||||
<span data-icon=""></span>
|
||||
</a>
|
||||
<a id="change_to_pie_charts" class="btn btn-small">
|
||||
<span data-icon=""></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Title Buttons-->
|
||||
</div>
|
||||
<div id="charts_body" class="widget-body">
|
||||
<% if @user.paid_time_off %>
|
||||
<%= render :partial => "layouts/dashboard/dashboard_stats"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- end span12 -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,9 +184,21 @@ function pieChartHome() {
|
||||
|
||||
}
|
||||
|
||||
$("#change_to_bar_graph").click(function(event) {
|
||||
event.preventDefault();
|
||||
$("#charts_body").load(<%= sanitize change_graph_dashboard_index_path(:graph => "bar_graph").inspect %>);
|
||||
|
||||
})
|
||||
|
||||
$("#change_to_pie_charts").click(function(event) {
|
||||
event.preventDefault();
|
||||
$("#charts_body").load(<%= sanitize change_graph_dashboard_index_path(:graph => "pie_charts").inspect %>);
|
||||
})
|
||||
|
||||
$(document).ready(
|
||||
makeActive,
|
||||
pieChartHome()
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<h1> Hello </h1>
|
||||
@@ -1,19 +1,4 @@
|
||||
<div class="widget">
|
||||
<div class="widget-header">
|
||||
<div class="title">
|
||||
<span class="fs1" aria-hidden="true" data-icon=""></span> Current Statistics
|
||||
</div>
|
||||
<!-- Begin Title Buttons-->
|
||||
<div class="tools pull-right">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-small">
|
||||
<span data-icon=""></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Title Buttons-->
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
<!-- Begin easy pie charts container -->
|
||||
<div class="easy-pie-charts-container">
|
||||
<div class="pie-chart">
|
||||
<div class="chart1" data-percent="100">
|
||||
@@ -58,7 +43,12 @@
|
||||
<div class="clearfix">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End easy pie charts container -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(
|
||||
pieChartHome()
|
||||
);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ Railsgoat::Application.routes.draw do
|
||||
resources :dashboard do
|
||||
collection do
|
||||
get "home"
|
||||
get "change_graph"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+1606
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user