Refactored mong.js; Implemented majorList for ProfilCard;
This commit is contained in:
parent
5f0c8c1d2f
commit
633dbc90f0
21
mong.js
21
mong.js
@ -1,19 +1,14 @@
|
|||||||
db = db.getSiblingDB('omdb')
|
var db = db.getSiblingDB('omdb');
|
||||||
|
|
||||||
db.messages.insert([
|
// Insert data in collections
|
||||||
{"subject":"DOLORE LABORIS AUTE","message":"Ex sunt elit elit in ex ad labore minim. Elit amet irure sit aliquip excepteur sit qui et aute qui mollit cillum.","user":"Jaime Potter","tag":["sit","in","dolore","ullamco"]},
|
load('mong_msg.js');
|
||||||
{"subject":"NON IPSUM MOLLIT","message":"Ut laborum proident magna magna qui non in voluptate reprehenderit labore. Qui consectetur dolor nisi culpa cillum quis.","user":"Goff Durham","tag":["aliqua","sunt","labore","minim"]},
|
load('mong_tag.js');
|
||||||
{"subject": "ESSE IPSUM INCIDIDUNT","message":"Esse enim amet laboris proident do do ut cupidatat laborum ex. Sit esse id laborum aliqua id.","user":"Helena Mercado","tag":["fugiat","nisi","incididunt","ullamco"]},
|
load('mong_usr.js');
|
||||||
{"subject":"PARIATUR DOLOR SUNT","message":"Exercitation officia ad consequat est voluptate est incididunt ut culpa consectetur. Consectetur irure veniam ipsum sint sit anim minim aute exercitation ullamco nostrud reprehenderit consequat.","user":"Christi Walker","tag":["consectetur","sint","qui","ipsum"]},
|
|
||||||
{"subject":"TEMPOR ID VOLUPTATE","message":"Anim ex commodo officia consequat in magna esse sunt mollit sunt commodo. Ex sit aute reprehenderit elit magna sunt irure pariatur cupidatat labore.","user":"Kent Schroeder","tag":["adipisicing","nulla","tempor","veniam"]},
|
|
||||||
{"subject":"LOREM EST AUTE","message":"Irure excepteur laborum quis tempor officia cillum officia est ea adipisicing duis enim aliqua. Est dolor laborum officia elit ullamco.","user":"Dominguez Stevens","tag":["mollit","amet","consectetur","dolore"]},
|
|
||||||
{"subject":"ESSE MOLLIT CILLUM","message":"Eu culpa laborum consequat sunt aliqua excepteur. Voluptate pariatur deserunt consequat id nostrud do magna occaecat sint nulla non nostrud.","user":"Terrell Padilla","tag":["Lorem","consequat","fugiat","aliqua"]}
|
|
||||||
])
|
|
||||||
|
|
||||||
db.tags.insert([
|
// Delete all collections + all records
|
||||||
{"name":"Lorem"},{"name":"fugiat"},{"name":"aliqua"},{"name":"consequat"},{"name":"mollit"},{"name":"aet"},{"name":"consectetur"},{"name":"dolore"},{"name":"nulla"},{"name":"tempor"},{"name":"veniam"},{"name":"ipsum"},{"name":"adipisicing"},{"name":"qui"},{"name":"sint"},{"name":"ullamco"},{"name":"incididunt"},{"name":"nisi"},{"name":"sit"},{"name":"minim"},{"name":"labore"},{"name":"sunt"},{"name":"in"}
|
//db.messages.drop(); db.tags.drop(); db.user.drop(); db.sessions.drop()
|
||||||
])
|
|
||||||
|
|
||||||
|
// Print all collections + records count
|
||||||
var collections = db.getCollectionNames();
|
var collections = db.getCollectionNames();
|
||||||
print('Collections inside the db:');
|
print('Collections inside the db:');
|
||||||
for(var i = 0; i < collections.length; i++){
|
for(var i = 0; i < collections.length; i++){
|
||||||
|
9
mong_msg.js
Normal file
9
mong_msg.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
db.messages.insert([
|
||||||
|
{"subject":"DOLORE LABORIS AUTE","message":"Ex sunt elit elit in ex ad labore minim. Elit amet irure sit aliquip excepteur sit qui et aute qui mollit cillum.","user":"Jaime Potter","tag":["sit","in","dolore","ullamco"]},
|
||||||
|
{"subject":"NON IPSUM MOLLIT","message":"Ut laborum proident magna magna qui non in voluptate reprehenderit labore. Qui consectetur dolor nisi culpa cillum quis.","user":"Goff Durham","tag":["aliqua","sunt","labore","minim"]},
|
||||||
|
{"subject": "ESSE IPSUM INCIDIDUNT","message":"Esse enim amet laboris proident do do ut cupidatat laborum ex. Sit esse id laborum aliqua id.","user":"Helena Mercado","tag":["fugiat","nisi","incididunt","ullamco"]},
|
||||||
|
{"subject":"PARIATUR DOLOR SUNT","message":"Exercitation officia ad consequat est voluptate est incididunt ut culpa consectetur. Consectetur irure veniam ipsum sint sit anim minim aute exercitation ullamco nostrud reprehenderit consequat.","user":"Christi Walker","tag":["consectetur","sint","qui","ipsum"]},
|
||||||
|
{"subject":"TEMPOR ID VOLUPTATE","message":"Anim ex commodo officia consequat in magna esse sunt mollit sunt commodo. Ex sit aute reprehenderit elit magna sunt irure pariatur cupidatat labore.","user":"Kent Schroeder","tag":["adipisicing","nulla","tempor","veniam"]},
|
||||||
|
{"subject":"LOREM EST AUTE","message":"Irure excepteur laborum quis tempor officia cillum officia est ea adipisicing duis enim aliqua. Est dolor laborum officia elit ullamco.","user":"Dominguez Stevens","tag":["mollit","amet","consectetur","dolore"]},
|
||||||
|
{"subject":"ESSE MOLLIT CILLUM","message":"Eu culpa laborum consequat sunt aliqua excepteur. Voluptate pariatur deserunt consequat id nostrud do magna occaecat sint nulla non nostrud.","user":"Terrell Padilla","tag":["Lorem","consequat","fugiat","aliqua"]}
|
||||||
|
])
|
3
mong_tag.js
Normal file
3
mong_tag.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
db.tags.insert([
|
||||||
|
{"name":"Lorem"},{"name":"fugiat"},{"name":"aliqua"},{"name":"consequat"},{"name":"mollit"},{"name":"aet"},{"name":"consectetur"},{"name":"dolore"},{"name":"nulla"},{"name":"tempor"},{"name":"veniam"},{"name":"ipsum"},{"name":"adipisicing"},{"name":"qui"},{"name":"sint"},{"name":"ullamco"},{"name":"incididunt"},{"name":"nisi"},{"name":"sit"},{"name":"minim"},{"name":"labore"},{"name":"sunt"},{"name":"in"}
|
||||||
|
])
|
11
mong_usr.js
Normal file
11
mong_usr.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
db.user.insert([
|
||||||
|
// author,OHMNEWS2019
|
||||||
|
{"_id":"author","name":"Test Author","type":"author","roles":["user","author"],"hash":"sha256","salt":"cy5CkPrplcEze6o4psURhw==","pwd":"Gc8ozlxjEGITkS+fW9tz2xLROzws44s04EOCWuP04qE=","tags":["wichtig","th"],"bookmarks":["th"],},
|
||||||
|
// admin,oZuse1
|
||||||
|
{"_id":"admin","name":"Test Admin","type":"admin","roles":["user","author","admin"],"hash":"sha256","salt":"PoIUHbDp7tP34ji31iQ0zw==","pwd":"mJpIfIksYs6LJJwYRBemFKqR6TacsSl2E0ZtpO1GMuk=","tags":["wichtig","th"],"bookmarks":["wichtig"],},
|
||||||
|
])
|
||||||
|
|
||||||
|
//var c = require('./server/crypto.js'),
|
||||||
|
// e = {"_id":"writer","hash":"sha256"};
|
||||||
|
//c.fillLocalAuth(e,"pwd");
|
||||||
|
//console.info(JSON.stringify(e));
|
@ -78,8 +78,8 @@
|
|||||||
<script src="routes/msgCard.js"></script>
|
<script src="routes/msgCard.js"></script>
|
||||||
<script src="routes/messageData.js"></script>
|
<script src="routes/messageData.js"></script>
|
||||||
<script src="routes/tagData.js"></script>
|
<script src="routes/tagData.js"></script>
|
||||||
|
<script src="routes/majorData.js"></script>
|
||||||
<script src="routes/profilCard.js"></script>
|
<script src="routes/profilCard.js"></script>
|
||||||
<script src="routes/profilData.js"></script>
|
|
||||||
<script src="routes/navRoutes.js"></script>
|
<script src="routes/navRoutes.js"></script>
|
||||||
<script src="search.js"></script>
|
<script src="search.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
46
public/routes/majorData.js
Normal file
46
public/routes/majorData.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
var majorList = [
|
||||||
|
{id:'B-AC',name:'Bachelor Angewandte Chemie'},
|
||||||
|
{id:'B-AMP',name:'Bachelor Angewandte Mathematik und Physik'},
|
||||||
|
{id:'B-TJ',name:'Bachelor Technikjournalismus/Technik-PR'},
|
||||||
|
{id:'B-AR',name:'Bachelor Architektur'},
|
||||||
|
{id:'B-BI',name:'Bachelor Bauingenieurwesen'},
|
||||||
|
{id:'B-BW',name:'Bachelor Betriebswirtschaft'},
|
||||||
|
{id:'B-BIO',name:'Bachelor Management in der Biobranche'},
|
||||||
|
{id:'B-IB',name:'Bachelor International Business'},
|
||||||
|
{id:'B-IBT',name:'Bachelor International Business and Technology'},
|
||||||
|
{id:'B-DE',name:'Bachelor Design'},
|
||||||
|
{id:'B-EI',name:'Bachelor Elektrotechnik und Informationstechnik'},
|
||||||
|
{id:'B-MED',name:'Bachelor Medizintechnik'},
|
||||||
|
{id:'B-MF',name:'Bachelor Mechatronik/Feinwerktechnik'},
|
||||||
|
{id:'B-ME',name:'Bachelor Media Engineering'},
|
||||||
|
{id:'B-IN',name:'Bachelor Informatik'},
|
||||||
|
{id:'B-MIN',name:'Bachelor Medieninformatik'},
|
||||||
|
{id:'B-WIN',name:'Bachelor Wirtschaftsinformatik'},
|
||||||
|
{id:'B-MB',name:'Bachelor Maschinenbau'},
|
||||||
|
{id:'B-EGT',name:'Bachelor Energie- und Gebäudetechnik'},
|
||||||
|
{id:'B-EBL',name:'Bachelor Soziale Arbeit: Erziehung und Bildung im Lebenslauf'},
|
||||||
|
{id:'B-SA',name:'Bachelor Soziale Arbeit'},
|
||||||
|
{id:'B-EPT',name:'Bachelor Energieprozesstechnik'},
|
||||||
|
{id:'B-VT',name:'Bachelor Verfahrenstechnik'},
|
||||||
|
{id:'B-WT',name:'Bachelor Werkstofftechnik'},
|
||||||
|
{id:'M-AMP',name:'Master Angewandte Mathematik und Physik'},
|
||||||
|
{id:'M-AR',name:'Master Architektur'},
|
||||||
|
{id:'M-BI',name:'Master Internationales Bauwesen'},
|
||||||
|
{id:'M-URB',name:'Master Urbane Mobilität (Verkehrsingenieurwesen)'},
|
||||||
|
{id:'M-BW',name:'Master Betriebswirtschaft'},
|
||||||
|
{id:'M-TAX',name:'Master Steuerberatung'},
|
||||||
|
{id:'M-WR',name:'Master Wirtschaftsrecht'},
|
||||||
|
{id:'M-IFE',name:'Master International Finance and Economics'},
|
||||||
|
{id:'M-IMA',name:'Master International Marketing'},
|
||||||
|
{id:'M-APR',name:'Master Applied Research in Engineering Sciences'},
|
||||||
|
{id:'M-SY',name:'Master Elektronische und Mechatronische Systeme'},
|
||||||
|
{id:'M-IN',name:'Master Informatik'},
|
||||||
|
{id:'M-MIN',name:'Master Medieninformatik'},
|
||||||
|
{id:'M-WIN',name:'Master Wirtschaftsinformatik'},
|
||||||
|
{id:'M-MB',name:'Master Maschinenbau'},
|
||||||
|
{id:'M-EE',name:'Master Energiemanagement und Energietechnik'},
|
||||||
|
{id:'M-GT',name:'Master Gebäudetechnik'},
|
||||||
|
{id:'M-SA',name:'Master Soziale Arbeit'},
|
||||||
|
{id:'M-VT',name:'Master Chemieingenieurwesen und Verfahrenstechnik'},
|
||||||
|
{id:'M-WT',name:'Master Werkstofftechnik'},
|
||||||
|
];
|
@ -11,7 +11,7 @@ Vue.component('profil-card', {
|
|||||||
|
|
||||||
<div class="profil-text">
|
<div class="profil-text">
|
||||||
<span style="font-size:120%; display:inline-block; margin: 0.8rem 0 0 0;"><b>{{ auth.name }}</b></span><br><br>
|
<span style="font-size:120%; display:inline-block; margin: 0.8rem 0 0 0;"><b>{{ auth.name }}</b></span><br><br>
|
||||||
<span style="font-size:90%; display:inline-block; margin: 0 0 0.8rem 0;"><b>{{ auth.type }}</b></span>
|
<span style="font-size:90%; display:inline-block; margin: 0 0 0.8rem 0;"><b>{{ major }}</b></span>
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -54,18 +54,28 @@ Vue.component('profil-card', {
|
|||||||
abo: 7,
|
abo: 7,
|
||||||
saved: 3,
|
saved: 3,
|
||||||
isCardModalActive: false,
|
isCardModalActive: false,
|
||||||
majorList: {
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
major: function() {
|
||||||
|
// e.g. ST@B-ME;ST@EFI;
|
||||||
|
var majorID = auth.type.split(';')[0].split('@')[1];
|
||||||
|
//console.info(majorID);
|
||||||
|
//console.info(majorList);
|
||||||
|
var majorName = 'Studiengang Unbekannt';
|
||||||
|
majorList.forEach(function(major) {
|
||||||
|
if (major.id == majorID) {
|
||||||
|
majorName = major.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return majorName;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
logout: function() {
|
logout: function() {
|
||||||
clearAuthState();
|
clearAuthState();
|
||||||
$.ajax({ url: "api/logout", method: "POST" });
|
$.ajax({ url: "api/logout", method: "POST" });
|
||||||
router.push('/profil');
|
router.push('/profil');
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
_profilcard = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
user: '',
|
|
||||||
major: '',
|
|
||||||
semester: '',
|
|
||||||
abos: '7',
|
|
||||||
saved: '3',
|
|
||||||
},
|
|
||||||
];
|
|
@ -200,20 +200,19 @@ const dbs = {
|
|||||||
model.Tags._list = [ "" ];
|
model.Tags._list = [ "" ];
|
||||||
|
|
||||||
var userSchema = common.mongoose.Schema({
|
var userSchema = common.mongoose.Schema({
|
||||||
//_id: { type: String },
|
_id: { type: String },
|
||||||
name: { type: String, required: true,
|
name: { type: String, required: true,
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
pwd: { type: String,
|
pwd: { type: String,
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
//hash: { type: String },
|
hash: { type: String },
|
||||||
//salt: { type: String },
|
salt: { type: String },
|
||||||
//type: { type: String },
|
type: { type: String },
|
||||||
roles: { type: [String], required: true,
|
roles: { type: [String], required: true,
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
tags: { type: [String],
|
tags: { type: [String],
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
//deactivated: { type: Boolean },
|
//deactivated: { type: Boolean },
|
||||||
//participating: { type: [String] },
|
|
||||||
//host: { type: Boolean },
|
//host: { type: Boolean },
|
||||||
bookmarks: { type: [String],
|
bookmarks: { type: [String],
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user