Commit fa6777e6 authored by Curtis Adam's avatar Curtis Adam

Refactor cardset modal

parent c8f2ea38
......@@ -198,7 +198,10 @@
"both": "Leitner & Woźniak",
"none": "ohne",
"levelOfLearning": "Lernstand",
"noModuleLong": "Ohne Modul",
"noDescription": "Keine Beschreibung vorhanden",
"noCollege": "ohne Hochschule",
"noCourse": "ohne Studiengang",
"noModuleLong": "ohne Modul",
"noModuleShort": "ohne"
},
"set-list-empty": {
......@@ -220,6 +223,7 @@
"descriptionplaceholder": "Lernziele und Lerninhalte",
"categoryplaceholder": "Wähle eine Kategorie",
"description": "Beschreibung",
"optional": "(Optional)",
"category": "Kategorie",
"visibility": "Sichtbar für",
"visibilityoption1": "mich",
......
......@@ -208,7 +208,10 @@
"both": "Leitner & Woźniak",
"none": "None",
"levelOfLearning": "Progress",
"noModuleLong": "Without module",
"noDescription": "No description available",
"noCollege": "No college",
"noCourse": "No course",
"noModuleLong": "No module",
"noModuleShort": "None"
},
"set-list-empty": {
......@@ -230,6 +233,7 @@
"descriptionplaceholder": "Description for the content of this cardset",
"categoryplaceholder": "Choose a category",
"description": "Description",
"optional": "(Optional)",
"category": "Category",
"visibility": "Visible for",
"visibilityoption1": "Private",
......@@ -275,7 +279,7 @@
"course_required": "Choose a course",
"manageEditors": "Manage Editors for cardset \"__name__\"",
"module": "Module",
"moduleActivated": "With Module",
"moduleActivated": "Belongs to a Module",
"moduleDeactivated": "Without Module",
"module_required": "The full name of the module is required!",
"moduleShort": "Initials",
......
......@@ -69,7 +69,8 @@ const CardsetsSchema = new SimpleSchema({
type: String
},
description: {
type: String
type: String,
optional: true
},
date: {
type: Date
......@@ -139,10 +140,12 @@ const CardsetsSchema = new SimpleSchema({
optional: true
},
college: {
type: String
type: String,
optional: true
},
course: {
type: String
type: String,
optional: true
},
learningActive: {
type: Boolean
......
This diff is collapsed.
This diff is collapsed.
......@@ -244,8 +244,8 @@ $font_5: sans-serif;
@media (min-width: 768px) {
#cardSetCancel {
margin-left: 25px;
.cardSetCancel {
margin-left: 25px !important;
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -84,9 +84,9 @@ ul.nav-list li.active {
font-weight: bold;
}
#module {
margin-left: 0.1em;
margin-right: 0.1em;
.module {
margin-left: 0.1em !important;
margin-right: 0.1em !important;
}
#info_license img {
......@@ -190,3 +190,9 @@ input, textarea {
.moduleRadioButtonLabel {
color: $white !important;
}
@media (max-width: 767px) {
.radio-inline {
margin-left: 0!important;
}
}
......@@ -92,6 +92,7 @@
<li>
<a href="#" class="filterCollege active" data-id="">{{_
"set-list.everything"}}</a>
<a href="#" class="filterNoModule active" data-id="">{{_ "set-list.noCollege"}}</a>
</li>
{{#each getColleges}}
<li>
......@@ -117,6 +118,7 @@
<ul class="dropdown-menu">
<li>
<a href="#" class="filterCourse active" data-id="">{{_ "set-list.everything"}}</a>
<a href="#" class="filterNoModule active" data-id="">{{_ "set-list.noCourse"}}</a>
</li>
{{#each getCourses}}
<li>
......@@ -333,18 +335,18 @@
this.owner}}</span>
</a>
{{#unless singleUniversity}}
<a href="#" class="filterCollege" title="Filter {{_ "set-list.college"}}: {{this.college}}">
<a href="#" class="filterCollege" title="Filter {{_ "set-list.college"}}: {{#if this.moduleActive}}{{this.college}}{{else}}{{_ "set-list.noCollege"}}{{/if}}">
<span class="col-xs-6 visible-xs poolLabel panelUnit"
data-id="{{this.college}}">{{_ "set-list.college"}}:</span>
<span class="col-xs-6 col-sm-2 poolContent poolText panelUnit poolCollege"
data-id="{{this.college}}">{{this.college}}</span>
data-id="{{this.college}}">{{#if this.moduleActive}}{{this.college}}{{else}}{{_ "set-list.noCollege"}}{{/if}}</span>
</a>
{{/unless}}
<a href="#" class="filterCourse" title="Filter {{_ "set-list.course"}}: {{this.course}}">
<a href="#" class="filterCourse" title="Filter {{_ "set-list.course"}}: {{#if this.moduleActive}}{{this.course}}{{else}}{{_ "set-list.noCourse"}}{{/if}}">
<span class="col-xs-6 visible-xs poolLabel panelUnit" data-id="{{this.course}}">{{_
"set-list.course"}}:</span>
<span class="col-xs-6 col-sm-2 poolContent poolText panelUnit poolCourse"
data-id="{{this.course}}">{{this.course}}</span>
data-id="{{this.course}}">{{#if this.moduleActive}}{{this.course}}{{else}}{{_ "set-list.noCourse"}}{{/if}}</span>
</a>
<a href="#" class="{{#if this.moduleActive}}filterModule{{else}}filterNoModule{{/if}}" title="Filter {{_ "set-list.module"}}: {{#if this.moduleActive}}{{this.module}}{{else}}{{_ "set-list.noModuleLong"}}{{/if}}">
<span class="col-xs-6 visible-xs poolLabel panelUnit" data-id="{{this.module}}">{{_
......@@ -430,7 +432,8 @@
</template>
<template name="poolTitleContent">
<div class="tip-content">{{#markdown}}{{getMaximumText content.description}}{{/markdown}}</div>
<div class="tip-content">{{#if gotDescription content.description}}{{#markdown}}{{getMaximumText content.description}}{{/markdown}}{{else}}{{_
"set-list.noDescription"}}{{/if}}</div>
<span class="col-xs-6 visible-xs poolLabel panelUnit" data-id="{{content._id}}">{{_
"set-list.topic"}}
:</span>
......
......@@ -328,6 +328,11 @@ Template.poolTitleContent.helpers({
return textSplitted.slice(0, maxLength).toString().replace(/,/g, ' ') + "...";
}
return text;
},
gotDescription: function (text) {
if (text !== "" && text !== undefined) {
return true;
}
}
});
......
......@@ -24,41 +24,41 @@ module.exports = function () {
});
this.Then(/^he is redirected to the new cardset form$/, function () {
navigation.contentVisible('#newSetModalTitle');
navigation.contentVisible('#setCardsetModalTitle');
});
this.Then(/^he should be able to edit the cardset title$/, function () {
navigation.setContent('#newSetName', title);
navigation.setContent('#setName', title);
});
this.Then(/^he should be able to edit the cardset description$/, function () {
navigation.setContent('#newSetDescription', description);
navigation.setContent('#setDescription', description);
});
this.Then(/^he should be able to edit the module name$/, function () {
navigation.setContent('#newSetModule', module);
navigation.setContent('#setModule', module);
});
this.Then(/^he should be able to edit the module initials$/, function () {
navigation.setContent('#newSetModuleShort', moduleInitials);
navigation.setContent('#setModuleShort', moduleInitials);
});
this.Then(/^he should be able to edit the module ID$/, function () {
navigation.setContent('#newSetModuleNum', moduleID);
navigation.setContent('#setModuleNum', moduleID);
});
this.Then(/^he should be able to choose a college$/, function () {
navigation.clickElement('#newSetCollege');
navigation.clickElement('#setCollege');
navigation.clickElement('li[data="' + college + '"] a');
});
this.Then(/^he should be able to choose a course$/, function () {
navigation.clickElement('#newSetCourse');
navigation.clickElement('#setCourse');
navigation.clickElement('li[data="' + course + '"] a');
});
this.Then(/^he should push the create new cardset button$/, function () {
navigation.clickElement('.save');
navigation.clickElement('#cardSetSave');
});
this.Then(/^he should select the created cardset$/, function () {
......@@ -68,13 +68,13 @@ module.exports = function () {
this.Then(/^he should see the details of that cardset with the correct values$/, function () {
navigation.clickElement('#editCardset');
navigation.compareContent('#editSetName', title, 2, 'value');
navigation.compareContent('#editSetDescription', description, 2, 'value');
navigation.compareContent('#editSetModule', module, 2, 'value');
navigation.compareContent('#editSetModuleShort', moduleInitials, 2, 'value');
navigation.compareContent('#editSetModuleNum', moduleID, 2, 'value');
navigation.compareContent('#setName', title, 2, 'value');
navigation.compareContent('#setDescription', description, 2, 'value');
navigation.compareContent('#setModule', module, 2, 'value');
navigation.compareContent('#setModuleShort', moduleInitials, 2, 'value');
navigation.compareContent('#setModuleNum', moduleID, 2, 'value');
navigation.clickElement('#cardSetCancel');
navigation.contentVisible('#editSetName', false);
navigation.contentVisible('#setName', false);
navigation.logout();
});
};
......@@ -23,7 +23,7 @@ module.exports = function () {
navigation.clickElement('#editCardset');
});
this.Then(/^he should see the edit cardset form$/, function () {
navigation.contentVisible('#editSetName');
navigation.contentVisible('#setName');
});
this.Then(/^he should be able to press the delete cardset button$/, function () {
navigation.clickElement('#cardSetDelete');
......
......@@ -33,38 +33,38 @@ module.exports = function () {
});
this.Then(/^he should see the edit cardset form$/, function () {
navigation.contentVisible('#editSetName');
navigation.contentVisible('#setName');
});
this.Then(/^he should be able to edit the cardset title$/, function () {
navigation.setContent('#editSetName', title);
navigation.compareContent('#editSetName', title, 2, 'value');
navigation.setContent('#setName', title);
navigation.compareContent('#setName', title, 2, 'value');
});
this.Then(/^he should be able to edit the cardset description$/, function () {
navigation.setContent('#editSetDescription', description);
navigation.compareContent('#editSetDescription', description, 2, 'value');
navigation.setContent('#setDescription', description);
navigation.compareContent('#setDescription', description, 2, 'value');
});
this.Then(/^he should be able to edit the module name$/, function () {
navigation.setContent('#editSetModule', module);
navigation.compareContent('#editSetModule', module, 2, 'value');
navigation.setContent('#setModule', module);
navigation.compareContent('#setModule', module, 2, 'value');
});
this.Then(/^he should be able to edit the module initials$/, function () {
navigation.setContent('#editSetModuleShort', moduleInitials);
navigation.compareContent('#editSetModuleShort', moduleInitials, 2, 'value');
navigation.setContent('#setModuleShort', moduleInitials);
navigation.compareContent('#setModuleShort', moduleInitials, 2, 'value');
});
this.Then(/^he should be able to edit the module ID$/, function () {
navigation.setContent('#editSetModuleNum', moduleID);
navigation.compareContent('#editSetModuleNum', moduleID, 2, 'value');
navigation.setContent('#setModuleNum', moduleID);
navigation.compareContent('#setModuleNum', moduleID, 2, 'value');
});
this.Then(/^he should be able to edit the college$/, function () {
navigation.clickElement('#editSetCollege');
navigation.clickElement('#setCollege');
navigation.clickElement('li[data="' + college + '"] a');
});
this.Then(/^he should be able to edit the course$/, function () {
navigation.clickElement('#editSetCourse');
navigation.clickElement('#setCourse');
navigation.clickElement('li[data="' + course + '"] a');
});
this.Then(/^he should press the save deck of cards button$/, function () {
......@@ -73,11 +73,11 @@ module.exports = function () {
this.Then(/^he should see the details of that cardset with the correct values$/, function () {
navigation.contentVisible('.modal-open',false);
navigation.clickElement('#editCardset');
navigation.compareContent('#editSetName', title, 2, 'value');
navigation.compareContent('#editSetDescription', description, 2, 'value');
navigation.compareContent('#editSetModule', module, 2, 'value');
navigation.compareContent('#editSetModuleShort', moduleInitials, 2, 'value');
navigation.compareContent('#editSetModuleNum', moduleID, 2, 'value');
navigation.compareContent('#setName', title, 2, 'value');
navigation.compareContent('#setDescription', description, 2, 'value');
navigation.compareContent('#setModule', module, 2, 'value');
navigation.compareContent('#setModuleShort', moduleInitials, 2, 'value');
navigation.compareContent('#setModuleNum', moduleID, 2, 'value');
navigation.clickElement('#cardSetCancel');
navigation.logout();
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment