Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rromanchuk committed Dec 1, 2024
1 parent 04c71e5 commit 899f88d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
8 changes: 5 additions & 3 deletions personal/app/controllers/tds/metars_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class MetarsController < ApplicationController
@dr_pagy, records = pagy_countless(relation, items: 25)
records
end
let(:station) { Station.find(params[:station_id]) }

def debug
add_breadcrumb('METARs', tds_metars_url)
Expand All @@ -31,11 +32,12 @@ def show
def apply_filter
relation = Metar.recent(:observation_time)
relation = relation.search(params[:q]) if params[:q].present?

if params[:station_id]
add_breadcrumb(params[:station_id], tds_metars_url(station_id: params[:station_id]))
relation = relation.where(station_id: params[:station_id])
add_breadcrumb(station.code, tds_station_metars_url(station))
relation = station.metars
end

relation
end
end
Expand Down
1 change: 1 addition & 0 deletions personal/app/controllers/tds/tafs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TafsController < ApplicationController
@dr_pagy, records = pagy_countless(relation, items: 25)
records
end
let(:station) { Station.find(params[:station_id]) }

def debug
add_breadcrumb('Terminal Aerodrome Forecast (TAF)', tds_tafs_url)
Expand Down
8 changes: 6 additions & 2 deletions personal/app/views/tds/metars/_metar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
<td class=""><%= time_tag metar.observation_time %> <span class="text-muted">(<%= time_ago_in_words(metar.observation_time) %> ago)</span></td>
</tr>
<tr class="">
<td class="w-25 fw-semibold">Identifier</td>
<td class=""><%= link_to metar.station_id, tds_metars_path(station_id: metar.station_id), data: {turbo_action: :advance, turbo_frame: :metars} %></td>
<td class="w-25 fw-semibold">Station</td>
<td class="">
<% if metar.station %>
<%= link_to metar.station&.code, tds_station_metars_path(metar.station), data: {turbo_action: :advance, turbo_frame: :metars} %>
<% end %>
</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 2 additions & 0 deletions personal/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def matches?(request)

resources :stations do
resources :pireps, only: %i[index show]
resources :metars, only: %i[index show]
resources :tafs, only: %i[index show]
end

resources :batches, only: %i[index show] do
Expand Down

0 comments on commit 899f88d

Please sign in to comment.