Skip to content

Commit

Permalink
Display data size
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Aug 26, 2023
1 parent 8883726 commit 59b63a6
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/electricity/emissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def index
@sources = (@countries.map(&:source) << "nrel").sort.uniq
else
@countries = Country.all.sort_by(&:name)
@total = @countries.count
end
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/electricity/generation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def index
@sources = @countries.map(&:source).sort.uniq
else
@countries = Country.all.sort_by(&:name)
@total = @countries.count
end
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/weather/conditions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Weather::ConditionsController < ApplicationController
def index
@total = Metar::Station.all.count
end

def search
Expand Down
1 change: 1 addition & 0 deletions app/controllers/weather/forecast_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Weather::ForecastController < ApplicationController
def index
@total = GeonamesData.count
end

def search
Expand Down
1 change: 1 addition & 0 deletions app/views/electricity/emissions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
<li><%= link_to country.name, "/electricity/emissions/#{country.code}" %></li>
<% end %>
</ul>
<p><%= pluralize(@total, "country") %></p>
<% end %>
</div>
1 change: 1 addition & 0 deletions app/views/electricity/generation/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
<li><%= link_to country.name, "/electricity/generation/#{country.code}" %></li>
<% end %>
</ul>
<p><%= pluralize(@total, "country") %></p>
<% end %>
</div>
2 changes: 2 additions & 0 deletions app/views/geocode/search/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@
Source:
<%= link_to_source "geonames" %>
</p>
<% else %>
<p><%= pluralize(@total, "city") %></p>
<% end %>
</div>
4 changes: 3 additions & 1 deletion app/views/weather/conditions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<h3><%= title "Weather conditions" %></h3>

<form action="/weather/conditions/search" method="get" class="mt-3">
<form action="/weather/conditions/search" method="get" class="my-3">
<div class="row">
<div class="col">
<input type="text" class="form-control" id="airport" name="airport" placeholder="Airport code">
Expand All @@ -13,4 +13,6 @@
</div>
</div>
</form>

<p><%= pluralize(@total, "airport") %></p>
</div>
4 changes: 3 additions & 1 deletion app/views/weather/forecast/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<h3><%= title "Weather forecast" %></h3>

<form action="/weather/forecast/search" method="get" class="mt-3">
<form action="/weather/forecast/search" method="get" class="my-3">
<div class="row">
<div class="col">
<input type="text" class="form-control" id="city" name="city" placeholder="City">
Expand All @@ -13,4 +13,6 @@
</div>
</div>
</form>

<p><%= pluralize(@total, "city") %></p>
</div>

0 comments on commit 59b63a6

Please sign in to comment.