Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partials #70

Merged
merged 1 commit into from
Jul 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/views/error.erb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<h1>Error Page</h1>

<%= erb(:'shared/_errors') %>
3 changes: 1 addition & 2 deletions app/views/identifier_error.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div id="error">
<h1> Error </h1>
<%=@message %>
<%= erb(:'shared/_errors') %>
</div>
137 changes: 1 addition & 136 deletions app/views/identifier_index.erb
Original file line number Diff line number Diff line change
@@ -1,137 +1,2 @@
<table id="visit-table">
<caption>Most Visited Webpages</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Webpage Address</th>
</tr>
</thead>
<tbody>
<% if !@urls.nil? %>
<% @urls.map do |num, website| %>
<tr>
<td><%= num %></td>
<td><%= website %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="browser-table">
<caption>Most Used Browsers</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Browser Used</th>
</thead>
<tbody>
<% if !@browsers.nil? %>
<% @browsers.map do |num, browser| %>
<tr>
<td><%= num %></td>
<td><%= browser %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="os-list">
<caption>Most Used Operating System</caption>
<thead>

<tr>
<th>Number of Visits</th>
<th>Operating System Used</th>
</tr>
</thead>
<tbody>
<% if !@os.nil? %>
<% @os.map do |num, os| %>
<tr>
<td><%= num %></td>
<td><%= os %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="res-list">
<caption>Most Used Screen Resolutions</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Screen Resolution</th>
</tr>
</thead>
<tbody>
<% if !@resolutions.nil? %>
<% @resolutions.map do |num, width, height| %>
<tr>
<td><%= num %></td>
<td><%= width %>x<%= height %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="response-table">
<caption>Average Response Times by Webpage</caption>
<thead>
<tr>
<th>Webpage Name</th>
<th>Average Response Time</th>
</tr>
</thead>
<tbody>

<% if !@avg_response_times.nil? %>
<% @avg_response_times.map do |time, url| %>
<tr>
<td><%=time.to_i %></td>
<td><%= url %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="link-list">
<thead>
<caption>Webpage Data</caption>
<tr>
<th>Links
</th>
</tr>
</thead>
<tbody>
<% if !@links.nil? %>
<% @link_paths.map do |path| %>
<tr>
<td><a href=<%= params[:identifier] %>/urls<%= path %> >http://<%= params[:identifier] %><%= path %></td>
</a>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="event-list">
<thead>
<caption>Event Data Links</caption>
<tr>
<th>Links</th>
</tr>
</thead>
<tbody>
<% if !@links.nil? %>

<% @link_paths.map do |path| %>
<tr>
<td><a href=<%= params[:identifier] %>/events>http://<%= params[:identifier] %><%= path %></td>
</a>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<%= erb(:'shared/_id_data') %>
20 changes: 2 additions & 18 deletions app/views/shared/_errors.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
<table>
<caption>Events</caption>
<thead>
<tr>
<th>Name</th>
<th>Number of Requests</th>
</tr>
</thead>
<tbody>
<% @events_by_popularity.map do |name, count| %>
<tr>
<td><a href="events/<%= name %>"><%= name %></a></td>
<td><%= count %></td>
</tr>
<% end %>
</tbody>

</table>
<h1> Error </h1>
<%=@message %>
137 changes: 137 additions & 0 deletions app/views/shared/_id_data.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<table id="visit-table">
<caption>Most Visited Webpages</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Webpage Address</th>
</tr>
</thead>
<tbody>
<% if !@urls.nil? %>
<% @urls.map do |num, website| %>
<tr>
<td><%= num %></td>
<td><%= website %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="browser-table">
<caption>Most Used Browsers</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Browser Used</th>
</thead>
<tbody>
<% if !@browsers.nil? %>
<% @browsers.map do |num, browser| %>
<tr>
<td><%= num %></td>
<td><%= browser %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="os-list">
<caption>Most Used Operating System</caption>
<thead>

<tr>
<th>Number of Visits</th>
<th>Operating System Used</th>
</tr>
</thead>
<tbody>
<% if !@os.nil? %>
<% @os.map do |num, os| %>
<tr>
<td><%= num %></td>
<td><%= os %></td>
<% end %>
<% end %>
</tbody>
</table>

<table id="res-list">
<caption>Most Used Screen Resolutions</caption>
<thead>
<tr>
<th>Number of Visits</th>
<th>Screen Resolution</th>
</tr>
</thead>
<tbody>
<% if !@resolutions.nil? %>
<% @resolutions.map do |num, width, height| %>
<tr>
<td><%= num %></td>
<td><%= width %>x<%= height %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="response-table">
<caption>Average Response Times by Webpage</caption>
<thead>
<tr>
<th>Webpage Name</th>
<th>Average Response Time</th>
</tr>
</thead>
<tbody>

<% if !@avg_response_times.nil? %>
<% @avg_response_times.map do |time, url| %>
<tr>
<td><%=time.to_i %></td>
<td><%= url %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="link-list">
<thead>
<caption>Webpage Data</caption>
<tr>
<th>Links
</th>
</tr>
</thead>
<tbody>
<% if !@links.nil? %>
<% @link_paths.map do |path| %>
<tr>
<td><a href=<%= params[:identifier] %>/urls<%= path %> >http://<%= params[:identifier] %><%= path %></td>
</a>
</tr>
<% end %>
<% end %>
</tbody>
</table>

<table id="event-list">
<thead>
<caption>Event Data Links</caption>
<tr>
<th>Links</th>
</tr>
</thead>
<tbody>
<% if !@links.nil? %>

<% @link_paths.map do |path| %>
<tr>
<td><a href=<%= params[:identifier] %>/events>http://<%= params[:identifier] %><%= path %></td>
</a>
</tr>
<% end %>
<% end %>
</tbody>
</table>
87 changes: 87 additions & 0 deletions app/views/shared/_url_data.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<h2 id="url-title">URL Statistics </h2>

<% if @url %>
<%calculator = UrlsStatisticsCalculator.new(@url)%>
<table>
<thead>
<tr>
<th>Longest Response Times</th>

</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.find_longest_response_time%></td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th>Shortest Response Times</th>

</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.find_shortest_response_time%></td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Average Response Time</th>

</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.find_average_response_time%></td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th>Request Type Used</th>

</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.get_http_verbs%></td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th>Most Popular Referrals</th>

</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.get_referred_by%></td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th>Most Popular User Agents</th>
</tr>
</thead>
<tbody>
<tr>
<td><%=calculator.get_user_agents%></td>
</tr>
</tbody>
</table>

<%end%>
Loading