]> ruin.nu Git - ndwebbie.git/commitdiff
Show coords on raid view page
authorMichael Andreen <harv@ruin.nu>
Tue, 29 Oct 2019 19:17:13 +0000 (20:17 +0100)
committerMichael Andreen <harv@ruin.nu>
Tue, 29 Oct 2019 19:17:13 +0000 (20:17 +0100)
lib/NDWeb/Controller/Raids.pm
root/src/raids/view.tt2

index 781f4c179db942308a2d7ee57573ad354d9ae9f5..a6492591be35f365abd670729144da410708f716 100644 (file)
@@ -106,7 +106,6 @@ sub view : Local {
        $c->forward('findRaid');
        $raid = $c->stash->{raid};
 
-       $c->stash(raid => $raid->{id});
        my $planet;
        if ($c->user->planet){
                my $query = $dbh->prepare(q{SELECT value, score,x,y FROM current_planet_stats WHERE pid = ?});
@@ -188,9 +187,9 @@ ORDER BY name,tick DESC
                $target->{claims} = \@claims;
 
                my $num = pow(10,length($target->{score})-2);
-               $target->{score} = "Hidden"; #ceil($target->{score}/$num)*$num;
+               $target->{score} = "Hidden" unless $raid->{released_coords}; #ceil($target->{score}/$num)*$num;
                $num = pow(10,length($target->{value})-2);
-               $target->{value} = "Hidden"; #ceil($target->{value}/$num)*$num;
+               $target->{value} = "Hidden" unless $raid->{released_coords}; #ceil($target->{value}/$num)*$num;
                $num = pow(10,length($target->{size})-2);
                $target->{size} = floor($target->{size}/$num)*$num;
                $num = pow(10,length($target->{fleetvalue})-2);
index 94244afa66af807213dfa54769c579633c2c852d..826ac606190abc7dff8d8dd7b6be26e770753ba8 100644 (file)
@@ -23,6 +23,9 @@
 <fieldset class="[% t.style %]"> <legend><a name="target[% t.id %]">Target: #[% t.id %]</a></legend>
        <div class="leftinfo"><ul>
                <li><a href="[% c.uri_for('targetcalc',t.id) %]" rel="external">Calc</a></li>
+               [% IF raid.released_coords %]
+               <li>Coords: [% t.x %]:[% t.y %]:[% t.z %]</li>
+               [% END %]
                <li>Size: [% t.size %]</li>
                <li class="[% t.scorebash %]">Score: [% t.score %]</li>
                <li class="[% t.valuebash %]">Value: [% t.value %]</li>
 
 <script type="text/javascript">
 function update(){
-       $.get("/jsrpc/update/[% raid %]/"+modified,{},parseUpdate);
+       $.get("/jsrpc/update/[% raid.id %]/"+modified,{},parseUpdate);
 }
 
 function claim(target,wave,command){
-       $.get("/jsrpc/"+command+"/"+[% raid %]+"/"+modified+"/"+target+"/"+wave,{},parseUpdate);
+       $.get("/jsrpc/"+command+"/"+[% raid.id %]+"/"+modified+"/"+target+"/"+wave,{},parseUpdate);
 }
 
 function join(target,wave,joinable){
-       $.get("/jsrpc/joinable/"+[% raid %]+"/"+modified+"/"+target+"/"+wave+"/"+joinable,{},parseUpdate);
+       $.get("/jsrpc/joinable/"+[% raid.id %]+"/"+modified+"/"+target+"/"+wave+"/"+joinable,{},parseUpdate);
 }
 
 $(document).ready(function(){