diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php index 0169547e2a..5717ecd64f 100644 --- a/app/Http/Controllers/GroupController.php +++ b/app/Http/Controllers/GroupController.php @@ -62,13 +62,11 @@ private function indexVariations($tab, $network) ->select($group_atts) ->get(); - //Make sure we don't show the same groups in nearest to you - $your_groups_uniques = $your_groups->pluck('idgroups')->toArray(); - $groups_near_you = $user->groupsNearby(10); + // We pass a high limit to the groups nearby; there is a distance limit which will normally kick in first. + $groups_near_you = $user->groupsNearby(1000); return view('group.index', [ 'your_groups' => $this->expandGroups($your_groups), - 'your_groups_uniques' => $your_groups_uniques, 'groups_near_you' => $this->expandGroups($groups_near_you), 'groups' => $this->expandGroups($groups), 'your_area' => $user->location, @@ -830,6 +828,7 @@ private function expandGroups($groups) 'networks' => Arr::pluck($group->networks, 'id'), 'country' => $group->country, 'group_tags' => $group->group_tags()->get()->pluck('id'), + 'distance' => $group->distance ]; } } diff --git a/resources/js/components/GroupsPage.vue b/resources/js/components/GroupsPage.vue index f97ed5314f..0c32349896 100644 --- a/resources/js/components/GroupsPage.vue +++ b/resources/js/components/GroupsPage.vue @@ -43,6 +43,10 @@ {{ __('groups.groups_title2') }}
+ {{ nearestGroups }} + {{ __('groups.nearest_groups_change') }}. +
You do not currently have a town/city set. You can set one in your profile.
You can also view all groups.
', - 'no_groups_nearest_with_location' => 'It doesn\'t look like there are any groups listed near you yet.
Would you like to start or add a group? Have a look at our resources.
', + 'no_groups_nearest_with_location' => 'There are no groups within 50 km of your location. You can see all groups here. Or why not start your own? Learn what running your own repair event involves.
', + 'nearest_groups' => 'These are the groups that are within 50 km of :location', + 'nearest_groups_change' => '(change)', 'group_count' => 'There is :count group.|There are :count groups.', 'search_name_placeholder' => 'Search name...', 'search_location_placeholder' => 'Search location...', diff --git a/resources/views/partials/tables/head-groups.blade.php b/resources/views/partials/tables/head-groups.blade.php deleted file mode 100644 index aa7cabf63a..0000000000 --- a/resources/views/partials/tables/head-groups.blade.php +++ /dev/null @@ -1,24 +0,0 @@ - -