Commit 77d0cacf by Arturo Montejo Ráez

conflicts solved

parents 010a5c46 2f994ab3
......@@ -4,7 +4,7 @@
<item name="picto_default_background" type="color">#CCFFFFFF</item>
<item name="picto_border" type="color">#AA000000</item>
<item name="blue" type="color">#FF33B5E5</item>
<item name="blue" type="color">#33b5e5</item>
<item name="purple" type="color">#FFAA66CC</item>
<item name="green" type="color">#FF99CC00</item>
<item name="orange" type="color">#FFFFBB33</item>
......@@ -13,7 +13,7 @@
<item name="darkpurple" type="color">#FF9933CC</item>
<item name="darkgreen" type="color">#FF669900</item>
<item name="darkorange" type="color">#FFFF8800</item>
<item name="darkred" type="color">#FFCC0000</item>
<item name="darkred" type="color">#cc0000</item>
<integer-array name="androidcolors">
<item>@color/blue</item>
......@@ -27,4 +27,4 @@
<item>@color/darkorange</item>
<item>@color/darkred</item>
</integer-array>
</resources>
\ No newline at end of file
</resources>
......@@ -3,12 +3,15 @@ package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R;
......@@ -52,7 +55,8 @@ public class SerialActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_serial);
//Initial keyboard hide
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
final EditText mSerialViewMail = (EditText) findViewById(R.id.serialmail);
final EditText mSerialViewPass = (EditText) findViewById(R.id.serialpass);
......@@ -65,6 +69,29 @@ public class SerialActivity extends Activity {
mSerialViewMail.setText(username);
mSerialViewPass.setText(password);
final LinearLayout stuList = (LinearLayout) findViewById(R.id.stuLay);
final LinearLayout supList = (LinearLayout) findViewById(R.id.supLay);
mSerialViewMail.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view,boolean hasFocus) {
if(hasFocus){
stuList.setVisibility(View.INVISIBLE);
supList.setVisibility(View.INVISIBLE);
}
}
});
mSerialViewPass.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view,boolean hasFocus) {
if(hasFocus){
stuList.setVisibility(View.INVISIBLE);
supList.setVisibility(View.INVISIBLE);
}
}
});
// Escribo el último valor indicado de username
......
......@@ -10,17 +10,15 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".gui.SerialActivity">
<EditText
android:id="@+id/serialmail"
android:layout_width="400px"
android:layout_height="wrap_content"
android:hint="@string/prompt_serial_mail"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:layout_alignParentTop="true" />
<ImageView
android:layout_width="200px"
android:layout_height="120px"
android:layout_marginLeft="30px"
android:orientation="horizontal"
android:src="@drawable/pictogram_logo"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/serialmail" />
<EditText
android:id="@+id/serialpass"
......@@ -34,28 +32,91 @@
android:maxLines="1"
android:singleLine="true"
android:layout_below="@+id/serialmail"
/>
android:layout_toStartOf="@+id/imageView" />
<Button
android:id="@+id/entrar_button" style="?android:textAppearanceSmall"
android:layout_width="400px"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginTop="11dp"
android:text="@string/action_entrar"
android:textStyle="bold"
android:layout_below="@+id/serialpass"/>
android:layout_below="@+id/serialpass"
android:layout_alignStart="@+id/serialpass" />
<ImageView
android:layout_width="200px"
android:layout_height="120px"
android:layout_marginLeft="30px"
android:orientation="horizontal"
android:src="@drawable/pictogram_logo"
android:layout_centerHorizontal="true"
android:id="@+id/imageView"
android:layout_toRightOf="@+id/serialmail"
android:layout_alignParentTop="true"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray"
android:layout_below="@+id/entrar_button"
android:layout_alignParentEnd="true"
android:layout_marginEnd="18dp" />
<EditText
android:id="@+id/serialmail"
android:layout_width="400px"
android:layout_height="wrap_content"
android:hint="@string/prompt_serial_mail"
android:imeActionId="@+id/login"
android:imeOptions="actionUnspecified"
android:inputType="text"
android:maxLines="1"
android:layout_marginStart="212dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<LinearLayout
android:orientation="vertical"
android:background="@color/blue"
android:layout_height="350px"
android:layout_width="400px"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/entrar_button"
android:layout_marginStart="270dp"
android:id="@+id/supLay">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/labelSup"
tools:text="Supervisores"
android:text="@string/supervisores"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textAlignment="center"
android:textSize="18sp" />
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/supList" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_height="350px"
android:layout_marginStart="67dp"
android:background="@color/darkred"
android:layout_width="400px"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:id="@+id/stuLay">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/labelStu"
tools:text="Alumnos"
android:text="@string/alumnos"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textAlignment="center"
android:textSize="18sp" />
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/stuList" />
</LinearLayout>
</RelativeLayout>
......
<resources>
<string name="app_name">com.yottacode.pictogram.Tablet</string>
<string name="alumnos">Alumnos</string>
<string name="supervisores">Supervisores</string>
<item name="maxInTape" type="integer">8</item>
<item name="maxInTape_big" type="integer">6</item>
</resources>
<<<<<<< HEAD
/* global Student, PictoCore, VStuLastInstruction, StuPicto, StuSup, sailsTokenAuth, sails,
Picto */
......@@ -931,6 +932,30 @@ module.exports = {
});
},
// update action
// update picto atributes for a studentPicto
//
update_legend: function (req, res) {
var params = req.allParams();
var query='update stu_picto'+
' set attributes=json_set(attributes, \'$.legend\',\''+params.legend_value+'\')'+
' where id_stu='+params.id_stu;
console.log('Updating legend for student ' + params.id_stu +" collection to "+
params.legend_value+": "+query);
StuPicto.query(query, function(err, result) {
if (err)
throw new Error ("error on update");
else {
console.log('Updated attributes for picto student:' + params.id_stu);
return res.ok({
id: params.id_stu,
legend_value: params.legend_value, // picto attributes for student
});
}
});
},
/**
* Updates the student profile image
* @param {request} req
......
......@@ -26,6 +26,7 @@
"alert": "Alert",
"all": "All",
"animation": "Animation",
"apply":"Apply",
"annual": "Annual",
"April": "April",
"attributes_not_updated": "Changes not saved",
......@@ -129,6 +130,10 @@
"large_picto": "Large pictograms",
"last_session": "Last session",
"legend": "Legend",
"legend_apply_all":"Apply to all pictograms",
"legend_none":"No legend",
"legend_normal":"Normal legend",
"legend_full":"Only legend",
"legend_size": "Legend size",
"licenses": "Licenses",
"license_already_activated": "License already activated",
......
......@@ -26,6 +26,7 @@
"alert": "Alerta",
"all": "Todos",
"animation": "Animación",
"apply":"Aplicar",
"annual": "Anual",
"April": "Abril",
"attributes_not_updated": "Cambios no guardados",
......@@ -129,6 +130,10 @@
"large_picto": "Pictograms grandes",
"last_session": "Última sesión",
"legend": "Leyenda",
"legend_none":"Sin leyenda",
"legend_normal":"Leyenda normal",
"legend_full":"Sólo leyenda",
"legend_apply_all":"Aplicar a todos los pictogramas",
"legend_size": "Tamaño de la leyenda",
"licenses": "Licencias",
"licenses_left": "{{number}} licencias disponibles",
......
......@@ -3,7 +3,7 @@
// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.
dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInstance, $http, config, studentPicto, sup, stu) {
dashboardControllers.controller('PictoConfigCtrl', function ($window, $scope, $modalInstance, $http, config, studentPicto, sup, stu) {
// Last parameter passed from collections.js
// Basic data passed from the main window
......@@ -34,7 +34,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console.log("Expression changed: " + JSON.stringify(data)+": "+$scope.studentPicto.expression.text);
$scope.studentPicto.attributes.expression=$scope.studentPicto.expression.text;
// Close the modal instance
$modalInstance.close($scope.studentPicto.expression.text);
//$modalInstance.close($scope.studentPicto.expression.text);
// Notifcar cambio
io.socket.post('/stu/vocabulary', {
......@@ -70,7 +70,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console.log("Properties updated");
// Close the modal instance
$modalInstance.close($scope.expression);
//$modalInstance.close($scope.expression);
// /////////////////////////////////////////////////////////////
// Websocket: Emit vocabulary update action
......@@ -92,6 +92,21 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
});
};
$scope.update_legend = function(){
console.log("Legend: " + $scope.studentPicto.attributes.legend+" to be modified");
$http
.put(config.backend+'/stu/'+ $scope.stu.id + '/legend/' + $scope.studentPicto.attributes.legend)
.success(function(data, status, headers, config) {
console.log("Legend updated");
// Close the modal instance
$modalInstance.close($scope.expression);
$window.location.reload();
});
};
$scope.close = function () {
// Lo que se devuelve a collection
$modalInstance.dismiss('cancel');
......
......@@ -23,6 +23,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
input: false
});
$scope.supsForm = {};
/**
* Updates the student picture
* @param {Angular file array} $files Image to be uploaded
......@@ -151,8 +153,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
* The email used for search is fetched from $scope.email_sup.
*/
$scope.search_sup = function () {
console.log("--> " + $scope.supsForm.email_sup);
// Find tutor by email
$http.get(config.backend + '/sup/email/' + $scope.email_sup)
$http.get(config.backend + '/sup/email/' + $scope.supsForm.email_sup)
.success(function (data) {
if (data) {
$scope.supToAdd = data;
......@@ -188,7 +191,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Add to the list of tutors in view
$scope.studentSupervisors.push($scope.supToAdd);
// Delete the email form field
$scope.email_sup = '';
$scope.supsForm.email_sup = '';
// Hide the message of supervisor founded
$scope.showmessagesupfound = false;
})
......@@ -229,7 +232,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Search tutor by email
$scope.search_tutor = function () {
// Find tutor by email
$http.get(config.backend + '/sup/email/' + $scope.email_tutor)
$http.get(config.backend + '/sup/email/' + $scope.supsForm.email_tutor)
.success(function (data) {
// If it found the length is > 0
if (data) {
......@@ -267,7 +270,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
// Add to the list of tutors in view
$scope.studentTutors.push($scope.tutorToAdd);
// Delete the email form field
$scope.email_tutor = '';
$scope.supsForm.email_tutor = '';
// Hide the message of tutor founded
$scope.showmessagetutorfound = false;
......
......@@ -50,24 +50,24 @@
</select>
</div> -->
<input type="radio" ng-model="studentPicto.attributes.legend" value="none" ng-change="update_properties()">
Sin leyenda
<span translate>legend_none</span>
<br/>
<input type="radio" ng-model="studentPicto.attributes.legend" value="normal" ng-change="update_properties()">
Leyenda normal
<span translate>legend_normal</span>
<br/>
<input type="radio" ng-model="studentPicto.attributes.legend" value="full" ng-change="update_properties()">
Solo leyenda
<span translate>legend_full</span>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<input type="checkbox">
Aplicar a todos los pictogramas
<div class="col-md-8">
<input type="checkbox" ng-model="update_all_legend" ng-init="update_all_legend=false">
<span translate>legend_apply_all</span>
</div>
<div class="col-md-6">
<div class="col-md-4">
<div class="form-group text-center">
<button type="submit" class="btn btn-primary ng-scope" ng-click="">Aplicar</button>
<button type="submit" class="btn btn-primary ng-scope" ng-click="update_all_legend ? update_legend() : close()" translate>apply</button>
</div>
</div>
</div>
......
......@@ -357,7 +357,7 @@
<p>
<form role="search" ng-submit="search_sup()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_sup_email' | translate }}" name="email_sup" id="email_sup" ng-model="email_sup" required>
<input type="email" class="form-control" placeholder="{{ 'search_sup_email' | translate }}" name="email_sup" id="email_sup" ng-model="supsForm.email_sup" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
......@@ -397,7 +397,7 @@
<p>
<form role="search" ng-submit="search_tutor()">
<div class="input-group">
<input type="email" class="form-control" placeholder="{{ 'search_tutor_email' | translate }}" name="email_tutor" id="email_tutor" ng-model="email_tutor" required>
<input type="email" class="form-control" placeholder="{{ 'search_tutor_email' | translate }}" name="email_tutor" id="email_tutor" ng-model="supsForm.email_tutor" required>
<div class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
......
......@@ -96,6 +96,7 @@ module.exports.policies = {
ws: ['tokenAuth'],
update: ['tokenAuth'],
update_picto: ['tokenAuth', 'isSupervisorOfStudent'],
update_legend: ['tokenAuth'],
login: true,
create: ['tokenAuth'],
upload: ['tokenAuth'],
......
......@@ -81,6 +81,7 @@ module.exports.routes = {
'GET /stu/:id_stu/ws': 'StudentController.ws',
'PUT /stu/:id_stu': 'StudentController.update',
'PUT /stu/:id_stu/picto/:id_stuPicto': 'StudentController.update_picto',
'PUT /stu/:id_stu/legend/:legend_value': 'StudentController.update_legend',
'PUT /stu/:id_stu/picto': 'StudentController.update_picto',
'POST /stu/login': 'StudentController.login',
'POST /stu': 'StudentController.create',
......
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