Merged r10368 to r10373 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.1-stable@10374 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1095,8 +1095,14 @@ module ApplicationHelper
|
|||||||
unless @calendar_headers_tags_included
|
unless @calendar_headers_tags_included
|
||||||
@calendar_headers_tags_included = true
|
@calendar_headers_tags_included = true
|
||||||
content_for :header_tags do
|
content_for :header_tags do
|
||||||
|
start_of_week = Setting.start_of_week
|
||||||
|
start_of_week = l(:general_first_day_of_week, :default => '1') if start_of_week.blank?
|
||||||
|
# Redmine uses 1..7 (monday..sunday) in settings and locales
|
||||||
|
# JQuery uses 0..6 (sunday..saturday), 7 needs to be changed to 0
|
||||||
|
start_of_week = start_of_week.to_i % 7
|
||||||
|
|
||||||
tags = javascript_tag(
|
tags = javascript_tag(
|
||||||
"var datepickerOptions={dateFormat: 'yy-mm-dd', " +
|
"var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
|
||||||
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
|
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
|
||||||
path_to_image('/images/calendar.png') +
|
path_to_image('/images/calendar.png') +
|
||||||
"', showButtonPanel: true};")
|
"', showButtonPanel: true};")
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<%= javascript_include_tag 'raphael.js' %>
|
<%= javascript_tag do %>
|
||||||
<%= javascript_include_tag 'revision_graph.js' %>
|
|
||||||
<script type="text/javascript" charset="utf-8">
|
|
||||||
function revisionGraphHandler(){
|
function revisionGraphHandler(){
|
||||||
drawRevisionGraph(
|
drawRevisionGraph(
|
||||||
document.getElementById('holder'),
|
document.getElementById('holder'),
|
||||||
@@ -10,5 +8,11 @@ function revisionGraphHandler(){
|
|||||||
}
|
}
|
||||||
$(document).ready(revisionGraphHandler);
|
$(document).ready(revisionGraphHandler);
|
||||||
$(window).resize(revisionGraphHandler);
|
$(window).resize(revisionGraphHandler);
|
||||||
</script>
|
<% end %>
|
||||||
|
|
||||||
<div id="holder" class="revision-graph"></div>
|
<div id="holder" class="revision-graph"></div>
|
||||||
|
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= javascript_include_tag 'raphael' %>
|
||||||
|
<%= javascript_include_tag 'revision_graph' %>
|
||||||
|
<% end %>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -35,6 +35,9 @@ function drawRevisionGraph(holder, commits_hash, graph_space) {
|
|||||||
var path, title;
|
var path, title;
|
||||||
var revision_dot_overlay;
|
var revision_dot_overlay;
|
||||||
$.each(commits, function(index, commit) {
|
$.each(commits, function(index, commit) {
|
||||||
|
if (!commit.hasOwnProperty("space"))
|
||||||
|
commit.space = 0;
|
||||||
|
|
||||||
y = commit_table_rows.eq(max_rdmid - commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
|
y = commit_table_rows.eq(max_rdmid - commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
|
||||||
x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space;
|
x = graph_x_offset + XSTEP / 2 + XSTEP * commit.space;
|
||||||
revisionGraph.circle(x, y, 3)
|
revisionGraph.circle(x, y, 3)
|
||||||
@@ -46,6 +49,9 @@ function drawRevisionGraph(holder, commits_hash, graph_space) {
|
|||||||
$.each(commit.parent_scmids, function(index, parent_scmid) {
|
$.each(commit.parent_scmids, function(index, parent_scmid) {
|
||||||
parent_commit = commits_by_scmid[parent_scmid];
|
parent_commit = commits_by_scmid[parent_scmid];
|
||||||
if (parent_commit) {
|
if (parent_commit) {
|
||||||
|
if (!parent_commit.hasOwnProperty("space"))
|
||||||
|
parent_commit.space = 0;
|
||||||
|
|
||||||
parent_y = commit_table_rows.eq(max_rdmid - parent_commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
|
parent_y = commit_table_rows.eq(max_rdmid - parent_commit.rdmid).position().top - graph_y_offset + CIRCLE_INROW_OFFSET;
|
||||||
parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space;
|
parent_x = graph_x_offset + XSTEP / 2 + XSTEP * parent_commit.space;
|
||||||
if (parent_commit.space == commit.space) {
|
if (parent_commit.space == commit.space) {
|
||||||
|
|||||||
Reference in New Issue
Block a user