Skip to content

Instantly share code, notes, and snippets.

@creich
Created September 7, 2012 15:02
Show Gist options
  • Save creich/3666923 to your computer and use it in GitHub Desktop.
Save creich/3666923 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag 'tt_report', :plugin => 'redmine_time_tracker', :media => "all" %>
<%= javascript_include_tag 'mootools/mootools-core-1.4.5-full-compat-yc.js', :plugin => 'redmine_time_tracker' %>
<%= javascript_include_tag 'mootools/mootools-more-1.4.0.1.js', :plugin => 'redmine_time_tracker' %>
<%= javascript_include_tag 'MilkChart.yc.js', :plugin => 'redmine_time_tracker' %>
</head>
<body>
<table style="width: 100%;">
<tr>
<td id="tt_report-title">
<h2><%= Setting.plugin_redmine_time_tracker[:report_title] %></h2>
</td>
<td id="tt_report-logo">
<%= image_tag @logo_url, :border => 0, :width => @logo_width, :alt => "Insert Your logo via plugin-settings", :plugin => (@logo_external ? nil : 'redmine_time_tracker') %>
</td>
</tr>
</table>
<table style="width: 100%;">
<tr>
<td id="tt_report-statistics">
<!--TODO localize labels!-->
Total Time<br/>
<%= @total_booked_time %>
</td>
<td id="tt_report-chart-td">
<table id="tt_report-print-chart-table">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<tr></tr>
</tbody>
<tfoot>
<tr>
<td></td>
</tr>
</tfoot>
</table>
</td>
</tr>
</table>
<table class="list">
<thead>
<tr>
<th class="tt_report-date">Date</th>
<th class="tt_report-desc-head">Description</th>
<th class="tt_report-time">Time Spent</th>
<th class="tt_report-pers-head">Person</th>
</tr>
</thead>
<tbody>
<% @bookings.each do |entry| -%>
<!--TODO insert grouped-functionality-->
<tr id="entry-<%= entry.id %>" class="entry <%= cycle('odd', 'even') %>">
<td class="tt_report-date"><%= entry.tt_booking_date %></td>
<td>
<div>
<div style="min-height: 1em;"><%= entry.comments %></div>
<div class="tt_list-project"><%= entry.project.name unless entry.project.nil? %></div>
</div>
</td>
<td class="tt_report-time"><%= help.time_string4report(entry.get_formatted_time) %></td>
<td><%= entry.user.name %></td>
</tr>
<% end -%>
</tbody>
</table>
</body>
</html>
<script type="text/javascript">
window.addEvent("domready", function () {
var w = document.getElementById("tt_report-chart-td").getWidth();
var chart = new MilkChart.Column("tt_report-print-chart-table", {width:w, height:300, showKey:false});
var json = {
"title":"Booked hours by day",
"colNames":["hours"],
// "rowNames":["Q1", "Q2", "Q3", "Q4"],
"rowNames": <%= raw @chart_data[:dates].to_json %>,
"rows": <%= @chart_data[:hours].to_json %>
};
chart.setData(json);
chart.render();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment