From e40ac1bb284d9e09702282db46dd76c3d9828d6e Mon Sep 17 00:00:00 2001 From: kevinzluo <44309027+kevinzluo@users.noreply.github.com> Date: Fri, 26 Oct 2018 19:14:52 -0500 Subject: [PATCH 1/7] Added options to try time forward on stats page --- app/views/stats/index.html.erb | 30 +++++++++++++------------ config/locales/views/notes/stats/en.yml | 16 ++++++++----- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb index 5a10d34406..7998459b3e 100644 --- a/app/views/stats/index.html.erb +++ b/app/views/stats/index.html.erb @@ -17,8 +17,10 @@

<%= raw t('notes.stats.looking_back', :time => @time.to_formatted_s(:long)) %>

- <%= raw t('notes.stats.try_time_further_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), + <%= raw t('notes.stats.try_time_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), :url2 => "?time="+(@time-1.month).to_formatted_s(:long), :url3 => "?time="+(@time-1.week).to_formatted_s(:long)) %> + <%= raw t('notes.states.try_time_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), + :url2 => "?time="+(@time+1.month).to_formatted_s(:long), :url3 => "?time="+(@time+1.week).to_formatted_s(:long)) %>


@@ -44,9 +46,9 @@

<%= raw t('notes.stats.research_notes_posted_by_contributors', :note_count => @all_notes, :contributors_count => @all_contributors, :time => time_ago_in_words(Node.find_by(type: 'note', status: 1).created_at)) %>

<%= raw t('notes.stats.total_contributors', :all_contributors_count => @all_time_contributors) %>

- +

<%= raw t('notes.stats.notes_per_week_past_year', :note_count => @notes_per_week_past_year.round(2)) %>

- +

<%= t('notes.stats.note_posting_52_weeks') %>

@@ -82,7 +84,7 @@ divisions[2] = <%= @graph_comments %> let months = ["J", "F", "M", "A", "M", "J", "J", "A","S", "O", "N", "D"]; - + let parents = new Array(); parents[0] = "#notes"; parents[1] = "#wikis"; @@ -123,10 +125,10 @@ count++; } let title = new Array(); - title[0] = "notes"; - title[1] = "wikis"; + title[0] = "notes"; + title[1] = "wikis"; title[2] = "comments"; - + let values = new Array(); for(i = 0; i < 3; i++){ let j = 0; @@ -135,33 +137,33 @@ values[i][j] = divisions[i][j][1][1]; } } - + let datasets = new Array(); for(i = 0; i < 3; i++){ datasets[i] = new Array(); - obj = new Object(); + obj = new Object(); obj.title = title[i]; obj.values = new Array(); obj.values = values[i]; datasets[i][0] = new Object(); datasets[i][0] = obj; } - + let data = new Array(); for(i = 0; i < 3; i++){ data[i] = new Object(); data[i].labels = labels; data[i].datasets = datasets[i]; } - + for(i = 0; i < 3; i++){ let lineGraph = new Chart({ - parent: parents[i], - type: "bar", + parent: parents[i], + type: "bar", show_dots: 0, heatline: 1, height: 115, - region_fill: 0, + region_fill: 0, data: data[i], x_axis_mode: "tick", y_axis_mode: "span", diff --git a/config/locales/views/notes/stats/en.yml b/config/locales/views/notes/stats/en.yml index ac1a1645e5..1c5f74248e 100644 --- a/config/locales/views/notes/stats/en.yml +++ b/config/locales/views/notes/stats/en.yml @@ -9,12 +9,18 @@ en:

Public Lab is built on the contributions of community members, and this website represents our collective open source work.

contributors_statistics: "Contributor statistics" looking_back: "Looking back from %{time}." - try_time_further_back: | - Try + try_time_back: | + Try going back one year, - one month, or + one month, one week - further back. + . + try_time_forward: | + Try going forward + one year, + one month, + one week + . notes_and_wiki_edits_past_week: | %{note_count} notes and %{wiki_count} wiki edits posted in the past week. @@ -32,4 +38,4 @@ en: comments_posted: "%{count} comments have been posted, total" comments_posted_52_weeks: "Comments posted for the past 52 weeks:" wiki_page_edits: "%{count} wiki page edits have been made, total" - edits_per_week: "%{count} edits per week over the past year." \ No newline at end of file + edits_per_week: "%{count} edits per week over the past year." From ad4c701d1549defd6fd61d5d04c8672b2060cbf1 Mon Sep 17 00:00:00 2001 From: kevinzluo <44309027+kevinzluo@users.noreply.github.com> Date: Fri, 26 Oct 2018 19:18:26 -0500 Subject: [PATCH 2/7] changed spacing --- app/views/stats/index.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb index 7998459b3e..9702b6f96f 100644 --- a/app/views/stats/index.html.erb +++ b/app/views/stats/index.html.erb @@ -19,6 +19,8 @@

<%= raw t('notes.stats.try_time_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), :url2 => "?time="+(@time-1.month).to_formatted_s(:long), :url3 => "?time="+(@time-1.week).to_formatted_s(:long)) %> +

+

<%= raw t('notes.states.try_time_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), :url2 => "?time="+(@time+1.month).to_formatted_s(:long), :url3 => "?time="+(@time+1.week).to_formatted_s(:long)) %>

From f2581d054517625dd815eb09332e1a4cb6d94fc9 Mon Sep 17 00:00:00 2001 From: kevinzluo Date: Sat, 27 Oct 2018 21:35:50 -0500 Subject: [PATCH 3/7] Fixed typo in stats and finished edits. --- app/views/stats/index.html.erb | 2 +- config/locales/views/notes/stats/en.yml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb index 9702b6f96f..1bd27e97e9 100644 --- a/app/views/stats/index.html.erb +++ b/app/views/stats/index.html.erb @@ -21,7 +21,7 @@ :url2 => "?time="+(@time-1.month).to_formatted_s(:long), :url3 => "?time="+(@time-1.week).to_formatted_s(:long)) %>

- <%= raw t('notes.states.try_time_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), + <%= raw t('notes.stats.try_time_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), :url2 => "?time="+(@time+1.month).to_formatted_s(:long), :url3 => "?time="+(@time+1.week).to_formatted_s(:long)) %>

diff --git a/config/locales/views/notes/stats/en.yml b/config/locales/views/notes/stats/en.yml index 1c5f74248e..b69db92bf2 100644 --- a/config/locales/views/notes/stats/en.yml +++ b/config/locales/views/notes/stats/en.yml @@ -13,14 +13,12 @@ en: Try going back one year, one month, - one week - . + one week. try_time_forward: | Try going forward one year, one month, - one week - . + one week. notes_and_wiki_edits_past_week: | %{note_count} notes and %{wiki_count} wiki edits posted in the past week. From 9b3828fa4e4986a0c01de7ab78552b8abd167403 Mon Sep 17 00:00:00 2001 From: kevinzluo <44309027+kevinzluo@users.noreply.github.com> Date: Mon, 29 Oct 2018 12:14:23 -0500 Subject: [PATCH 4/7] Reverting changes --- app/views/stats/index.html.erb | 32 +++++++++++-------------- config/locales/views/notes/stats/en.yml | 16 +++++-------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb index 1bd27e97e9..5a10d34406 100644 --- a/app/views/stats/index.html.erb +++ b/app/views/stats/index.html.erb @@ -17,13 +17,9 @@

<%= raw t('notes.stats.looking_back', :time => @time.to_formatted_s(:long)) %>

- <%= raw t('notes.stats.try_time_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), + <%= raw t('notes.stats.try_time_further_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), :url2 => "?time="+(@time-1.month).to_formatted_s(:long), :url3 => "?time="+(@time-1.week).to_formatted_s(:long)) %>

-

- <%= raw t('notes.stats.try_time_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), - :url2 => "?time="+(@time+1.month).to_formatted_s(:long), :url3 => "?time="+(@time+1.week).to_formatted_s(:long)) %> -


@@ -48,9 +44,9 @@

<%= raw t('notes.stats.research_notes_posted_by_contributors', :note_count => @all_notes, :contributors_count => @all_contributors, :time => time_ago_in_words(Node.find_by(type: 'note', status: 1).created_at)) %>

<%= raw t('notes.stats.total_contributors', :all_contributors_count => @all_time_contributors) %>

- +

<%= raw t('notes.stats.notes_per_week_past_year', :note_count => @notes_per_week_past_year.round(2)) %>

- +

<%= t('notes.stats.note_posting_52_weeks') %>

@@ -86,7 +82,7 @@ divisions[2] = <%= @graph_comments %> let months = ["J", "F", "M", "A", "M", "J", "J", "A","S", "O", "N", "D"]; - + let parents = new Array(); parents[0] = "#notes"; parents[1] = "#wikis"; @@ -127,10 +123,10 @@ count++; } let title = new Array(); - title[0] = "notes"; - title[1] = "wikis"; + title[0] = "notes"; + title[1] = "wikis"; title[2] = "comments"; - + let values = new Array(); for(i = 0; i < 3; i++){ let j = 0; @@ -139,33 +135,33 @@ values[i][j] = divisions[i][j][1][1]; } } - + let datasets = new Array(); for(i = 0; i < 3; i++){ datasets[i] = new Array(); - obj = new Object(); + obj = new Object(); obj.title = title[i]; obj.values = new Array(); obj.values = values[i]; datasets[i][0] = new Object(); datasets[i][0] = obj; } - + let data = new Array(); for(i = 0; i < 3; i++){ data[i] = new Object(); data[i].labels = labels; data[i].datasets = datasets[i]; } - + for(i = 0; i < 3; i++){ let lineGraph = new Chart({ - parent: parents[i], - type: "bar", + parent: parents[i], + type: "bar", show_dots: 0, heatline: 1, height: 115, - region_fill: 0, + region_fill: 0, data: data[i], x_axis_mode: "tick", y_axis_mode: "span", diff --git a/config/locales/views/notes/stats/en.yml b/config/locales/views/notes/stats/en.yml index b69db92bf2..ac1a1645e5 100644 --- a/config/locales/views/notes/stats/en.yml +++ b/config/locales/views/notes/stats/en.yml @@ -9,16 +9,12 @@ en:

Public Lab is built on the contributions of community members, and this website represents our collective open source work.

contributors_statistics: "Contributor statistics" looking_back: "Looking back from %{time}." - try_time_back: | - Try going back + try_time_further_back: | + Try one year, - one month, - one week. - try_time_forward: | - Try going forward - one year, - one month, - one week. + one month, or + one week + further back. notes_and_wiki_edits_past_week: | %{note_count} notes and %{wiki_count} wiki edits posted in the past week. @@ -36,4 +32,4 @@ en: comments_posted: "%{count} comments have been posted, total" comments_posted_52_weeks: "Comments posted for the past 52 weeks:" wiki_page_edits: "%{count} wiki page edits have been made, total" - edits_per_week: "%{count} edits per week over the past year." + edits_per_week: "%{count} edits per week over the past year." \ No newline at end of file From fc30d375b869c219fe8761766297a4746780ad49 Mon Sep 17 00:00:00 2001 From: kevinzluo <44309027+kevinzluo@users.noreply.github.com> Date: Mon, 29 Oct 2018 12:17:55 -0500 Subject: [PATCH 5/7] Added try_time_further_forward --- app/views/stats/index.html.erb | 33 ++++++++++++++----------- config/locales/views/notes/stats/en.yml | 8 +++++- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/app/views/stats/index.html.erb b/app/views/stats/index.html.erb index 5a10d34406..98548abd09 100644 --- a/app/views/stats/index.html.erb +++ b/app/views/stats/index.html.erb @@ -17,10 +17,13 @@

<%= raw t('notes.stats.looking_back', :time => @time.to_formatted_s(:long)) %>

- <%= raw t('notes.stats.try_time_further_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), + <%= raw t('notes.stats.try_time_further_back', :url1 => "?time="+(@time-1.year).to_formatted_s(:long), :url2 => "?time="+(@time-1.month).to_formatted_s(:long), :url3 => "?time="+(@time-1.week).to_formatted_s(:long)) %>

- +

+ <%= raw t('notes.stats.try_time_further_forward', :url1 => "?time="+(@time+1.year).to_formatted_s(:long), + :url2 => "?time="+(@time+1.month).to_formatted_s(:long), :url3 => "?time="+(@time+1.week).to_formatted_s(:long)) %> +


@@ -44,9 +47,9 @@

<%= raw t('notes.stats.research_notes_posted_by_contributors', :note_count => @all_notes, :contributors_count => @all_contributors, :time => time_ago_in_words(Node.find_by(type: 'note', status: 1).created_at)) %>

<%= raw t('notes.stats.total_contributors', :all_contributors_count => @all_time_contributors) %>

- +

<%= raw t('notes.stats.notes_per_week_past_year', :note_count => @notes_per_week_past_year.round(2)) %>

- +

<%= t('notes.stats.note_posting_52_weeks') %>

@@ -82,7 +85,7 @@ divisions[2] = <%= @graph_comments %> let months = ["J", "F", "M", "A", "M", "J", "J", "A","S", "O", "N", "D"]; - + let parents = new Array(); parents[0] = "#notes"; parents[1] = "#wikis"; @@ -123,10 +126,10 @@ count++; } let title = new Array(); - title[0] = "notes"; - title[1] = "wikis"; + title[0] = "notes"; + title[1] = "wikis"; title[2] = "comments"; - + let values = new Array(); for(i = 0; i < 3; i++){ let j = 0; @@ -135,33 +138,33 @@ values[i][j] = divisions[i][j][1][1]; } } - + let datasets = new Array(); for(i = 0; i < 3; i++){ datasets[i] = new Array(); - obj = new Object(); + obj = new Object(); obj.title = title[i]; obj.values = new Array(); obj.values = values[i]; datasets[i][0] = new Object(); datasets[i][0] = obj; } - + let data = new Array(); for(i = 0; i < 3; i++){ data[i] = new Object(); data[i].labels = labels; data[i].datasets = datasets[i]; } - + for(i = 0; i < 3; i++){ let lineGraph = new Chart({ - parent: parents[i], - type: "bar", + parent: parents[i], + type: "bar", show_dots: 0, heatline: 1, height: 115, - region_fill: 0, + region_fill: 0, data: data[i], x_axis_mode: "tick", y_axis_mode: "span", diff --git a/config/locales/views/notes/stats/en.yml b/config/locales/views/notes/stats/en.yml index ac1a1645e5..fae2d5f515 100644 --- a/config/locales/views/notes/stats/en.yml +++ b/config/locales/views/notes/stats/en.yml @@ -15,6 +15,12 @@ en: one month, or one week further back. + try_time_further_forward: | + Or try + one year, + one month, or + one week + further forward. notes_and_wiki_edits_past_week: | %{note_count} notes and %{wiki_count} wiki edits posted in the past week. @@ -32,4 +38,4 @@ en: comments_posted: "%{count} comments have been posted, total" comments_posted_52_weeks: "Comments posted for the past 52 weeks:" wiki_page_edits: "%{count} wiki page edits have been made, total" - edits_per_week: "%{count} edits per week over the past year." \ No newline at end of file + edits_per_week: "%{count} edits per week over the past year." From 13f04e3d39d31fe98e404d338880f2a8858f5d9f Mon Sep 17 00:00:00 2001 From: kevinzluo Date: Wed, 31 Oct 2018 22:19:37 -0500 Subject: [PATCH 6/7] Hopefully correcting mistakes and moving translations --- config/locales/en.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a28921644..45e087fde3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -103,3 +103,41 @@ en: month: Month second: Seconds year: Year + notes: + stats: + about_this_page: | +

About this page

+ +

Public Lab is built on the contributions of community members, and this website represents our collective open source work.

+ contributors_statistics: "Contributor statistics" + looking_back: "Looking back from %{time}." + try_time_further_back: | + Try + one year, + one month, or + one week + further back. + try_time_further_forward: | + Or try + one year, + one month, or + one week + further forward. + notes_and_wiki_edits_past_week: | + %{note_count} notes + and %{wiki_count} wiki edits posted in the past week. + people_joined_past_week: "%{people_count} people joined in the past week." + notes_and_wiki_edits_past_month: | + %{note_count} notes + and %{wiki_count} wiki edits posted in the past month. + people_joined_past_month: "%{people_count} people joined in the past month." + research_notes_posted_by_contributors: "%{note_count} research notes have been posted by %{contributors_count} contributors since %{time} ago" + total_contributors: "%{all_contributors_count} Total Contributors (Tallied weekly)" + notes_per_week_past_year: "%{note_count} notes per week over the past year." + note_posting_52_weeks: "Note posting for the past 52 weeks:" + wiki_pages_posted: "%{count} wiki pages have been posted, total" + wiki_page_posting_52_weeks: "Wiki page posting for the past 52 weeks:" + comments_posted: "%{count} comments have been posted, total" + comments_posted_52_weeks: "Comments posted for the past 52 weeks:" + wiki_page_edits: "%{count} wiki page edits have been made, total" + edits_per_week: "%{count} edits per week over the past year." From 7693fafb575351e8daea303209612d4478b7e8e8 Mon Sep 17 00:00:00 2001 From: kevinzluo Date: Sat, 3 Nov 2018 20:58:06 -0500 Subject: [PATCH 7/7] Deleting translations that were moved. --- config/locales/views/notes/stats/en.yml | 41 ------------------------- 1 file changed, 41 deletions(-) delete mode 100644 config/locales/views/notes/stats/en.yml diff --git a/config/locales/views/notes/stats/en.yml b/config/locales/views/notes/stats/en.yml deleted file mode 100644 index fae2d5f515..0000000000 --- a/config/locales/views/notes/stats/en.yml +++ /dev/null @@ -1,41 +0,0 @@ -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en: - notes: - stats: - about_this_page: | -

About this page

- -

Public Lab is built on the contributions of community members, and this website represents our collective open source work.

- contributors_statistics: "Contributor statistics" - looking_back: "Looking back from %{time}." - try_time_further_back: | - Try - one year, - one month, or - one week - further back. - try_time_further_forward: | - Or try - one year, - one month, or - one week - further forward. - notes_and_wiki_edits_past_week: | - %{note_count} notes - and %{wiki_count} wiki edits posted in the past week. - people_joined_past_week: "%{people_count} people joined in the past week." - notes_and_wiki_edits_past_month: | - %{note_count} notes - and %{wiki_count} wiki edits posted in the past month. - people_joined_past_month: "%{people_count} people joined in the past month." - research_notes_posted_by_contributors: "%{note_count} research notes have been posted by %{contributors_count} contributors since %{time} ago" - total_contributors: "%{all_contributors_count} Total Contributors (Tallied weekly)" - notes_per_week_past_year: "%{note_count} notes per week over the past year." - note_posting_52_weeks: "Note posting for the past 52 weeks:" - wiki_pages_posted: "%{count} wiki pages have been posted, total" - wiki_page_posting_52_weeks: "Wiki page posting for the past 52 weeks:" - comments_posted: "%{count} comments have been posted, total" - comments_posted_52_weeks: "Comments posted for the past 52 weeks:" - wiki_page_edits: "%{count} wiki page edits have been made, total" - edits_per_week: "%{count} edits per week over the past year."