Front page UI tweaks, ignore template cache

This commit is contained in:
Colin McLeod
2015-04-16 18:45:08 -07:00
parent 1097ca5a42
commit aad4600326
5 changed files with 19 additions and 18 deletions

3
.gitignore vendored
View File

@@ -5,4 +5,5 @@ build
.DS_Store
*.log
app/js/db.js
nginx.pid
nginx.pid
template_cache.js

View File

@@ -1,7 +0,0 @@
angular.module("app.templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("views/component.html","<div class=lbl>{{lbl}}</div><div class=cla>{{c.maxClass}}</div><div class=clear>{{c.c.class}}{{c.c.rating}}<div class=cla>{{c.c.mass || c.c.capacity}}T</div></div>");
$templateCache.put("views/component_select.html","<ul><li class=c ng-repeat=\"(id,o) in opts\" ng-click=use(id,o)>{{o.class}}{{o.rating}}</li></ul>");
$templateCache.put("views/costs.html","<div class=list-item ng-class={enabled:ship.incCost} ng-click=toggle(ship)><div class=lbl>{{ship.name}}</div><div class=val>{{$r.credits(ship.cost)}}</div></div><div class=list-item ng-class={enabled:ship.bulkheads.incCost} ng-click=toggle(ship.bulkheads) ng-if=ship.bulkheads.c.cost><div class=lbl>{{ship.bulkheads.c.name}}</div><div class=val>{{$r.credits(ship.bulkheads.c.cost)}}</div></div><div ng-repeat=\"c in ship.common\" ng-if=c.c.cost class=\"list-item common\" ng-class={enabled:c.incCost} ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}</div><div class=val>{{$r.credits(c.c.cost)}}</div></div><div ng-repeat=\"c in ship.hardpoints\" ng-if=c.c.cost class=\"list-item hardpoints\" ng-class={enabled:c.incCost} ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{c.c.name}}</div><div class=val>{{$r.credits(c.c.cost)}}</div></div><div ng-repeat=\"c in ship.internal\" ng-if=c.c.cost class=\"list-item internal\" ng-class={enabled:c.incCost} ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.igMap[c.c.group]}}</div><div class=val>{{$r.credits(c.c.cost)}}</div></div><div class=list-item><div class=lbl>Total</div><div class=val>{{$r.credits(ship.totalCost)}}</div></div>");
$templateCache.put("views/menu.html","<header><div class=left><a href=\"#/\"><h1 class=title>Shipyard</h1></a></div><div class=right><a class=\"logo github\" href=https://github.com/cmmcleod/ed-shipyard target=_blank title=\"Shipyard Github Project\"></a> <a class=\"logo reddit\" href=https://github.com/cmmcleod/ed-shipyard target=_blank title=\"Reddit Thread\"></a> <a class=\"logo elite-dangerous\" href=https://github.com/cmmcleod/ed-shipyard target=_blank title=\"Elite Dangerous Forum Thread\"></a></div></header>");
$templateCache.put("views/power.html","<div ng-repeat=\"c in ship.common\" ng-if=\"c.c.power || c.c.pGen\" class=\"list-item common\" ng-class=\"{enabled:c.enabled, consumer:c.c.power}\" ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{$r.CArr[$index]}}</div><div class=val>{{$r.power(c.c.power || c.c.pGen)}}</div></div><div class=\"list-item common consumer\" ng-class={enabled:ship.cargoScoop.enabled} ng-click=toggle(ship.cargoScoop)><div class=lbl>1H Cargo Scoop</div><div class=val>{{$r.power(ship.cargoScoop.c.power)}}</div></div><div ng-repeat=\"c in ship.hardpoints\" ng-if=c.c.power class=\"list-item hardpoints\" ng-class=\"{enabled:c.enabled, consumer:c.c.power}\" ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{c.c.name}}</div><div class=val>{{$r.power(c.c.power)}}</div></div><div ng-repeat=\"c in ship.internal\" ng-if=c.c.power class=\"list-item internal\" ng-class=\"{enabled:c.enabled, consumer:c.c.power}\" ng-click=toggle(c)><div class=lbl>{{c.c.class}}{{c.c.rating}} {{c.c.name || $r.igMap[c.c.group]}}</div><div class=val>{{$r.power(c.c.power)}}</div></div><div>Retracted: {{$r.power(ship.powerRetracted)}} ({{$r.percent(ship.powerRetracted/ship.powerAvailable)}})</div><div>Deployed: {{$r.power(ship.powerDeployed)}} ({{$r.percent(ship.powerDeployed/ship.powerAvailable)}})</div>");
$templateCache.put("views/ship.html","<fieldset id=overview><legend>{{ship.name}}</legend><div>Class: {{ship.class}}</div><div>Mass: {{ship.unladenMass}} - {{ship.ladenMass}} [{{ship.mass}}]T</div><div>Speed: {{ship.speed}} <span class=boost>[{{ship.boost}}] M/s</span></div><div>Agility: {{ship.agility}}</div><div>Shields: {{ship.shields}}</div><div>Armour: {{ship.armour}}</div><div>Fuel: {{ship.fuelCapacity}}T</div><div>Cargo: {{ship.cargoCapacity}}T</div><div>Armour: {{ship.armour}}</div><div>Pad Size: {{[\'\',\'Small\',\'Medium\',\'Large\'][ship.class]}}</div></fieldset><fieldset id=standard class=component-group><legend>Standard</legend><div class=component><div class=lbl>Bulkheads</div><div class=clear>{{ship.bulkheads.c.name}}<div class=cla>{{ship.bulkheads.c.mass}}T</div></div><div class=select><div class=c ng-repeat=\"b in availCS.bulkheads\" ng-click=ship.use(ship.bulkheads,$index,b)>{{b.name}}</div></div></div><div class=component ng-repeat=\"c in ship.common\"><component-details c=c lbl=CArr[$index]></component-details><div component-select class=select c=c ship=ship opts=availCS.common[$index]></div></div></fieldset><fieldset id=hardpoints class=component-group><legend>HardPoints</legend><div class=component ng-repeat=\"h in ship.hardpoints\"><component-details c=h lbl=HPC[h.maxClass]></component-details><div component-select class=select c=h ship=ship opts=availCS.getHps(h.maxClass)></div></div></fieldset><fieldset id=internal class=component-group><legend>Internal Compartments</legend><div class=component ng-repeat=\"i in ship.internal\"><component-details c=i lbl=\"\'FIX\'\"></component-details><div class=select><div ng-repeat=\"(grp, data) in availCS.getInts(i.maxClass)\"><div class=select-group>{{grp}}</div><div component-select c=i ship=ship opts=data></div></div></div></div></fieldset><div class=list id=power-list power-list ship=ship></div><div class=list id=cost-list cost-list ship=ship></div>");
$templateCache.put("views/ships.html","<a href=#/{{id}} class=ship ng-repeat=\"(id,s) in ships\"><h2>{{s.name}}<small>{{s.manufacturer}}</small></h2><div class=subtitle><div class=size>Class {{s.class}} / {{SZ[s.class]}}</div><div class=purpose>{{SP[s.group]}}</div></div>{{credits(s.cost)}} Credits</a>");}]);

