Commit f66bd8cf by Arturo Montejo Ráez

Merge branch 'develop' of http://scm.ujaen.es/softuno/pictogram into develop

parents 433bb8b7 8c98dde6
......@@ -46,6 +46,10 @@ sails/upload.zip
.idea
android/Pictogram/.idea
android/Pictogram/commonlibrary/commonlibrary.iml
android/Pictogram/commonlibrary/local.properties
android/Pictogram/commonlibrary/gradle
android/Pictogram/commonlibrary/gradlew
android/Pictogram/commonlibrary/gradlew.bat
android/Pictogram/tablet/tablet.iml
android/Pictogram/watch/watch.iml
android/Pictogram/Pictogrammar.iml
......
......@@ -405,6 +405,11 @@ module.exports = {
var students = [];
async.each(stuSups,
function(stuSup, cb) {
// Filter logically deleted students
if (stuSup.student.office == null)
cb();
var student = stuSup.student;
student.supervision = req.token.office ? 2 : 1;
VStuLastInstruction.findOne({student: student.id})
......
......@@ -504,7 +504,6 @@ module.exports = {
if (err || !student)
throw err;
// set office to NULL to unlink it
student.office = null;
student.save(function(err, saved) {
if (err) return cb(err);
......
......@@ -250,6 +250,7 @@
"state_spontaneous": "Spontaneous",
"state_supervised": "Supervised",
"student_added": "Student added",
"student_already_exists": "A student with that username already exists, please try with another one",
"student_deleted": "Student deleted",
"student_not_added": "Student not added",
"student_not_deleted": "Student not deleted",
......
......@@ -251,6 +251,7 @@
"state_spontaneous": "Espontáneo",
"state_supervised": "Guiado",
"student_added": "Estudiante añadido",
"student_already_exists": "Ya existe un estudiante con ese nombre de usuario. Por favor, inténtelo de nuevo con algo diferente.",
"student_deleted": "Estudiante eliminado",
"student_not_added": "Estudiante no añadido",
"student_not_deleted": "No se ha podido eliminar el estudiante",
......
......@@ -37,6 +37,7 @@
popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......@@ -108,6 +109,7 @@
ng-repeat="studentPicto in studentPictoRow track by $index"
popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......@@ -167,6 +169,7 @@
popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......
......@@ -22,10 +22,11 @@
<input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password" />
<input style="display:none" type="password" name="fakepasswordremembered"/>
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password"/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm" />
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm"/>
</div>
<legend translate>personal_data</legend>
<div class="form-group">
......
......@@ -121,7 +121,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
// between the new element created and the form fields
$scope.resetForm();
// Show the add form to new adding
// Hide the add form to new adding
$scope.hidestudentadd = true;
// Update counters
......@@ -130,14 +130,17 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
})
.error(function (err) {
var errorMessage = 'student_not_added';
console.log(err);
if (typeof err == "string" && err.search("Maximum number of enrolments reached") > 0)
errorMessage = 'max_licenses_reached';
if (typeof err == "string" && err.search("already exists") > 0)
errorMessage = 'student_already_exists';
else if (err && err.status === 400)
errorMessage = 'invalid_fields';
ngToast.danger({ content: $translate.instant(errorMessage) });
$scope.hidestudentadd = true;
});
};
......
......@@ -42,6 +42,7 @@
<fieldset>
<legend translate>change_password</legend>
<div class="form-group">
<input style="display:none" type="password" name="fakepasswordremembered"/>
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formdata.password" />
</div>
<div class="form-group">
......
......@@ -11,8 +11,11 @@
<!-- Add Student button and Search row -->
<div class="row">
<div class="col-xs-3">
<button type="button" class="btn btn-success btn-circle btn-lg" ng-click="resetForm(); hidestudentadd = false" title="{{'add'|translate}}" ng-hide="!user.isSupAdmin || !num_licenses_left"><i class="glyphicon glyphicon-plus"></i></button>
<p class="text-left" ng-hide="!user.isSupAdmin || !num_licenses_left || !hidestudentadd">
<a ng-click="resetForm(); hidestudentadd = false" class="btn btn-success btn-sm" role="button">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{ 'add_student' | translate }}
</a>
</p>
</div>
<div class="col-xs-6 input-group">
<input type="text" ng-model="search_students" id="search_students" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
......@@ -33,7 +36,7 @@
</div>
</td>
<td>
<h4>{{student.name}} {{student.surname}}</h4>
<h4>{{student.surname}}, {{student.name}}</h4>
</td>
<td>
<p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p>
......
......@@ -451,6 +451,21 @@ textarea.editable{
.picto .picto_options .picto_minus{ position: absolute; top: 2px; right: 2px; }
/* Text above picto */
.picto-description {
position: absolute;
bottom: 0px;
text-align: center;
width: 100%;
background-color: rgba(1, 1, 1, 0.50);
color: white;
margin-left: -2px;
font-weight: 600;
text-transform: uppercase;
font-size: 12px;
word-wrap: break-word;
}
/* In addpicto */
#collections{
height: 400px;
......
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 sign in to comment