]> ruin.nu Git - ndwebbie.git/blob - root/src/raids/view.tt2
94244afa66af807213dfa54769c579633c2c852d
[ndwebbie.git] / root / src / raids / view.tt2
1 [% META title = 'Raid claiming' %]
2
3 <fieldset> <legend>Message</legend>
4         <p><b>REMEMBER TO PASTE LAUNCH CONFIRMATION IF YOU WANT AN ATTACK POINT</b></p>
5         <p><b style="color: red;">DO NOT JOIN A WAVE UNLESS YOU HAVE PERMISSION FROM THE PERSON WHO CLAIMED IT</b></p>
6         <p><b style="color: purple;">COORDS ARE NOT SHOWN UNTIL AT LEAST 10 MIN AFTER YOUR CLAIM</b></p>
7         <p>Landing tick first wave: [% landingtick %]</p>
8         [% message %]
9 </fieldset>
10
11 <div id="floatmenu" style="right: 1em; top: 50px; position: absolute; marigin-left:120px;">
12 <form action="" method="post">
13         <ul class="linkbar">
14                 <li><input type="button" value="Update claims"
15                         onclick = "update()">
16                 <li><input type="button" value="Update target list"
17                         onclick = "listTargets()">
18         </ul>
19 </form>
20 </div>
21
22 [% FOR t IN targets %]
23 <fieldset class="[% t.style %]"> <legend><a name="target[% t.id %]">Target: #[% t.id %]</a></legend>
24         <div class="leftinfo"><ul>
25                 <li><a href="[% c.uri_for('targetcalc',t.id) %]" rel="external">Calc</a></li>
26                 <li>Size: [% t.size %]</li>
27                 <li class="[% t.scorebash %]">Score: [% t.score %]</li>
28                 <li class="[% t.valuebash %]">Value: [% t.value %]</li>
29                 <li>Fleet value: [% t.fleetvalue %]</li>
30                 <li>Resource value: [% t.resvalue %]</li>
31                 <li>Hidden value: [% t.hidden %]</li>
32                 <li>Factory Usage: [% t.light %], [% t.medium %], [% t.heavy %]</li>
33                 <li>Race: [% t.race %]</li>
34                 <li>Cap: [% t.cap * 100 | format('%.02f') %]</li>
35                 [% FOR r IN t.roids %]
36                         <li>Roids wave [% r.wave %]: [% r.roids %] ([% r.xp | commify %] xp)</li>
37                 [% END %]
38         </ul>
39         [% IF t.comment %]
40                 <fieldset> <legend>Comment</legend>
41                         [% t.comment %]
42                 </fieldset>
43         [% END %]
44         <table>
45         <tr><th></th><th>Metal</th><th>Crystal</th><th>Eonium</th></tr>
46         <tr align="center">
47                 <th>Roids</th>
48                 <td>[% t.metal_roids | commify %]</td>
49                 <td>[% t.crystal_roids | commify %]</td>
50                 <td>[% t.eonium_roids | commify %]</td>
51         </tr>
52         <tr align="center">
53                 <th>Resources</th>
54                 <td>[% t.metal | commify %]</td>
55                 <td>[% t.crystal | commify %]</td>
56                 <td>[% t.eonium | commify %]</td>
57         </tr>
58
59         </table>
60         </div>
61         <div class="leftinfo">
62         <table>
63         <tr><th>Waves</th></tr>
64         <tr>
65                 <td>Research</td>
66                 <td>[% t.waves %]</td>
67         </tr>
68         <tr>
69                 <td>Amps</td>
70                 <td>[% t.amps %]</td>
71         </tr>
72         <tr>
73                 <td>Dists</td>
74                 <td>[% t.distorters %]</td>
75         </tr>
76         <tr><th>Production</th></tr>
77         <tr>
78                 <td>Research</td>
79                 <td>[% t.hulls %]</td>
80         </tr>
81         <tr>
82                 <td>Light factory</td>
83                 <td>[% t.light_fac %]</td>
84         </tr>
85         <tr>
86                 <td>Medium factory</td>
87                 <td>[% t.medium_fac %]</td>
88         </tr>
89         <tr>
90                 <td>Heavy factory</td>
91                 <td>[% t.heavy_fac %]</td>
92         </tr>
93         </table>
94         </div>
95         [% FOR m IN t.missions %]
96         <div class="leftinfo">
97
98                 <p>[% m.name %]<br>
99                         Tick: [% m.tick %]<br>
100                         Ships: [% m.amount %]
101                 </p>
102                 <table>
103                 [% FOR s IN m.ships %]
104                 <tr class="[% loop.count % 2 == 0 ? 'even' : 'odd' %]">
105                         <td>[% s.ship %]</td><td>[% s.amount | commify %]</td>
106                 </tr>
107                 [% END %]
108                 </table>
109         </div>
110         [% END %]
111         <div class="clear"> &nbsp;</div>
112         <form action="" method="post">
113         <p class="claimlinks">
114         <span id="claim[% t.id %]">
115         [% FOR w IN t.claims %]
116         <input type="button" value="Claim wave [% w.wave %]"
117                 onclick = "claim([% t.id %], [% w.wave %], 'claim')">
118         [% END %]
119         </span>
120         </p>
121         </form>
122 </fieldset>
123 [% END %]
124
125 <script type="text/javascript">
126 function update(){
127         $.get("/jsrpc/update/[% raid %]/"+modified,{},parseUpdate);
128 }
129
130 function claim(target,wave,command){
131         $.get("/jsrpc/"+command+"/"+[% raid %]+"/"+modified+"/"+target+"/"+wave,{},parseUpdate);
132 }
133
134 function join(target,wave,joinable){
135         $.get("/jsrpc/joinable/"+[% raid %]+"/"+modified+"/"+target+"/"+wave+"/"+joinable,{},parseUpdate);
136 }
137
138 $(document).ready(function(){
139         update();
140         var targets = $('#targets');
141         $('#targets').remove();
142         $('#floatmenu').append(targets);
143         var menuYloc = parseInt($("#floatmenu").css("top").substring(0,$("#floatmenu").css("top").indexOf("px")))
144         $(window).scroll(function () {
145                 var offset = menuYloc+$(document).scrollTop()+"px";
146                 $('#floatmenu').animate({top:offset},{duration:500,queue:false});
147     });
148 });
149 </script>