-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from openjournals/add-editor-to-paper
Basic metrics dashboard
- Loading branch information
Showing
17 changed files
with
300 additions
and
65 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<div class="wrapper"> | ||
<h2>Accepted papers by month</h2> | ||
|
||
<%= column_chart [ | ||
{ name: "Accepted papers by month", data: @accepted_papers } | ||
], height: "500px", legend: false, library: { scales: { xAxes: [{ position: 'bottom' }], yAxes: [{ position: 'left', gridLines: { display: true, drawBorder: true }, ticks: { min: 0, max: 40, stepSize: 5}}, { position: 'right', gridLines: { display: false, drawBorder: true }, ticks: { min: 0, max: 40, stepSize: 5}}]}} %> | ||
|
||
<h2>Accepted papers by month by editor</h2> | ||
|
||
<p style="font-weight: bolder; padding-left: 40px;">Select editor: <%= select_tag 'editors', options_from_collection_for_select(Editor.all, "login", "login", params[:editor].blank? ? current_user.editor.login : params[:editor]), | ||
:onchange => "top.location.href='/dashboard?editor=' + this.options[this.selectedIndex].value + '#editor';" %></p> | ||
|
||
|
||
<%= column_chart [ | ||
{ name: "Papers edited by #{@editor.login} by month", data: @editor_papers } | ||
], height: "500px", colors: ["#8FBC8F"], :id => "editor", legend: false, library: { scales: { xAxes: [{ position: 'bottom' }], yAxes: [{ position: 'left', gridLines: { display: true, drawBorder: true }, ticks: { min: 0, max: 20, stepSize: 5}}, { position: 'right', gridLines: { display: false, drawBorder: true }, ticks: { min: 0, max: 20, stepSize: 5}}]}} %> | ||
|
||
|
||
|
||
<h2>Editor statistics</h2> | ||
<table class="editor-stats"> | ||
<tr> | ||
<th width="25%">Editor</th><th width="15%">Week</th><th width="15%">Month</th><th width="15%">Quarter</th><th width="15%">Year</th><th width="15%">All time</th> | ||
</tr> | ||
<% Editor.order('LOWER(login)').each do |editor| %> | ||
<tr class="<%= cycle('odd', 'even') -%>"> | ||
<td><%= editor.login %></td> | ||
<td><%= editor.papers.visible.since(1.week.ago).count %></td> | ||
<td><%= editor.papers.visible.since(1.month.ago).count %></td> | ||
<td><%= editor.papers.visible.since(3.months.ago).count %></td> | ||
<td><%= editor.papers.visible.since(1.year.ago).count %></td> | ||
<td><%= editor.papers.visible.since(100.year.ago).count %></td> | ||
</tr> | ||
<% end %> | ||
<tr style="font-weight: bolder;"> | ||
<td>Totals</td> | ||
<td><%= Paper.visible.since(1.week.ago).count %></td> | ||
<td><%= Paper.visible.since(1.month.ago).count %></td> | ||
<td><%= Paper.visible.since(3.months.ago).count %></td> | ||
<td><%= Paper.visible.since(1.year.ago).count %></td> | ||
<td><%= Paper.visible.since(100.year.ago).count %></td> | ||
</tr> | ||
</table> | ||
|
||
<br /> | ||
</div> |
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddEditorIdToPaper < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :editors, :user_id, :integer | ||
add_column :papers, :editor_id, :integer | ||
add_column :papers, :reviewers, :string, array: true, default: [] | ||
end | ||
end |
Oops, something went wrong.