Skip to content

Commit

Permalink
Merge pull request #3266 from samvera/3040-dashboard-graphs
Browse files Browse the repository at this point in the history
Configures dashboard graphs for better accessibility
  • Loading branch information
Thomas Johnson authored Sep 13, 2018
2 parents 1842a19 + 26a53b9 commit 2596864
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 44 deletions.
30 changes: 30 additions & 0 deletions app/views/hyrax/dashboard/_repository_growth.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="panel-heading">
<h3 class="panel-title"><%= t('.title') %></h3>
<div><%= t('.subtitle') %></div>
</div>
<div class="panel-body text-center">
<% repository_growth = @presenter.repository_growth.to_json %>
<div id="dashboard-growth" aria-hidden="true" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.repositoryGrowth = <%== repository_growth %>
//]]>
</script></div>
<table aria-label="<%= t('.title') %>, <%= t('.subtitle') %>" class="table table-striped sr-only text-left">
<thead>
<tr>
<th><%= t('.date') %></th>
<th><%= t('.objects') %></th>
<th><%= t('.collections') %></th>
</tr>
</thead>
<tbody>
<% JSON.parse(repository_growth).each do |row| %>
<tr>
<td><%= row["y"] %></td>
<td><%= row["a"] %></td>
<td><%= row["b"] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
28 changes: 28 additions & 0 deletions app/views/hyrax/dashboard/_repository_objects.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="panel-heading">
<h3 class="panel-title"><%= t('.title') %></h3>
<div><%= t('.subtitle') %></div>
</div>
<div class="panel-body text-center">
<% repository_objects = @presenter.repository_objects.to_json %>
<div id="dashboard-repository-objects" aria-hidden="true" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.repositoryObjects = <%== repository_objects %>
//]]>
</script></div>
<table aria-label="<%= t('.title') %>, <%= t('.subtitle') %>" class="table table-striped sr-only text-left">
<thead>
<tr>
<th><%= t('.status') %></th>
<th></th>
</tr>
</thead>
<tbody>
<% JSON.parse(repository_objects).each do |row| %>
<tr>
<td><%= row["label"] %></td>
<td><%= row["value"] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
28 changes: 28 additions & 0 deletions app/views/hyrax/dashboard/_user_activity.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="panel-heading">
<h3 class="panel-title"><%= t('.title') %></h3>
<div><%= t('.subtitle') %></div>
</div>
<div class="panel-body text-center">
<% user_activity = @presenter.user_activity.to_json %>
<div id="user-activity" aria-hidden="true" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.userActivity = <%== user_activity %>
//]]>
</script></div>
<table aria-label="<%= t('.title') %>, <%= t('.subtitle') %>" class="table table-striped sr-only text-left">
<thead>
<tr>
<th><%= t('.date') %></th>
<th><%= t('.new_users') %></th>
</tr>
</thead>
<tbody>
<% JSON.parse(user_activity).each do |row| %>
<tr>
<td><%= row["y"] %></td>
<td><%= row["a"] %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
36 changes: 3 additions & 33 deletions app/views/hyrax/dashboard/show_admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,49 +54,19 @@
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t('.user_activity.title') %></h3>
<div><%= t('.user_activity.subtitle') %></div>
</div>
<div class="panel-body text-center">
<div id="user-activity" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.userActivity = <%== @presenter.user_activity.to_json %>
//]]>
</script></div>
</div>
<%= render 'user_activity' %>
</div>
</div>

<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t('.repository_growth.title') %></h3>
<div><%= t('.repository_growth.subtitle') %></div>
</div>
<div class="panel-body text-center">
<div id="dashboard-growth" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.repositoryGrowth = <%== @presenter.repository_growth.to_json %>
//]]>
</script></div>
</div>
<%= render 'repository_growth' %>
</div>
</div>

<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t('.repository_objects.title') %></h3>
<div><%= t('.repository_objects.subtitle') %></div>
</div>
<div class="panel-body text-center">
<div id="dashboard-repository-objects" style="height: 200px"><script>
//<![CDATA[
Hyrax.statistics.repositoryObjects = <%== @presenter.repository_objects.to_json %>
//]]>
</script></div>
</div>
<%= render 'repository_objects' %>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/show_user.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="panel panel-default user-activity">
<div class="panel-heading">
<h3 class="panel-title "><%= t("hyrax.dashboard.user_activity") %></h3>
<h3 class="panel-title "><%= t("hyrax.dashboard.user_activity.title") %></h3>
</div>
<div class="panel-body">
<%= @presenter.render_recent_activity %>
Expand Down
25 changes: 15 additions & 10 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -759,20 +759,21 @@ en:
proxy_delete: Delete Proxy
proxy_help: Select a user who can deposit works on your behalf. Both you and your proxy will be able to make changes to these works. You can revoke a proxy by clicking the Delete Proxy button. To revoke their ability to edit a work they previously submitted, remove them from the Sharing tab on each work.
proxy_user: Proxy User
repository_growth:
subtitle: Past 90 days
title: Repository Growth
date: Date
objects: Objects
collections: Collections
repository_objects:
subtitle: Current Status
title: Repository Objects
status: Current Status
show_admin:
new_visitors: New Visitors
registered_users: Registered Users
repository_growth:
subtitle: Past 90 days
title: Repository Growth
repository_objects:
subtitle: Current Status
title: Repository Objects
returning_visitors: Returning Visitors
total_visitors: Total Visitors
user_activity:
subtitle: New user signups
title: User Activity
stats:
collections: Collections created
file_downloads: Download
Expand All @@ -785,7 +786,11 @@ en:
transfer_works_link: Select works to transfer
transfers_received: Transfers Received
transfers_sent: Transfers Sent
user_activity: User Activity
user_activity:
subtitle: New user signups
title: User Activity
date: Date
new_users: New Users
user_notifications: User Notifications
view_files: View Files
document_language: en
Expand Down

0 comments on commit 2596864

Please sign in to comment.