Skip to content
Snippets Groups Projects
Commit 07c7f8f8 authored by wonko's avatar wonko
Browse files

bunter fahrplan

parent 0954bcb7
No related branches found
No related tags found
No related merge requests found
from openpyxl import load_workbook
import json
wb = load_workbook(filename = 'vortragsplan-13.5..xlsx')
wb = load_workbook(filename='vortragsplan-13.5..xlsx')
ws = wb['Tabelle1']
......@@ -16,7 +16,7 @@ def cval(cell):
cv = cv.strip()
return cv
for rows in ws.iter_cols(min_col=2,min_row=1,max_row=1):
for rows in ws.iter_cols(min_col=2, min_row=1, max_row=1):
for cell in rows:
room = cval(cell)
if room:
......@@ -24,7 +24,7 @@ for rows in ws.iter_cols(min_col=2,min_row=1,max_row=1):
if room:
rooms.append(cell)
for rows in ws.iter_rows(min_col=1,min_row=1,max_row=ws.max_row+1,max_col=1):
for rows in ws.iter_rows(min_col=1, min_row=1, max_row=ws.max_row + 1, max_col=1):
for cell in rows:
time = cval(cell)
if time:
......@@ -34,31 +34,37 @@ for rows in ws.iter_rows(min_col=1,min_row=1,max_row=ws.max_row+1,max_col=1):
for room in rooms:
roomdata = {'name':room.value}
timeslots = []
for time in times:
timeslot = {'time': time.value}
for time in times:
timename = time.value
be = timename.split('-')
timeslot = {'time': time.value, 'begin': be[0].strip(), 'end':be[1].strip()}
lecture = {}
col = room.col_idx
row = time.row
fs = cval(ws.cell(row=row, column=col))
if fs:
lecture['fs'] = fs
name = cval(ws.cell(row=row+1, column=col))
if name:
lecture['name'] = name
titel = cval(ws.cell(row=row+2, column=col))
titel = cval(ws.cell(row=row + 1, column=col))
if titel:
lecture['titel'] = titel
aufz = cval(ws.cell(row=row+3, column=col))
name = cval(ws.cell(row=row + 2, column=col))
if name:
lecture['name'] = name
teaser = cval(ws.cell(row=row + 3, column=col))
if teaser:
lecture['teaser'] = teaser
aufz = cval(ws.cell(row=row + 3, column=col))
if aufz:
lecture['aufz'] = aufz
if len(lecture) > 0:
lecture['time'] = time.value
lecture['room'] = room.value
timeslot['lecture'] = lecture
timeslots.append(timeslot)
roomdata['times'] = timeslots
data.append(roomdata)
data.append(roomdata)
print (data)
jsondata = {'schedule':data}
with open('../src/www/data/lectures.json', 'w') as outfile:
......
No preview for this file type
<?xml version='1.0' encoding='utf-8'?>
<widget id="de.night.of.science" version="0.0.1"
<widget id="de.night.of.science" version="0.0.2"
xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Night of Science</name>
<description>An awesome Ionic/Cordova app.</description>
......
......@@ -6,7 +6,7 @@
<ion-title>Programm</ion-title>
</ion-navbar>
<ion-toolbar>
<ion-title>{{room}}</ion-title>
<ion-title text-center>{{room}}</ion-title>
</ion-toolbar>
</ion-header>
......@@ -18,9 +18,10 @@
<ion-item style="height: 12em; border-bottom: 1px solid #dedede;" *ngFor="let time of room.times">
<div item-left style="text-align: center;font-size: 0.5em;">
{{time.time}} <br/>-<br/> {{time.end}}
{{time.begin}} <br/>-<br/> {{time.end}}
</div>
<ion-card class="card-red" *ngIf="time.lecture">
<ion-card [ngClass]="cardClass(time.lecture)" *ngIf="time.lecture">
<ion-item text-wrap class="card-header">
<ion-avatar item-left>
<ion-icon name="camera"></ion-icon>
......@@ -29,7 +30,7 @@
<p>{{time.lecture.name}}</p>
</ion-item>
<ion-card-content text-wrap class="teaser">
{{time.lecture.titel}}
{{time.lecture.teaser}}
</ion-card-content>
<ion-row class="card-footer">
......
......@@ -3,16 +3,67 @@ page-programme {
ion-slides { height: initial; }
// colors https://material.io/color/#!/?view.left=0&view.right=0&primary.color=E57373
.card-red {
background-color: red;
background-color: #e57373;
}
.card-pink {
background-color: #f06292;
}
.card-purple {
background-color: #ba68c8;
}
.card-deeppurple {
background-color: #9575cd;
}
.card-indigo {
background-color: #7986cb;
}
.card-blue {
background-color: blue;
background-color: #64b5f6;
}
.card-lightblue {
background-color: #4fc3f7;
}
.card-cyan {
background-color: #4dd0e1;
}
.card-teal {
background-color: #4db6ac;
}
.card-green {
background-color: #81c784;
}
.card-lightgreen {
background-color: #aed581;
}
.card-lime {
background-color: #dce775;
}
.card-yellow {
background-color: #fff176;
}
.card-amber {
background-color: #ffd54f;
}
.card-orange {
background-color: #ffb74d;
}
.card-deeporange {
background-color: #ff8a65;
}
.card-brown {
background-color: #a1887f;
}
.card-grey {
background-color: #e0e0e0;
}
.card-bluegrey {
background-color: #90a4ae;
}
.card-header {
background-color: transparent;
......
......@@ -50,10 +50,45 @@ export class Programme {
);
}
cardClass(lecture){
switch(lecture.fs){
case "Psychologie":{
return "card-red";
}
case "Chemie":{
return "card-amber";
}
case "Biochemie":{
return "card-lightgreen";
}
case "Mathematik":{
return "card-bluegrey";
}
case "Geowissenschaften":{
return "card-orange";
}
case "Medizin":{
return "card-cyan";
}
case "Biowissenschaften":{
return "card-green";
}
case "Biophysik":{
return "card-teal";
}
case "Physik":{
return "card-indigo";
}
case "Informatik":{
return "card-pink";
}
default: {
return "card-blue";
}
}
}
slideChanged() {
let currentIndex = this.slides.getActiveIndex();
this.room = this.lecturesData[currentIndex].name;
console.log('slide changed' + this.room)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment