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 @@
<item name="darkpurple" type="color">#FF9933CC</item>
<item name="darkgreen" type="color">#669900</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>
......
......@@ -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>
......
......@@ -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');
......
......@@ -62,12 +62,12 @@
<hr>
<div class="row">
<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>
</div>
<div class="col-md-4">
<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>
......
......@@ -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