View File

@@ -2,38 +2,43 @@
a.ship {
display: block;
float: left;
width: 30%;
width: 22%;
height: 30%;
margin: 1% 1%;
background-color: #222;
padding: 0.5%;
text-decoration: none;
color: #FFF;
font-family: @standardFamily;
&:hover {
background-color: orange;
background-color: @fg;
}
h2 {
width: 100%;
text-transform: uppercase;
margin: 0;
font-family: @titleFamily;
}
small {
float: right;
font-size: 0.5em;
}
small {
color: @warning;
font-family: @titleFamily;
float: left;
font-size: 0.8em;
}
.subtitle {
overflow: hidden;
margin-bottom: 20px;
}
.size {
float: left;
font-size: 0.8em;
}
.category {
.purpose {
text-transform: uppercase;
font-size: 0.7em;
float: right;

View File

@@ -1,9 +1,10 @@
<a href="#/{{id}}" class="ship" ng-repeat="(id,s) in ships">
<h2>{{s.name}}<small>{{s.manufacturer}}</small></h2>
<h2>{{s.name}}</h2>
<small>{{s.manufacturer}}</small>
<div class="subtitle">
<div class="size">Class {{s.class}} / {{SZ[s.class]}}</div>
<div class="purpose">{{SP[s.group]}}</div>
</div>
{{credits(s.cost)}} Credits
{{credits(s.cost)}} C
</a>

View File

@@ -2,6 +2,7 @@
"sidewinder": {
"group": "mp",
"name": "Sidewinder",
"manufacturer": "Faulcon DeLacy",
"class": 1,
"cost": 12887,
"speed": 220,