Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
89 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,68 @@ | ||
<div class="col-lg-9"> | ||
<% if @tag %> | ||
<div id="note-graph" style="height:100px;"></div> | ||
<div class="col-12"> | ||
<% if @tag %> | ||
<div id="note-graph" style="height:100px;"></div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/frappe-charts@0.0.8/dist/frappe-charts.min.iife.js"></script> | ||
<script type="text/javascript"> | ||
var notes = <%= @tag.contribution_graph_making.to_a.sort.to_json %> | ||
let months = ["J", "F", "M", "A", "M", "J", "J", "A","S", "O", "N", "D"]; | ||
let i; | ||
let labels = new Array(); | ||
for(i = 0; i < notes.length; i++) | ||
labels[i] = ""; | ||
let count = 0; | ||
let prev = 0; | ||
for(i = 0; i < notes.length; i++){ | ||
if(notes[i][1][0] != prev){ | ||
if(count == 4){ | ||
let j; | ||
labels[i - 2] = months[prev - 1]; | ||
} | ||
else{ | ||
labels[i - 3] = months[prev - 1]; | ||
} | ||
prev = notes[i][1][0]; | ||
count = 0; | ||
} | ||
count++; | ||
} | ||
if(count >= 3){ | ||
labels[notes.length - 3] = months[prev - 1]; | ||
} | ||
let title = "note"; | ||
let values = new Array(); | ||
for (j = 0; j < notes.length; j++){ | ||
values[j] = notes[j][1][1]; | ||
} | ||
let data = new Object(); | ||
data.labels = labels; | ||
let datasets = new Array(); | ||
let obj = new Object(); | ||
obj.title = title; | ||
obj.values = new Array(); | ||
obj.values = values; | ||
datasets[0] = new Object(); | ||
datasets[0] = obj; | ||
data.datasets = datasets; | ||
let chart = new Chart({ | ||
parent: "#note-graph", | ||
data: data, | ||
type: "bar", | ||
height: 115, | ||
x_axis_mode: "tick", | ||
y_axis_mode: "span", | ||
is_series: 1, | ||
colors: ['purple'] | ||
}); | ||
</script> | ||
<script src="https://cdn.jsdelivr.net/npm/frappe-charts@0.0.8/dist/frappe-charts.min.iife.js"></script> | ||
<script type="text/javascript"> | ||
var notes = <%= @tag.contribution_graph_making.to_a.sort.to_json %> | ||
let months = ["J", "F", "M", "A", "M", "J", "J", "A","S", "O", "N", "D"]; | ||
let i; | ||
let labels = new Array(); | ||
for(i = 0; i < notes.length; i++) | ||
labels[i] = ""; | ||
let count = 0; | ||
let prev = 0; | ||
for(i = 0; i < notes.length; i++){ | ||
if(notes[i][1][0] != prev){ | ||
if(count == 4){ | ||
let j; | ||
labels[i - 2] = months[prev - 1]; | ||
} | ||
else{ | ||
labels[i - 3] = months[prev - 1]; | ||
} | ||
prev = notes[i][1][0]; | ||
count = 0; | ||
} | ||
count++; | ||
} | ||
if(count >= 3){ | ||
labels[notes.length - 3] = months[prev - 1]; | ||
} | ||
let title = "note"; | ||
let values = new Array(); | ||
for (j = 0; j < notes.length; j++){ | ||
values[j] = notes[j][1][1]; | ||
} | ||
let data = new Object(); | ||
data.labels = labels; | ||
let datasets = new Array(); | ||
let obj = new Object(); | ||
obj.title = title; | ||
obj.values = new Array(); | ||
obj.values = values; | ||
datasets[0] = new Object(); | ||
datasets[0] = obj; | ||
data.datasets = datasets; | ||
let chart = new Chart({ | ||
parent: "#note-graph", | ||
data: data, | ||
type: "bar", | ||
height: 115, | ||
x_axis_mode: "tick", | ||
y_axis_mode: "span", | ||
is_series: 1, | ||
colors: ['purple'] | ||
}); | ||
</script> | ||
|
||
<br /> | ||
|
||
<h3 style="margin-top:0;"><%= raw translation('tag.contributors.contributors_for', :tag_name => params[:id]) %></h3> | ||
<p><%= translation('tag.contributors.contributions_over_past_year') %></p> | ||
<h3 style="margin-top:0;"><%= raw translation('tag.contributors.contributors_for', :tag_name => params[:id]) %></h3> | ||
<p><%= translation('tag.contributors.contributions_over_past_year') %></p> | ||
|
||
<% end %> | ||
<% end %> | ||
<%= render :partial => "tag/contributors" %> | ||
<%= render partial: "tag/contributors" %> | ||
|
||
</div> | ||
<%= render :partial => "sidebar/related" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters