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