]> ruin.nu Git - ndwebbie.git/blob - root/src/raids/view.tt2
4b88e7ad0c3b784019a0571288b406558398a250
[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>Size: [% t.size %]</li>
26                 <li class="[% t.scorebash %]">Score: [% t.score %]</li>
27                 <li class="[% t.valuebash %]">Value: [% t.value %]</li>
28                 <li>Fleet value: [% t.fleetvalue %]</li>
29                 <li>Resource value: [% t.resvalue %]</li>
30                 <li>Hidden value: [% t.hidden %]</li>
31                 <li>Factory Usage: [% t.light %], [% t.medium %], [% t.heavy %]</li>
32                 <li>Race: [% t.race %]</li>
33                 [% FOR r IN t.roids %]
34                         <li>Roids wave [% r.wave %]: [% r.roids %] ([% comma(r.xp) %] xp)</li>
35                 [% END %]
36         </ul>
37         [% IF t.comment %]
38                 <fieldset> <legend>Comment</legend>
39                         [% t.comment %]
40                 </fieldset>
41         [% END %]
42         <table>
43         <tr><th></th><th>Metal</th><th>Crystal</th><th>Eonium</th></tr>
44         <tr align="center">
45                 <th>Roids</th>
46                 <td>[% comma(t.metal_roids) %]</td>
47                 <td>[% comma(t.crystal_roids) %]</td>
48                 <td>[% comma(t.eonium_roids) %]</td>
49         </tr>
50         <tr align="center">
51                 <th>Resources</th>
52                 <td>[% comma(t.metal) %]</td>
53                 <td>[% comma(t.crystal) %]</td>
54                 <td>[% comma(t.eonium) %]</td>
55         </tr>
56
57         </table>
58         </div>
59         <div class="leftinfo">
60         <table>
61         <tr><th>Waves</th></tr>
62         <tr>
63                 <td>Research</td>
64                 <td>[% t.waves %]</td>
65         </tr>
66         <tr>
67                 <td>Amps</td>
68                 <td>[% t.amps %]</td>
69         </tr>
70         <tr>
71                 <td>Dists</td>
72                 <td>[% t.distorters %]</td>
73         </tr>
74         <tr><th>Production</th></tr>
75         <tr>
76                 <td>Research</td>
77                 <td>[% t.hulls %]</td>
78         </tr>
79         <tr>
80                 <td>Light factory</td>
81                 <td>[% t.light_fac %]</td>
82         </tr>
83         <tr>
84                 <td>Medium factory</td>
85                 <td>[% t.medium_fac %]</td>
86         </tr>
87         <tr>
88                 <td>Heavy factory</td>
89                 <td>[% t.heavy_fac %]</td>
90         </tr>
91         </table>
92         </div>
93         [% FOR m IN t.missions %]
94         <div class="leftinfo">
95
96                 <p>[% m.name %]<br>
97                         Tick: [% m.tick %]<br>
98                         Ships: [% m.amount %]
99                 </p>
100                 <table>
101                 [% FOR s IN m.ships %]
102                 <tr class="[% loop.count % 2 == 0 ? 'even' : 'odd' %]">
103                         <td>[% s.ship %]</td><td>[% comma(s.amount) %]</td>
104                 </tr>
105                 [% END %]
106                 </table>
107         </div>
108         [% END %]
109         <div class="clear"> &nbsp;</div>
110         <form action="" method="post">
111         <p class="claimlinks">
112         <span id="claim[% t.id %]">
113         [% FOR w IN t.claims %]
114         <input type="button" value="Claim wave [% w.wave %]"
115                 onclick = "claim([% t.id %], [% w.wave %], 'claim')">
116         [% END %]
117         </span>
118         </p>
119         </form>
120 </fieldset>
121 [% END %]
122
123 <script type="text/javascript">
124 function update(){
125         $.get("/jsrpc/update/[% raid %]/"+modified,{},parseUpdate);
126 }
127
128 function claim(target,wave,command){
129         $.get("/jsrpc/"+command+"/"+[% raid %]+"/"+modified+"/"+target+"/"+wave,{},parseUpdate);
130 }
131
132 function join(target,wave,joinable){
133         $.get("/jsrpc/joinable/"+[% raid %]+"/"+modified+"/"+target+"/"+wave+"/"+joinable,{},parseUpdate);
134 }
135
136 $(document).ready(function(){
137         update();
138         var targets = $('#targets');
139         $('#targets').remove();
140         $('#floatmenu').append(targets);
141         var menuYloc = parseInt($("#floatmenu").css("top").substring(0,$("#floatmenu").css("top").indexOf("px")))
142         $(window).scroll(function () {
143                 var offset = menuYloc+$(document).scrollTop()+"px";
144                 $('#floatmenu').animate({top:offset},{duration:500,queue:false});
145     });
146 });
147 </script>