Redo styles for the ABB slide, remove QR codes
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
|
||||
#header {
|
||||
}
|
||||
|
||||
#header-logo {
|
||||
margin: 3vw;
|
||||
margin-left: 5vw;
|
||||
text-align: left;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#header-title {
|
||||
margin: 3vw;
|
||||
margin-right: 5vw;
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 9vw;
|
||||
}
|
||||
|
||||
.item-row {
|
||||
margin: 1vw;
|
||||
background-color: rgba(160, 160, 160, 0.15);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 2.5vw;
|
||||
margin-top: 2vw;
|
||||
margin-bottom: 2vw;
|
||||
text-align: left;
|
||||
padding-left: 5vw;
|
||||
padding-right: 5vw;
|
||||
}
|
||||
|
||||
.item-qr {
|
||||
position: absolute;
|
||||
right: 5vw;
|
||||
top: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#footer {
|
||||
font-size: 3vw;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
bottom: 1vh;
|
||||
width: 80vw;
|
||||
left: 10vw;
|
||||
right: 10vw;
|
||||
}
|
||||
@@ -1,13 +1,29 @@
|
||||
<link rel="stylesheet" href="/static/css/abb.css">
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
|
||||
<div ng-controller="ABBController">
|
||||
<!-- Only show the job listing if there are any jobs, i.e, the jobs list is non-empty -->
|
||||
<div class="row" ng-if="jobs.length > 0" style="max-height:300px">
|
||||
<div class="col-xs-4 col-xs-offset-1" style="padding-top:30px;padding-bottom:30px"><img src="/static/img/ABB_logo.png"></div>
|
||||
<div class="col-xs-7" style="font-size:140px;padding-top:40px">TYÖPAIKAT</div>
|
||||
<div id="header" class="row" ng-if="jobs.length > 0">
|
||||
<div id="header-logo">
|
||||
<img src="/static/img/ABB_logo.png">
|
||||
</div>
|
||||
<div id="header-title">
|
||||
TYÖPAIKAT
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if="jobs.length > 0" ng-repeat="job in jobs" style="height:280px;;border:2px solid black;color:#33333">
|
||||
<div class="col-xs-7 col-xs-offset-1" style="font-size:72px;padding-top:30px">{{ job.title }}</div>
|
||||
<div class="col-xs-3 col-xs-offset-1"><qrcode data="http://sahkoinsinoorikilta.fi/fi/news/{{ job.id }}" size="278"></qrcode></div>
|
||||
<div class="item-row row" ng-if="jobs.length > 0" ng-repeat="job in jobs">
|
||||
<div class="item-title col-xs-12">
|
||||
{{ job.title }}
|
||||
</div>
|
||||
<!--
|
||||
<div class="item-qr col-xs-6">
|
||||
<qrcode data="http://sahkoinsinoorikilta.fi/fi/news/{{ job.id }}" size="278"></qrcode>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
Lisätietoja osoitteessa sik.ayy.fi/duunit
|
||||
</div>
|
||||
|
||||
<!-- If there are no jobs, show a static image -->
|
||||
|
||||
@@ -45,103 +45,108 @@ app.controller('ABBController', function($scope, $http){
|
||||
var params = "?type=11&lang=fi&title_search=ABB&min_date="+min_date
|
||||
$http.get(url+params).then(function(response){
|
||||
$scope.jobs = _.filter(response.data, function(job){
|
||||
if (job.autohide_enabled == 1){
|
||||
if (moment(job.autohide) < moment()){
|
||||
return false;
|
||||
if (job.autohide_enabled == 1){
|
||||
if (moment(job.autohide) < moment()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
})
|
||||
})
|
||||
return true;
|
||||
});
|
||||
|
||||
if ($scope.jobs.length > 3) {
|
||||
$scope.jobs = $scope.jobs.slice(0, 3);
|
||||
}
|
||||
});
|
||||
});
|
||||
app.controller('SossoController', function($scope, $http){
|
||||
|
||||
app.controller('SossoController', function($scope, $http) {
|
||||
$scope.data = [];
|
||||
$http.get("http://sosso.fi/api/get_recent_posts/?count=" + 3 ).then(function(response)
|
||||
{
|
||||
$scope.data = response.data;
|
||||
})
|
||||
{
|
||||
$scope.data = response.data;
|
||||
})
|
||||
});
|
||||
app.controller('timetableCtrl',
|
||||
function($scope, $http, $interval) {
|
||||
function load(){
|
||||
$http.get('/static/js/hsl.json')
|
||||
.then(function(data, status, headers, config) {
|
||||
$scope.arr=[];
|
||||
parse(data);
|
||||
});
|
||||
};
|
||||
var obj;
|
||||
$scope.arr=[];
|
||||
var dict=[];
|
||||
function parse(data){
|
||||
obj=data['data'];
|
||||
for(var a in obj){
|
||||
for(var b in obj[a]['lines']){
|
||||
var elem=obj[a]['lines'][b].split(":");
|
||||
dict[elem[0]]=elem[1];
|
||||
}
|
||||
for(var b in obj[a]['departures']){
|
||||
var e=true;
|
||||
var time=obj[a]['departures'][b]['time'];
|
||||
date=obj[a]['departures'][b]['date'];
|
||||
if(time<1000)
|
||||
var unit = 1;
|
||||
else
|
||||
var unit = 2;
|
||||
var hh= Math.floor(obj[a]['departures'][b]['time']/100);
|
||||
if(hh>=24){
|
||||
hh-=24;
|
||||
date++;
|
||||
}
|
||||
var mm= obj[a]['departures'][b]['time']%100;
|
||||
var c= obj[a]['departures'][b]['code'].substring(1,5);
|
||||
if(c.charAt(0)=='0')
|
||||
c=c.substring(1,4);
|
||||
z={"stop":obj[a]['name'].split(",")[0],"dist":obj[a]['dist'],"bus":c,"date":date,"time":pad(hh,2)+":"+pad(mm,2),"laststop":dict[obj[a]['departures'][b]['code']].split(",")[0].split(" ")[0]};
|
||||
for(var i= $scope.arr.length-1;i>=0;i--)
|
||||
if( $scope.arr[i]['bus']==z['bus'] && $scope.arr[i]['laststop']==z['laststop']){
|
||||
if( $scope.arr[i]['dist']==z['dist']){
|
||||
break;
|
||||
}
|
||||
else if( $scope.arr[i]['dist'] > z['dist']){
|
||||
$scope.arr.splice(i,1);
|
||||
}
|
||||
else
|
||||
e=false;
|
||||
}
|
||||
if(e){
|
||||
$scope.arr.push(z);
|
||||
}
|
||||
function($scope, $http, $interval) {
|
||||
function load(){
|
||||
$http.get('/static/js/hsl.json')
|
||||
.then(function(data, status, headers, config) {
|
||||
$scope.arr=[];
|
||||
parse(data);
|
||||
});
|
||||
};
|
||||
var obj;
|
||||
$scope.arr=[];
|
||||
var dict=[];
|
||||
function parse(data){
|
||||
obj=data['data'];
|
||||
for(var a in obj){
|
||||
for(var b in obj[a]['lines']){
|
||||
var elem=obj[a]['lines'][b].split(":");
|
||||
dict[elem[0]]=elem[1];
|
||||
}
|
||||
for(var b in obj[a]['departures']){
|
||||
var e=true;
|
||||
var time=obj[a]['departures'][b]['time'];
|
||||
date=obj[a]['departures'][b]['date'];
|
||||
if(time<1000)
|
||||
var unit = 1;
|
||||
else
|
||||
var unit = 2;
|
||||
var hh= Math.floor(obj[a]['departures'][b]['time']/100);
|
||||
if(hh>=24){
|
||||
hh-=24;
|
||||
date++;
|
||||
}
|
||||
var mm= obj[a]['departures'][b]['time']%100;
|
||||
var c= obj[a]['departures'][b]['code'].substring(1,5);
|
||||
if(c.charAt(0)=='0')
|
||||
c=c.substring(1,4);
|
||||
z={"stop":obj[a]['name'].split(",")[0],"dist":obj[a]['dist'],"bus":c,"date":date,"time":pad(hh,2)+":"+pad(mm,2),"laststop":dict[obj[a]['departures'][b]['code']].split(",")[0].split(" ")[0]};
|
||||
for(var i= $scope.arr.length-1;i>=0;i--)
|
||||
if( $scope.arr[i]['bus']==z['bus'] && $scope.arr[i]['laststop']==z['laststop']){
|
||||
if( $scope.arr[i]['dist']==z['dist']){
|
||||
break;
|
||||
}
|
||||
else if( $scope.arr[i]['dist'] > z['dist']){
|
||||
$scope.arr.splice(i,1);
|
||||
}
|
||||
else
|
||||
e=false;
|
||||
}
|
||||
if(e){
|
||||
$scope.arr.push(z);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function pad(num, size) {
|
||||
var s = num+"";
|
||||
while (s.length < size) s = "0" + s;
|
||||
return s;
|
||||
}
|
||||
delOld();
|
||||
}
|
||||
function delOld(){
|
||||
f= new Date();
|
||||
for(var a=$scope.arr.length-1; a>=0; a--){
|
||||
if( $scope.arr[a]['time']<1000)
|
||||
var unit = 1;
|
||||
else
|
||||
var unit = 2;
|
||||
var time=$scope.arr[a]['time'].split(":");
|
||||
date=$scope.arr[a]['date'].toString();
|
||||
d= new Date(f);
|
||||
d.setFullYear(date.substring(0,4),date.substring(4,6)-1,date.substring(6,8));
|
||||
d.setHours(time[0]);
|
||||
d.setMinutes(time[1]);
|
||||
if(d < f){
|
||||
$scope.arr.splice(a,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
load();
|
||||
var t=$interval(delOld,2000);
|
||||
var z=$interval(load,60000);
|
||||
}
|
||||
}
|
||||
}
|
||||
function pad(num, size) {
|
||||
var s = num+"";
|
||||
while (s.length < size) s = "0" + s;
|
||||
return s;
|
||||
}
|
||||
delOld();
|
||||
}
|
||||
function delOld(){
|
||||
f= new Date();
|
||||
for(var a=$scope.arr.length-1; a>=0; a--){
|
||||
if( $scope.arr[a]['time']<1000)
|
||||
var unit = 1;
|
||||
else
|
||||
var unit = 2;
|
||||
var time=$scope.arr[a]['time'].split(":");
|
||||
date=$scope.arr[a]['date'].toString();
|
||||
d= new Date(f);
|
||||
d.setFullYear(date.substring(0,4),date.substring(4,6)-1,date.substring(6,8));
|
||||
d.setHours(time[0]);
|
||||
d.setMinutes(time[1]);
|
||||
if(d < f){
|
||||
$scope.arr.splice(a,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
load();
|
||||
var t=$interval(delOld,2000);
|
||||
var z=$interval(load,60000);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user