Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
260 changes: 25 additions & 235 deletions README.md

Large diffs are not rendered by default.

Binary file added images/Logo_UTFSM.ico
Binary file not shown.
Binary file added images/horario_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
-->
<base href="/">

<link rel="icon" href="images/favicon.ico">
<link rel="icon" href="images/Logo_UTFSM.ico">

<!-- See https://goo.gl/OOhYW5 -->
<link rel="manifest" href="manifest.json">
Expand All @@ -51,6 +51,9 @@
<link rel="apple-touch-icon" sizes="144x144" href="images/manifest/icon-144x144.png">
<link rel="apple-touch-icon" sizes="192x192" href="images/manifest/icon-192x192.png">

<!-- Icons font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<!-- Tile icon for Windows 8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="images/manifest/icon-144x144.png">
<meta name="msapplication-TileColor" content="#3f51b5">
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"pwa-helpers": "^0.9.0",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0"
"reselect": "^4.0.0",
"tslib": "^1.10.0",
"weightless": "0.0.37"
},
"devDependencies": {
"@polymer/test-fixture": "^4.0.2",
Expand Down
54 changes: 50 additions & 4 deletions src/actions/cursos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,56 @@ export type CursosAction = ActionGetCursos;
type ThunkResult = ThunkAction<void, RootState, undefined, CursosAction>;

const CURSOS_LIST = [
{ "id": 1, "sigla": 'IWI131', "asignatura": 'Programación', "departamento": 'Informática' , "paralelos": [{ "id": 1, "profesor": 'profe1', "cupos": 20}, { "id": 2, "profesor": 'profe2', "cupos": 30}]},
{ "id": 3, "sigla": 'FIS100', "asignatura": 'Introducción a la Física', "departamento": 'Física' , "paralelos": [{"id": 1, "profesor": 'Hakobyan', "cupos": 50}] },
{ "id": 4, "sigla": 'MAT021' , "asignatura": 'Matemáticas I', "departamento": 'Matemáticas', "paralelos": [{"id": 1, "profesor": 'El maravilloso Yansen', "cupos": 25}] },
{ "id": 5, "sigla": 'MAT022' , "asignatura": 'Matemáticas II' , "departamento": 'Matemáticas' , "paralelos": [{"id": 1, "profesor": 'tuma', "cupos": 14}] }
{ "id": 1, "sigla": 'IWI131', "asignatura": 'Programación', "departamento": 'Informática', "creditos":3, "paralelos": [{ "id": 1, "profesor": 'Nelson Vega', "cupos": 20,
"bloques": [
["A", "", "", "", ""],
["", "A", "", "", ""],
["", "", "A", "", ""],
["", "", "", "A", ""],
["", "", "", "", "A"],
["", "", "", "A", ""],
["", "", "A", "", ""]
] },
{ "id": 2, "profesor": 'Moltedo', "cupos": 30,
"bloques": [
["C201", "", "", "", ""],
["C201", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", "P411"],
["", "", "", "", "P411"]
]}]},
{ "id": 3, "sigla": 'FIS100', "asignatura": 'Introducción a la Física', "departamento": 'Física' , "creditos":3, "paralelos": [{"id": 1, "profesor": 'Hakobyan', "cupos": 50,
"bloques": [
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""]
]}]},
{ "id": 4, "sigla": 'MAT021' , "asignatura": 'Matemáticas I', "departamento": 'Matemáticas', "creditos":5, "paralelos": [{"id": 1, "profesor": 'La maravillosa Astudillo', "cupos": 25,
"bloques": [
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""]
]}] },
{ "id": 5, "sigla": 'MAT022' , "asignatura": 'Matemáticas II' , "departamento": 'Matemáticas' , "creditos":5, "paralelos": [{"id": 1, "profesor": 'El mismísimo TUMA', "cupos": 14,
"bloques": [
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""],
["", "", "", "", ""]
]}] }
];

export const getAllCursos: ActionCreator<ThunkResult> = () => (dispatch) => {
Expand Down
150 changes: 32 additions & 118 deletions src/components/horario-clases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { LitElement, html, css, property, customElement } from 'lit-element';
import { connect } from 'pwa-helpers/connect-mixin.js';
import { store } from '../store.js';
import { ButtonSharedStyles } from './button-shared-styles.js';
import { ListaCursos } from '../reducers/cursos';
import { ListaCursos} from '../reducers/cursos';
import './horario-paralelo';
import "weightless/expansion";
import "weightless/icon";

@customElement('horario-clases')
export class HorarioClases extends connect(store)(LitElement) {
Expand All @@ -26,144 +29,55 @@ export class HorarioClases extends connect(store)(LitElement) {
:host {
display: block;
}

.sigla {
width: 10%
}

.asignatura{
width: 25%
}

.departamento{
width: 13%
}

.paralelo{
width: 22%
}

.profesor{
width: 15%
}

.cupos{
width: 5%
}

.horario{
width: 10%
}

.left{
text-align: left;
table{
width: 90%;
margin: 0 auto;
padding-bottom: 2%;
}
th {
width: 85%;
};
td {
width: 15%;
};
`
];
}


handleClick() {
console.log(this.cursos);
console.log("uwu");
}

protected render() {
return html`
<h2>Listado de Cursos</h2>
<table class="left">
<tbody>
<tr>
<th class="sigla">
<strong> Sigla </strong>
</th>
<th class="asignatura">
<strong> Asignatura </strong>
</th>
<th class="departamento">
<strong> Departamento </strong>
</th>
<th class="paralelo">
<strong> Paralelo </strong>
</th>
<th class="profesor">
<strong> Profesor </strong>
</th>
<th class="cupos">
<strong> Cupos </strong>
</th>
<th class="horario">
<strong> Horario </strong>
</th>
</tr>
<h2>Listado de Cursos </h2>

${Object.keys(this.cursos).map((key) => {
const item = this.cursos[key];
return html`
${Object.keys(item.paralelos).map((idies) => {
// @ts-ignore
const item2 = item.paralelos[idies];
if(idies == '0'){
return html`
<tr>
<td>
${item.sigla}
</td>
<td>
${item.asignatura}
</td>
<td>
${item.departamento}
</td>
<td>
${item2.id}
</td>
<td>
${item2.profesor}
</td>
<td>
${item2.cupos}
</td>
<td>
<button @click="${this.handleClick}">
Detalles
</button>
</td>
</tr>
`;
} else {
return html`
<tr>
<td>

</td>
<td>

</td>
<td>

</td>
<td>
${item2.id}
</td>
<td>
${item2.profesor}
</td>
<td>
${item2.cupos}
</td>
<td>
<button @click="${this.handleClick}">
Detalles
</button>
</td>
</tr>
<wl-expansion name="group">
<span slot="title">${item.sigla}</span>
<span slot="title">${item.asignatura} - Paralelo ${item2.id}</span>
<table>
<tr>
<th> <wl-text> <strong> Departamento: </strong> ${item.departamento}</wl-text> </th>
<td style="text-align:right;"> <wl-text> <strong> Créditos: </strong> ${item.creditos}</wl-text> </th>
</tr>
<tr>
<th> <wl-text> <strong> Profesor: </strong> ${item2.profesor}</wl-text> </td>
<td style="text-align:right;"> <wl-text> <strong> Cupos: </strong> ${item2.cupos}</wl-text> </td>
</tr>
</table>
<horario-paralelo .ocupados=${item2.bloques}></horario-paralelo>
</wl-expansion>
`;
}

})}
`;
})}
</tbody>
</table>
`;

}
Expand Down
Loading