Skip to content

Commit

Permalink
Altered database & removed/changed some things
Browse files Browse the repository at this point in the history
predmetShema -> added unique tag to "ime" and added an atribute "kraticaPredmeta".
Removed unnecesary flairs in "predmet.component.html"
  • Loading branch information
shanji97 committed May 29, 2021
1 parent db7cb2b commit c556bf0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 23 deletions.
5 changes: 3 additions & 2 deletions app_api/models/predmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const gradivoShema = new mongoose.Schema({
*/

const predmetShema = new mongoose.Schema({
ime: {type: String},
ime: {type: String, unique: true},
opis: {type: String},
// 0 -> ni v letniku a, 1 -> 1. letnik...
letnik: {type: Number},
Expand All @@ -215,7 +215,8 @@ const predmetShema = new mongoose.Schema({
gradiva: [{
type: mongoose.Schema.Types.ObjectId,
ref: 'Gradivo'
}]
}],
kraticaPredmeta:{type: String, unique:true}
});

/**
Expand Down
2 changes: 1 addition & 1 deletion app_public/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
<noscript>Please enable JavaScript to continue using this application.</noscript>
<script src="./assets/public/js/jquery-3.5.1.min.js"></script>
<script src="./assets/public/js/bootstrap.bundle.min.js"></script>
<script src="runtime.7b63b9fd40098a2e8207.js" defer></script><script src="polyfills.48c2cf7043c03bf6ac83.js" defer></script><script src="main.a65e3802f5f8c574907e.js" defer></script></body>
<script src="runtime.7b63b9fd40098a2e8207.js" defer></script><script src="polyfills.48c2cf7043c03bf6ac83.js" defer></script><script src="main.fff48111f6a5eeb47220.js" defer></script></body>
</html>

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions app_public/build/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1619179177055,
"timestamp": 1622284841060,
"index": "/index.html",
"assetGroups": [
{
Expand All @@ -13,7 +13,7 @@
"urls": [
"/favicon.ico",
"/index.html",
"/main.a65e3802f5f8c574907e.js",
"/main.fff48111f6a5eeb47220.js",
"/manifest.webmanifest",
"/polyfills.48c2cf7043c03bf6ac83.js",
"/runtime.7b63b9fd40098a2e8207.js",
Expand Down Expand Up @@ -139,8 +139,8 @@
"/assets/public/webfonts/fa-solid-900.woff": "3b86a0ce15d8d534b65e98560e321a933d310688",
"/assets/public/webfonts/fa-solid-900.woff2": "9b592048b9062b00f0b2dd782d70a95b7dc69b83",
"/favicon.ico": "22f6a4a3bcaafafb0254e0f2fa4ceb89e505e8b2",
"/index.html": "7867487ea2782e419c667a587af76727dbdcbeab",
"/main.a65e3802f5f8c574907e.js": "6df35b9a2bd2c61935b900b513c883c96048e90b",
"/index.html": "38212a5144b99018ca406c261e415f3fc21e636c",
"/main.fff48111f6a5eeb47220.js": "70b0a6ba22ca02bd254c0e112957f8b2c8edb171",
"/manifest.webmanifest": "fc5e93aeedf24480fda7d301467626b930dca61a",
"/polyfills.48c2cf7043c03bf6ac83.js": "2116a5df20eec4ad4ed41ec4b01aa93e3af1eda4",
"/runtime.7b63b9fd40098a2e8207.js": "a9aafcf49f49145093fc831efd9b8e2f6c71bb9c",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,13 @@
<p class="mt-3 ml-1">{{predmet.opis}}</p>
<div>
<a *ngFor="let profesor of predmet.profesorji" class="btn btn-profesor rounded m-1" (click)="openOsebje(profesor._id)">Profesor | {{profesor.ime_priimek}}<i class="fas fa-external-link-alt ml-2"></i></a>
<a *ngFor="let asistent of predmet.asistenti" class="btn btn-asistent rounded m-1" (click)="openOsebje(asistent._id)">Asistent | {{asistent.ime_priimek}}<i class="fas fa-external-link-alt ml-2"></i></a>

<div *ngIf="predmet.letnik > 0" class="btn btn-letnik rounded m-1">Letnik | {{predmet.letnik | formatirajLetnik}}</div>

<div class="btn btn-semester rounded m-1">Semester | {{predmet.semester | formatirajSemester}}</div>

<div *ngIf="predmet.vrstaIzbirnega && predmet.vrstaIzbirnega != 0" class="btn btn-tip rounded m-1">Tip | {{predmet.vrstaIzbirnega | formatirajTipIzbirnega}}</div>
<ng-container *ngIf="!predmet.vrstaIzbirnega || predmet.vrstaIzbirnega == 0">
<div *ngIf="predmet.moduli.length == 0" class="btn btn-tip rounded m-1">Tip | Obvezni predmet</div>
<div *ngIf="predmet.moduli.length > 0" class="btn btn-tip rounded m-1">Tip | Modulski predmet</div>
</ng-container>

<div *ngFor="let modul of predmet.moduli" class="btn btn-modul rounded m-1">Modul | {{modul.ime}}</div>
</div>
<a *ngFor="let asistent of predmet.asistenti" class="btn btn-asistent rounded m-1" (click)="openOsebje(asistent._id)">Asistent | {{asistent.ime_priimek}}<i class="fas fa-external-link-alt ml-2"></i></a>
</div>
</div>
<!--dokumenti-->
<app-predmet-gradiva [(predmet)]="predmet"></app-predmet-gradiva>
</div>
</div>

<ng-template #niPredmeta>
<div style="margin-top:10px" class="alert alert-warning" role="alert">
Nalagam predmet
Expand Down

0 comments on commit c556bf0

Please sign in to comment.