Commit 5413736a by Fernando Martínez Santiago

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

parents 6b6c2ff8 51c69a8d
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<item name="darkpurple" type="color">#FF9933CC</item> <item name="darkpurple" type="color">#FF9933CC</item>
<item name="darkgreen" type="color">#669900</item> <item name="darkgreen" type="color">#669900</item>
<item name="darkorange" type="color">#FFFF8800</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"> <integer-array name="androidcolors">
<item>@color/blue</item> <item>@color/blue</item>
......
...@@ -3,12 +3,15 @@ package com.yottacode.pictogram.tabletlibrary.gui; ...@@ -3,12 +3,15 @@ package com.yottacode.pictogram.tabletlibrary.gui;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.Window; import android.view.Window;
import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout;
import com.yottacode.pictogram.dao.UserLogin; import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
...@@ -52,7 +55,8 @@ public class SerialActivity extends Activity { ...@@ -52,7 +55,8 @@ public class SerialActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_serial); 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 mSerialViewMail = (EditText) findViewById(R.id.serialmail);
final EditText mSerialViewPass = (EditText) findViewById(R.id.serialpass); final EditText mSerialViewPass = (EditText) findViewById(R.id.serialpass);
...@@ -65,6 +69,29 @@ public class SerialActivity extends Activity { ...@@ -65,6 +69,29 @@ public class SerialActivity extends Activity {
mSerialViewMail.setText(username); mSerialViewMail.setText(username);
mSerialViewPass.setText(password); 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 // Escribo el último valor indicado de username
......
...@@ -10,17 +10,15 @@ ...@@ -10,17 +10,15 @@
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".gui.SerialActivity"> tools:context=".gui.SerialActivity">
<EditText <ImageView
android:id="@+id/serialmail" android:layout_width="200px"
android:layout_width="400px" android:layout_height="120px"
android:layout_height="wrap_content" android:layout_marginLeft="30px"
android:hint="@string/prompt_serial_mail" android:orientation="horizontal"
android:imeActionId="@+id/login" android:src="@drawable/pictogram_logo"
android:imeOptions="actionUnspecified" android:id="@+id/imageView"
android:inputType="text" android:layout_alignParentTop="true"
android:maxLines="1" android:layout_toEndOf="@+id/serialmail" />
android:singleLine="true"
android:layout_alignParentTop="true" />
<EditText <EditText
android:id="@+id/serialpass" android:id="@+id/serialpass"
...@@ -34,28 +32,91 @@ ...@@ -34,28 +32,91 @@
android:maxLines="1" android:maxLines="1"
android:singleLine="true" android:singleLine="true"
android:layout_below="@+id/serialmail" android:layout_below="@+id/serialmail"
/> android:layout_toStartOf="@+id/imageView" />
<Button <Button
android:id="@+id/entrar_button" style="?android:textAppearanceSmall" android:id="@+id/entrar_button" style="?android:textAppearanceSmall"
android:layout_width="400px" android:layout_width="400px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="11dp"
android:text="@string/action_entrar" android:text="@string/action_entrar"
android:textStyle="bold" android:textStyle="bold"
android:layout_below="@+id/serialpass"/> android:layout_below="@+id/serialpass"
android:layout_alignStart="@+id/serialpass" />
<ImageView <View
android:layout_width="200px" android:layout_width="match_parent"
android:layout_height="120px" android:layout_height="1dp"
android:layout_marginLeft="30px" android:background="@android:color/darker_gray"
android:orientation="horizontal" android:layout_below="@+id/entrar_button"
android:src="@drawable/pictogram_logo" android:layout_alignParentEnd="true"
android:layout_centerHorizontal="true" android:layout_marginEnd="18dp" />
android:id="@+id/imageView"
android:layout_toRightOf="@+id/serialmail" <EditText
android:layout_alignParentTop="true"/> 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> </RelativeLayout>
......
<resources> <resources>
<string name="app_name">com.yottacode.pictogram.Tablet</string> <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" type="integer">8</item>
<item name="maxInTape_big" type="integer">6</item> <item name="maxInTape_big" type="integer">6</item>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Please note that $modalInstance represents a modal window (instance) dependency. // Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above. // 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 // Last parameter passed from collections.js
// Basic data passed from the main window // Basic data passed from the main window
...@@ -34,7 +34,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -34,7 +34,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console.log("Expression changed: " + JSON.stringify(data)+": "+$scope.studentPicto.expression.text); console.log("Expression changed: " + JSON.stringify(data)+": "+$scope.studentPicto.expression.text);
$scope.studentPicto.attributes.expression=$scope.studentPicto.expression.text; $scope.studentPicto.attributes.expression=$scope.studentPicto.expression.text;
// Close the modal instance // Close the modal instance
$modalInstance.close($scope.studentPicto.expression.text); //$modalInstance.close($scope.studentPicto.expression.text);
// Notifcar cambio // Notifcar cambio
io.socket.post('/stu/vocabulary', { io.socket.post('/stu/vocabulary', {
...@@ -70,7 +70,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -70,7 +70,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console.log("Properties updated"); console.log("Properties updated");
// Close the modal instance // Close the modal instance
$modalInstance.close($scope.expression); //$modalInstance.close($scope.expression);
// ///////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////
// Websocket: Emit vocabulary update action // Websocket: Emit vocabulary update action
...@@ -92,6 +92,21 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -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 () { $scope.close = function () {
// Lo que se devuelve a collection // Lo que se devuelve a collection
$modalInstance.dismiss('cancel'); $modalInstance.dismiss('cancel');
......
...@@ -62,12 +62,12 @@ ...@@ -62,12 +62,12 @@
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<input type="checkbox"> <input type="checkbox" ng-model="update_all_legend" ng-init="update_all_legend=false">
<span translate>legend_apply_all</span> <span translate>legend_apply_all</span>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group text-center"> <div class="form-group text-center">
<button type="submit" class="btn btn-primary ng-scope" ng-click="" disabled translate>apply</button> <button type="submit" class="btn btn-primary ng-scope" ng-click="update_all_legend ? update_legend() : close()" translate>apply</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -96,6 +96,7 @@ module.exports.policies = { ...@@ -96,6 +96,7 @@ module.exports.policies = {
ws: ['tokenAuth'], ws: ['tokenAuth'],
update: ['tokenAuth'], update: ['tokenAuth'],
update_picto: ['tokenAuth', 'isSupervisorOfStudent'], update_picto: ['tokenAuth', 'isSupervisorOfStudent'],
update_legend: ['tokenAuth'],
login: true, login: true,
create: ['tokenAuth'], create: ['tokenAuth'],
upload: ['tokenAuth'], upload: ['tokenAuth'],
......
...@@ -81,6 +81,7 @@ module.exports.routes = { ...@@ -81,6 +81,7 @@ module.exports.routes = {
'GET /stu/:id_stu/ws': 'StudentController.ws', 'GET /stu/:id_stu/ws': 'StudentController.ws',
'PUT /stu/:id_stu': 'StudentController.update', 'PUT /stu/:id_stu': 'StudentController.update',
'PUT /stu/:id_stu/picto/:id_stuPicto': 'StudentController.update_picto', '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', 'PUT /stu/:id_stu/picto': 'StudentController.update_picto',
'POST /stu/login': 'StudentController.login', 'POST /stu/login': 'StudentController.login',
'POST /stu': 'StudentController.create', '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