Skip to content

Commit

Permalink
remove owner from world map view
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Oct 14, 2024
1 parent 434ca1a commit ba9acbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions app/views/v0/devices/_world_map_device.jbuilder
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local_assigns[:never_authorized] = false unless local_assigns.has_key?(:never_authorized)

json.(
device,
:id,
Expand All @@ -11,18 +9,6 @@ json.(
:last_reading_at,
)


authorized = !local_assigns[:never_authorized] && (current_user && (current_user.is_admin? || (device.owner_id && current_user.id == device.owner_id)))

json.merge!(location: device.formatted_location(true))
json.merge!(hardware: device.hardware(authorized))

if device.owner
json.owner do
json.id device.owner.id
json.username device.owner.username
json.url device.owner.url
end
end

json.merge!(hardware: device.hardware(false))

2 changes: 1 addition & 1 deletion app/views/v0/devices/_world_map_list.jbuilder
Original file line number Diff line number Diff line change
@@ -1 +1 @@
json.array! Device.for_world_map(never_authorized ? nil : current_user), partial: 'world_map_device', as: :device, local_assigns: { never_authorized: never_authorized }
json.array! Device.for_world_map(never_authorized ? nil : current_user), partial: 'world_map_device', as: :device

0 comments on commit ba9acbc

Please sign in to comment.