From d5b06e6dce176d91202a49c998ae3bb67c5d40c3 Mon Sep 17 00:00:00 2001 From: Darin McBride Date: Fri, 5 Jun 2015 22:13:57 -0600 Subject: [PATCH] Push homeworld to top of public profile, and specify it explicitly. --- lib/Lacuna/RPC/Empire.pm | 5 ++++- lib/Lacuna/Web/Admin.pm | 2 +- var/www/public/changes.txt | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/RPC/Empire.pm b/lib/Lacuna/RPC/Empire.pm index e194e15e..ffbea224 100644 --- a/lib/Lacuna/RPC/Empire.pm +++ b/lib/Lacuna/RPC/Empire.pm @@ -721,7 +721,10 @@ sub view_public_profile { } my $planets = $viewed_empire->planets->search(undef,{order_by => 'name'}); while (my $colony = $planets->next) { - if ($colony->id == $viewed_empire->home_planet_id || $probes->search({star_id=>$colony->star_id})->count) { + if ($colony->id == $viewed_empire->home_planet_id) { + unshift @colonies, $colony->get_status; + $colonies[0]{homeworld} = 1; + } elsif ($probes->search({star_id=>$colony->star_id})->count) { push @colonies, $colony->get_status; } } diff --git a/lib/Lacuna/Web/Admin.pm b/lib/Lacuna/Web/Admin.pm index 9cf992a0..ec081fe2 100644 --- a/lib/Lacuna/Web/Admin.pm +++ b/lib/Lacuna/Web/Admin.pm @@ -973,7 +973,7 @@ sub www_view_empire { $out .= sprintf('Admin%s', $empire->is_admin); $out .= sprintf('Mission Curator%sToggle', $empire->is_mission_curator, $empire->id); - my $notes = Lacuna->db->resultset('Log::EmpireAdminNotes')->find({empire_id => $empire->id},{order_by => { -desc => 'id' }, limit => 1 }); + my $notes = Lacuna->db->resultset('Log::EmpireAdminNotes')->find({empire_id => $empire->id},{order_by => { -desc => 'id' }, rows => 1 }); $out .= sprintf('Admin Notes
Last set by: %s
Last set on: %s
View Log', $empire->id, $notes ? $notes->notes : '', diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 056288e4..47fba134 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -9,6 +9,7 @@ - Mod: Warehouses no longer use affinities or storage boosts. - Add: RPC counter always displayed in UI - Fix: Can now change station owner to oneself (UI) + - Add: homeworld highlighted and always at the top of the public profile 3.0911: - Add: Reduce opacity for less-well-controlled stars. -- 2.51.2