Commit e1bd1eff by Arturo Montejo Ráez

solving conflict in merge

parents 1b79b877 69feb3e7
Showing with 408 additions and 195 deletions
...@@ -46,6 +46,10 @@ sails/upload.zip ...@@ -46,6 +46,10 @@ sails/upload.zip
.idea .idea
android/Pictogram/.idea android/Pictogram/.idea
android/Pictogram/commonlibrary/commonlibrary.iml 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/tablet/tablet.iml
android/Pictogram/watch/watch.iml android/Pictogram/watch/watch.iml
android/Pictogram/Pictogrammar.iml android/Pictogram/Pictogrammar.iml
......
...@@ -11,9 +11,6 @@ android { ...@@ -11,9 +11,6 @@ android {
versionName "1.0" versionName "1.0"
resValue "string", "db_name", "PCB.db" resValue "string", "db_name", "PCB.db"
resValue "string", "core_vocabulary", "core_vocabulary" resValue "string", "core_vocabulary", "core_vocabulary"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
} }
buildTypes { buildTypes {
release { release {
......
...@@ -43,7 +43,7 @@ public class Picto extends Img { ...@@ -43,7 +43,7 @@ public class Picto extends Img {
static String INVISIBLE = "invisible"; static String INVISIBLE = "invisible";
} }
public final static int NO_CATEGORY=-1; public final static int NO_CATEGORY=-1;
public final static int ROW_UNCATEGORIZED_CONCEPTS=0; public final static int COL_UNCATEGORIZED_CONCEPTS=0;
...@@ -323,7 +323,7 @@ public class Picto extends Img { ...@@ -323,7 +323,7 @@ public class Picto extends Img {
*/ */
public boolean is_category() { public boolean is_category() {
return this.get_category()==Picto.NO_CATEGORY && return this.get_category()==Picto.NO_CATEGORY &&
this.get_column() != Picto.ROW_UNCATEGORIZED_CONCEPTS && this.get_row() != Picto.COL_UNCATEGORIZED_CONCEPTS &&
this.getFreeColumn() == -1 && this.getFreeColumn() == -1 &&
this.getFreeRow() == -1; this.getFreeRow() == -1;
} }
......
package com.yottacode.pictogram.dao; package com.yottacode.pictogram.dao;
import java.io.IOException;
import org.json.JSONObject;
import org.json.JSONException;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import com.yottacode.pictogram.tools.Img; import com.yottacode.pictogram.tools.Img;
import com.yottacode.pictogram.grammar.Vocabulary;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
/** /**
* A user of the PCB. A user can be an Student or a Supervisor using a student configuration * A user of the PCB. A user can be an Student or a Supervisor using a student configuration
...@@ -29,7 +28,7 @@ public class User { ...@@ -29,7 +28,7 @@ public class User {
static String CATEGORIES = "categories"; static String CATEGORIES = "categories";
static String INPUT_FEEDBACK = "input feedback"; static String INPUT_FEEDBACK = "input feedback";
static String INPUT_SELECTION = "input selection"; static String INPUT_SELECTION = "input selection";
static String PICTOGRAM_SIZE = "pictogram size"; static String PICTOGRAM_SIZE ="pictogram size";
static String TTS_ENGINE = "tts engine"; static String TTS_ENGINE = "tts engine";
static String TTS_VOICE = "tts voice"; static String TTS_VOICE = "tts voice";
} }
...@@ -38,6 +37,7 @@ public class User { ...@@ -38,6 +37,7 @@ public class User {
private JSONObject attributes_stu; private JSONObject attributes_stu;
private Img img_sup; private Img img_sup;
private String email_sup, pwd_sup, name_sup, surname_sup, gender_sup, lang_sup, tts_engine_sup; private String email_sup, pwd_sup, name_sup, surname_sup, gender_sup, lang_sup, tts_engine_sup;
private int max_columns,max_rows;
public User(int id_stu, String nickname_stu, String pwd_stu, String name_stu, String surname_stu, String url_img_stu, String gender_stu, String lang_stu, String attributes_stu) throws JSONException { public User(int id_stu, String nickname_stu, String pwd_stu, String name_stu, String surname_stu, String url_img_stu, String gender_stu, String lang_stu, String attributes_stu) throws JSONException {
...@@ -62,6 +62,7 @@ public class User { ...@@ -62,6 +62,7 @@ public class User {
this.gender_sup=gender_sup; this.gender_sup=gender_sup;
this.lang_sup=lang_sup; this.lang_sup=lang_sup;
this.tts_engine_sup=tts_engine_sup; this.tts_engine_sup=tts_engine_sup;
} }
...@@ -259,18 +260,21 @@ public class User { ...@@ -259,18 +260,21 @@ public class User {
} }
} }
/** /**
* *
* @return pictogram size of the student configuration (default: "normal") * @return pictogram size of the student configuration (default: "normal")
*/ */
public String get_pictogram_size() { public boolean is_picto_size_big() {
try { try {
return this.attributes_stu.getString(JSON_STUDENT_ATTTRS.PICTOGRAM_SIZE); return !get_json_attr(JSON_STUDENT_ATTTRS.PICTOGRAM_SIZE).equals("normal");
} catch (JSONException e) { } catch (Exception e) {
return "normal"; return true;
} }
} }
public boolean is_supervisor() { public boolean is_supervisor() {
return get_id_sup()!=User.NO_SUPERVISOR; return get_id_sup()!=User.NO_SUPERVISOR;
} }
...@@ -288,4 +292,4 @@ public class User { ...@@ -288,4 +292,4 @@ public class User {
} }
\ No newline at end of file
...@@ -56,10 +56,11 @@ public final class PCBcontext { ...@@ -56,10 +56,11 @@ public final class PCBcontext {
*/ */
public static void set_user(User student, String token, iImgDownloaderListener listener) { public static void set_user(User student, String token, iImgDownloaderListener listener) {
if (!init) { if (!init) {
Log.i(PCBcontext.class.getCanonicalName(), "PCBcontext.init must be called once previously ");
throw new java.lang.AssertionError("init must be called once previously "); throw new java.lang.AssertionError("init must be called once previously ");
} }
Log.i(PCBcontext.class.getCanonicalName(), "User set at student " + student.get_name_stu()); Log.e(PCBcontext.class.getCanonicalName(), "User set at student " + student.get_name_stu());
wrapper.setToken(token); wrapper.setToken(token);
pcbdb = new PCBDBHelper(null, 1, student); pcbdb = new PCBDBHelper(null, 1, student);
pcbdb.user_online(token!=null); pcbdb.user_online(token!=null);
...@@ -70,6 +71,7 @@ public final class PCBcontext { ...@@ -70,6 +71,7 @@ public final class PCBcontext {
} }
public static void unset_user() { public static void unset_user() {
Log.i(PCBcontext.class.getCanonicalName(), "User unset. Student " + getPcbdb().getCurrentUser().get_name_stu());
pcbdb = null; pcbdb = null;
if (room!=null) room.exit(); if (room!=null) room.exit();
room = null; room = null;
......
...@@ -51,8 +51,6 @@ ...@@ -51,8 +51,6 @@
<string name="nogrammar">Advertencia: Lenguaje no soportado</string> <string name="nogrammar">Advertencia: Lenguaje no soportado</string>
<string name="pictogrammar">SUpO_PICTOES</string> <string name="pictogrammar">SUpO_PICTOES</string>
<item type="integer" name="maxInTape">8</item>
<!--Upload local img --> <!--Upload local img -->
<string name="enterImgLabel">Introduzca etiqueta de la imagen</string> <string name="enterImgLabel">Introduzca etiqueta de la imagen</string>
<string name="notNewCats">No puede añadir nuevas categorias</string> <string name="notNewCats">No puede añadir nuevas categorias</string>
......
...@@ -10,4 +10,7 @@ ...@@ -10,4 +10,7 @@
<dimen name="picto_normal_height">75dp</dimen> <dimen name="picto_normal_height">75dp</dimen>
<dimen name="picto_normal_width">75dp</dimen> <dimen name="picto_normal_width">75dp</dimen>
<dimen name="tape_normal_height">90dp</dimen> <dimen name="tape_normal_height">90dp</dimen>
<dimen name="picto_big_height">90dp</dimen>
<dimen name="picto_big_width">90dp</dimen>
<dimen name="tape_big_height">110dp</dimen>
</resources> </resources>
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
<string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string> <string name="upload_error">No pudo subirse al servidor. Se intentará más adelante</string>
<string name="upload_ok">Se subió correctamente al servidor</string> <string name="upload_ok">Se subió correctamente al servidor</string>
<item name="maxInTape" type="integer">8</item>
<string name="title_activity_img_label">img_label</string> <string name="title_activity_img_label">img_label</string>
<!-- Strings related to login --> <!-- Strings related to login -->
......
...@@ -57,15 +57,16 @@ ...@@ -57,15 +57,16 @@
/> />
<TextView <TextView
android:text="SUPERVISOR" android:text="SUPERVISOR"
android:textStyle="bold"
android:textColor="@color/green" android:textColor="@color/green"
android:layout_width="200px" android:layout_width="wrap_content"
android:layout_height="50px" android:layout_height="wrap_content"
android:layout_marginLeft="20px"
android:orientation="horizontal" android:orientation="horizontal"
android:id="@+id/textView3" android:id="@+id/text_supervisor"
android:textAppearance="@style/TextAppearance.AppCompat"
android:layout_below="@+id/imageView" android:layout_below="@+id/imageView"
android:layout_alignStart="@+id/imageView" /> android:layout_toEndOf="@+id/serialmail"
android:layout_marginLeft="60px"
/>
</RelativeLayout> </RelativeLayout>
......
...@@ -9,6 +9,10 @@ android { ...@@ -9,6 +9,10 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity" resValue "string","SerialClass","com.yottacode.pictogram.tabletlibrary.gui.SerialActivity"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
resValue "integer", "rows_big", "4"
resValue "integer", "columns_big", "8"
} }
buildTypes { buildTypes {
release { release {
......
...@@ -10,8 +10,6 @@ import android.view.Window; ...@@ -10,8 +10,6 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext; import com.yottacode.pictogram.tools.PCBcontext;
public class MainActivity extends Activity { public class MainActivity extends Activity {
...@@ -27,9 +25,6 @@ public class MainActivity extends Activity { ...@@ -27,9 +25,6 @@ public class MainActivity extends Activity {
// For deactivating the lock screen (just before setContentView) // For deactivating the lock screen (just before setContentView)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
PCBcontext.init(this, new NetServiceTablet());
Class serialClass; Class serialClass;
try { try {
serialClass=Class.forName(getString(R.string.SerialClass)); serialClass=Class.forName(getString(R.string.SerialClass));
......
...@@ -19,17 +19,29 @@ import java.io.IOException; ...@@ -19,17 +19,29 @@ import java.io.IOException;
*/ */
public class PictoItemViewGenerator { public class PictoItemViewGenerator {
public static final int LAYOUT = R.layout.picto_grid_item; public static final int LAYOUT = R.layout.picto_grid_item;
public static final int LAYOUT_BIG = R.layout.picto_grid_item_big;
public static View getPictoView(Picto picto, View convertView, ViewGroup parent) { public static View getPictoView(Picto picto, View convertView, ViewGroup parent) {
if (convertView == null) { if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(LAYOUT, parent, false); convertView = LayoutInflater.from(parent.getContext()).inflate(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? LAYOUT_BIG : LAYOUT, parent, false);
} }
RelativeLayout layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper); RelativeLayout layoutWrapper ;
FrameLayout layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout); FrameLayout layout ;
ImageView pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image); ImageView pictoImage ;
ImageView redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross); ImageView redCrossImage ;
if (PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big()) {
layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper_big);
layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout_big);
pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image_big);
redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross_big);
} else
{
layoutWrapper = (RelativeLayout) convertView.findViewById(R.id.picto_grid_item_layout_wrapper);
layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout);
pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image);
redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross);
}
layoutWrapper.setVisibility(View.GONE); layoutWrapper.setVisibility(View.GONE);
layoutWrapper.setBackground(null); layoutWrapper.setBackground(null);
layoutWrapper.setAlpha(0.25f); layoutWrapper.setAlpha(0.25f);
......
...@@ -93,12 +93,25 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -93,12 +93,25 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// Button used for showing the picto category view // Button used for showing the picto category view
ImageButton showPictoCategoriesViewButton; ImageButton showPictoCategoriesViewButton;
int maxColumns,maxRows,maxInTape;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big()) {
maxColumns= getResources().getInteger(R.integer.columns_big);
maxRows= getResources().getInteger(R.integer.rows_big);
maxInTape = getResources().getInteger(R.integer.maxInTape_big);
} else {
maxColumns= getResources().getInteger(R.integer.columns);
maxRows= getResources().getInteger(R.integer.rows);
maxInTape = getResources().getInteger(R.integer.maxInTape);
}
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_pictogram); setContentView(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? R.layout.activity_pictogram_big : R.layout.activity_pictogram);
this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout); this.mainLayout = (RelativeLayout) findViewById(R.id.pictogramLayout);
this.currentCategory = null; this.currentCategory = null;
...@@ -143,21 +156,24 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -143,21 +156,24 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
this.pictoCategoryGridView = (GridView) this.findViewById(R.id.picto_category_grid_view); this.pictoCategoryGridView = (GridView) this.findViewById(R.id.picto_category_grid_view);
this.pictoCategoryGridView.setAdapter(this.pictoCategoryGridAdapter); this.pictoCategoryGridView.setAdapter(this.pictoCategoryGridAdapter);
// @TODO take this value from user configuration (0: normal, 1: large) this.pictoMainGridView.setNumColumns(this.maxColumns);
int pictogramSize = 0; this.pictoCategoryGridView.setNumColumns(this.maxColumns);
if (pictogramSize == 0) {
this.pictoMainGridView.setNumColumns(10);
this.pictoCategoryGridView.setNumColumns(10);
} else if (pictogramSize == 1) {
this.pictoMainGridView.setNumColumns(4);
this.pictoCategoryGridView.setNumColumns(4);
}
// tts = new TextToSpeech(this, this, "IVONA Text-to-Speech HQ"); // tts = new TextToSpeech(this, this, "IVONA Text-to-Speech HQ");
tts = new TextToSpeech(this, this); tts = new TextToSpeech(this, this);
tts.setOnUtteranceProgressListener(new OnTTSEndListener()); tts.setOnUtteranceProgressListener(new OnTTSEndListener());
this.tapeGridView.setOnDragListener(new OnPictoDragListener()); this.tapeGridView.setOnDragListener(new OnPictoDragListener());
this.tapeGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.i(this.getClass().getCanonicalName()," Delete item "+position+"("+PictogramActivity.this.tapeAdapter.getItem(position).get_translation()+")");
PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, PictogramActivity.this.tapeAdapter.getItem(position)));
PictogramActivity.this.tapeAdapter.deleteItem(position);
PictogramActivity.this.tapeAdapter.notifyDataSetChanged();
}
});
this.pictoMainGridView.setOnDragListener(new OnPictoDragListener()); this.pictoMainGridView.setOnDragListener(new OnPictoDragListener());
this.pictoCategoryGridView.setOnDragListener(new OnPictoDragListener()); this.pictoCategoryGridView.setOnDragListener(new OnPictoDragListener());
...@@ -315,9 +331,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -315,9 +331,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// This is to show the pictos ordered in the 2D Array that represents the panel // This is to show the pictos ordered in the 2D Array that represents the panel
int rows = getResources().getInteger(R.integer.rows); Picto[][] mp = new Picto[maxRows][maxColumns];
int cols = getResources().getInteger(R.integer.columns);
Picto[][] mp = new Picto[rows][cols];
for (Picto p : list) { for (Picto p : list) {
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
...@@ -339,8 +353,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -339,8 +353,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
"{\"magnify\":false,\"highlight\":false,\"coord_y\":1,\"id_cat\":12303,\"status\":\"invisible\",\"coord_x\":4}"); "{\"magnify\":false,\"highlight\":false,\"coord_y\":1,\"id_cat\":12303,\"status\":\"invisible\",\"coord_x\":4}");
*/ */
for(int i=0; i<rows; i++){ for(int i=0; i<maxRows; i++){
for(int j=0; j<cols; j++){ for(int j=0; j<maxColumns; j++){
if(mp[i][j] != null) ll.add(mp[i][j]); if(mp[i][j] != null) ll.add(mp[i][j]);
else ll.add(null); // Add the "blank picto" simulating an empty position else ll.add(null); // Add the "blank picto" simulating an empty position
} }
...@@ -596,7 +610,6 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -596,7 +610,6 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
//LinkedList<Picto> ll = vocabulary.next(p); //LinkedList<Picto> ll = vocabulary.next(p);
Log.d(LOG_TAG, "Lista de pictos recuperada: " + ll.toString()); Log.d(LOG_TAG, "Lista de pictos recuperada: " + ll.toString());
int maxInTape = getResources().getInteger(R.integer.maxInTape);
// If the picto is a category // If the picto is a category
if (p.is_category()) { if (p.is_category()) {
...@@ -604,7 +617,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -604,7 +617,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p)); PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p));
hidePictoMainGridView(); hidePictoMainGridView();
} else if (tapeAdapter.getCount() < maxInTape) { } else if (tapeAdapter.getCount() < PictogramActivity.this.maxInTape) {
currentCategory = null; currentCategory = null;
tapeAdapter.addItem(p); tapeAdapter.addItem(p);
tapeAdapter.notifyDataSetChanged(); tapeAdapter.notifyDataSetChanged();
...@@ -628,8 +641,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -628,8 +641,8 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria // No tengo pictograma. Abro una nueva ventana de selección desde el Carrete del device si no es categoria
if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) { if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
Log.d(LOG_TAG, "No tengo pictograma. Abro carrete..."); Log.d(LOG_TAG, "No tengo pictograma. Abro carrete...");
int cols = getResources().getInteger(R.integer.columns);
addPicto(position % cols, (int) (position / cols)); addPicto(position % maxColumns, (int) (position / maxColumns));
} }
else else
Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show(); Toast.makeText(PictogramActivity.this, PictogramActivity.this.getResources().getString(R.string.notNewCats), Toast.LENGTH_SHORT).show();
...@@ -649,7 +662,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -649,7 +662,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
if (p.get_id() != 0 && if (p.get_id() != 0 &&
!p.get_status().equalsIgnoreCase("invisible") && !p.get_status().equalsIgnoreCase("invisible") &&
!p.get_status().equalsIgnoreCase("disabled") && !p.get_status().equalsIgnoreCase("disabled") &&
tapeAdapter.getCount() < 8) { tapeAdapter.getCount() < PictogramActivity.this.maxInTape) {
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view); View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(data, //data to be dragged view.startDrag(data, //data to be dragged
......
...@@ -12,6 +12,8 @@ import android.widget.EditText; ...@@ -12,6 +12,8 @@ import android.widget.EditText;
import com.yottacode.pictogram.dao.UserLogin; import com.yottacode.pictogram.dao.UserLogin;
import com.yottacode.pictogram.tabletlibrary.R; import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
/** /**
...@@ -46,6 +48,7 @@ public class SerialActivity extends Activity { ...@@ -46,6 +48,7 @@ public class SerialActivity extends Activity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
PCBcontext.init(this, new NetServiceTablet());
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_serial); setContentView(R.layout.activity_serial);
......
...@@ -47,6 +47,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -47,6 +47,7 @@ public class StudentFragmentGrid extends Fragment{
final String TAG_LANG = "lang"; final String TAG_LANG = "lang";
final String TAG_ATTRIBUTES = "attributes"; final String TAG_ATTRIBUTES = "attributes";
final String TAG_SUPERVISION="supervision"; final String TAG_SUPERVISION="supervision";
ProgressDialog progressDialog;
Vector<Integer> idStudents; Vector<Integer> idStudents;
String nameStudents[]; String nameStudents[];
Vector<Bitmap> imageStudents; Vector<Bitmap> imageStudents;
...@@ -110,12 +111,12 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -110,12 +111,12 @@ public class StudentFragmentGrid extends Fragment{
PCBcontext.getDevice().insertUser(new_user); PCBcontext.getDevice().insertUser(new_user);
Log.i(this.getClass().getCanonicalName(),"Loading vocabulary for "+new_user.get_name_stu()); Log.i(this.getClass().getCanonicalName(),"Loading vocabulary for "+new_user.get_name_stu());
final ProgressDialog progressDialog=ProgressDialog.show(getActivity(), getString(R.string.loadingGrammar), progressDialog=ProgressDialog.show(getActivity(), getString(R.string.loadingGrammar),
getString(R.string.userLoadingTxt), false, false); getString(R.string.userLoadingTxt), false, false);
PCBcontext.set_user(new_user, intent.getStringExtra("token"), new iImgDownloaderListener() { PCBcontext.set_user(new_user, intent.getStringExtra("token"), new iImgDownloaderListener() {
@Override @Override
public void loadComplete() { public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss(); if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
Intent pictogramActivity = new Intent(getActivity(), PictogramActivity.class); Intent pictogramActivity = new Intent(getActivity(), PictogramActivity.class);
startActivity(pictogramActivity); startActivity(pictogramActivity);
} }
...@@ -160,12 +161,12 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -160,12 +161,12 @@ public class StudentFragmentGrid extends Fragment{
} }
} //for } //for
final ProgressDialog progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg), progressDialog= ProgressDialog.show(getActivity(), getString(R.string.imguserLoadingMsg),
getString(R.string.userLoadingTxt), false, false); getString(R.string.userLoadingTxt), false, false);
ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() { ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() {
@Override @Override
public void loadComplete() { public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss(); if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
if (downloaded_students.size() > 1) { if (downloaded_students.size() > 1) {
for (int i = 0; i < imgs.size(); i++) for (int i = 0; i < imgs.size(); i++)
try { try {
...@@ -200,7 +201,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -200,7 +201,7 @@ public class StudentFragmentGrid extends Fragment{
RestapiWrapper wrapper = new RestapiWrapper( RestapiWrapper wrapper = new RestapiWrapper(
getActivity().getApplicationContext().getResources().getString(R.string.server), token); getActivity().getApplicationContext().getResources().getString(R.string.server), token);
String operation = "sup/" + sup_id + "/students"; String operation = "sup/" + sup_id + "/students";
final ProgressDialog progressDialog= ProgressDialog.show(getActivity(), getString(R.string.userLoadingTxt), progressDialog= ProgressDialog.show(getActivity(), getString(R.string.userLoadingTxt),
getString(R.string.userLoadingTxt), false, false); getString(R.string.userLoadingTxt), false, false);
wrapper.ask(operation, new iRestapiListener() { wrapper.ask(operation, new iRestapiListener() {
@Override @Override
...@@ -219,7 +220,7 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -219,7 +220,7 @@ public class StudentFragmentGrid extends Fragment{
} }
@Override @Override
public void result(JSONArray students) { public void result(JSONArray students) {
if (progressDialog.isShowing()) progressDialog.dismiss(); if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
StudentFragmentGrid.this.downloaded_students=new Vector(); StudentFragmentGrid.this.downloaded_students=new Vector();
for (int i=0;i<students.length();i++) { for (int i=0;i<students.length();i++) {
JSONObject student; JSONObject student;
...@@ -308,4 +309,13 @@ public class StudentFragmentGrid extends Fragment{ ...@@ -308,4 +309,13 @@ public class StudentFragmentGrid extends Fragment{
return view; return view;
} }
@Override
public void onPause() {
super.onPause();
if ((progressDialog!= null) && progressDialog.isShowing())
progressDialog.dismiss();
progressDialog = null;
}
} }
...@@ -81,6 +81,8 @@ public class TapeAdapter extends BaseAdapter { ...@@ -81,6 +81,8 @@ public class TapeAdapter extends BaseAdapter {
return complete; return complete;
} }
// DEVUELVE último elemento // DEVUELVE último elemento
public Picto getLastItem(){ public Picto getLastItem(){
return pictoLinkedList.getLast(); return pictoLinkedList.getLast();
......
...@@ -11,40 +11,38 @@ ...@@ -11,40 +11,38 @@
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) --> <!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
<GridView
android:id="@+id/tape_grid_view"
android:layout_width="wrap_content"
android:layout_height="@dimen/tape_normal_height"
android:padding="@dimen/small_padding"
android:gravity="center"
android:numColumns="10"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="false"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:paddingRight="192dp"
android:horizontalSpacing="@dimen/picto_grid_spacing">
</GridView>
<ImageButton <ImageButton
android:layout_width="@dimen/picto_normal_width" android:layout_width="@dimen/picto_normal_width"
android:layout_height="@dimen/tape_normal_height" android:layout_height="@dimen/tape_normal_height"
android:src="@drawable/remove_picto_from_tape" android:src="@drawable/remove_picto_from_tape"
android:id="@+id/button_delete" android:id="@+id/button_delete"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/button_tts" android:layout_alignParentStart="true"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="16dp" android:paddingRight="16dp"
android:clickable="true" android:clickable="true"
android:background="@null" /> android:background="@android:color/holo_red_light" />
<GridView
android:id="@+id/tape_grid_view"
android:layout_toEndOf="@+id/button_delete"
android:layout_toStartOf="@+id/button_tts"
android:layout_width="@dimen/picto_normal_width"
android:layout_height="@dimen/tape_normal_height"
android:padding="@dimen/small_padding"
android:gravity="center"
android:numColumns="8"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="true"
android:horizontalSpacing="@dimen/picto_grid_spacing">
</GridView>
<ImageButton <ImageButton
android:layout_width="@dimen/picto_normal_width" android:layout_width="@dimen/picto_normal_width"
android:layout_height="@dimen/tape_normal_height" android:layout_height="@dimen/tape_normal_height"
android:src="@drawable/send_tape" android:src="@drawable/send_tape"
android:background="@null" android:background="@android:color/holo_red_light"
android:id="@+id/button_tts" android:id="@+id/button_tts"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
...@@ -88,7 +86,6 @@ ...@@ -88,7 +86,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_below="@+id/tape_grid_view" android:layout_below="@+id/tape_grid_view"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:numColumns="10"
android:gravity="center_vertical|center|center_horizontal" android:gravity="center_vertical|center|center_horizontal"
android:background="#DDDDDD" android:background="#DDDDDD"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="#BDBDBD"
android:keepScreenOn="true"
android:id="@+id/pictogramLayout"
tools:context="com.yottacode.pictogram.tabletlibrary.gui.PictogramActivity"
android:padding="@dimen/small_padding">
<!-- android:keepScreenOn - To keep the screen bright as long as the app is visible (also forever) -->
<ImageButton
android:layout_width="@dimen/picto_big_width"
android:layout_height="@dimen/tape_big_height"
android:src="@drawable/remove_picto_from_tape"
android:id="@+id/button_delete"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:clickable="true"
android:background="@android:color/holo_red_light" />
<GridView
android:id="@+id/tape_grid_view"
android:layout_toEndOf="@+id/button_delete"
android:layout_toStartOf="@+id/button_tts"
android:layout_width="@dimen/picto_big_width"
android:layout_height="@dimen/tape_big_height"
android:padding="@dimen/small_padding"
android:gravity="center"
android:numColumns="6"
android:accessibilityLiveRegion="none"
android:background="@android:color/holo_red_light"
android:clickable="true"
android:horizontalSpacing="@dimen/picto_grid_spacing">
</GridView>
<ImageButton
android:layout_width="@dimen/picto_big_width"
android:layout_height="@dimen/tape_big_height"
android:src="@drawable/send_tape"
android:background="@android:color/holo_red_light"
android:id="@+id/button_tts"
android:adjustViewBounds="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:clickable="true" />
<ImageButton
android:layout_width="96dp"
android:layout_height="match_parent"
android:id="@+id/showPictoCategoriesViewButton"
android:layout_alignParentStart="true"
android:src="@drawable/show_categories_grid"
android:background="#EEEEEE"
android:layout_below="@+id/tape_grid_view"
android:scaleType="fitCenter" />
<GridView
android:id="@+id/picto_category_grid_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_below="@+id/tape_grid_view"
android:layout_alignParentBottom="true"
android:numColumns="8"
android:gravity="center_vertical|center|center_horizontal"
android:background="#DDDDDD"
android:layout_alignParentEnd="true"
android:layout_toEndOf="@+id/showPictoCategoriesViewButton"
android:paddingLeft="@dimen/small_padding"
android:paddingTop="@dimen/small_padding"
android:paddingRight="@dimen/small_padding"
android:paddingBottom="@dimen/small_padding"
android:verticalSpacing="@dimen/picto_grid_spacing"
android:horizontalSpacing="@dimen/picto_grid_spacing">
</GridView>
<GridView
android:id="@+id/picto_main_grid_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_below="@+id/tape_grid_view"
android:layout_alignParentStart="true"
android:gravity="center_vertical|center|center_horizontal"
android:background="#DDDDDD"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:paddingLeft="@dimen/small_padding"
android:paddingTop="@dimen/small_padding"
android:horizontalSpacing="@dimen/picto_grid_spacing"
android:verticalSpacing="@dimen/picto_grid_spacing">
</GridView>
</RelativeLayout>
...@@ -27,4 +27,4 @@ ...@@ -27,4 +27,4 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center|center_horizontal"
android:id="@+id/picto_grid_item_layout_wrapper_big"
android:background="@drawable/picto_grid_item_border"
android:padding="@dimen/picto_border_width">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/picto_big_height"
android:id="@+id/picto_grid_item_layout_big"
android:background="@color/picto_default_background"
android:padding="@dimen/picto_padding">
<ImageView
android:id="@+id/picto_grid_item_image_big"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/picto_grid_item_redcross_big"
android:src="@drawable/disabled_picto" />
</FrameLayout>
</RelativeLayout>
<resources> <resources>
<string name="app_name">com.yottacode.pictogram.Tablet</string> <string name="app_name">com.yottacode.pictogram.Tablet</string>
<item name="maxInTape" type="integer">8</item>
<item name="maxInTape_big" type="integer">6</item>
</resources> </resources>
...@@ -73,14 +73,6 @@ ...@@ -73,14 +73,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
...@@ -89,6 +81,14 @@ ...@@ -89,6 +81,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
......
...@@ -43,6 +43,13 @@ ...@@ -43,6 +43,13 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavorDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" />
...@@ -51,13 +58,6 @@ ...@@ -51,13 +58,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/DefaultFlavor/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/DefaultFlavor/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" />
...@@ -66,14 +66,6 @@ ...@@ -66,14 +66,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" />
...@@ -82,6 +74,14 @@ ...@@ -82,6 +74,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavor/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
...@@ -106,14 +106,6 @@ ...@@ -106,14 +106,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
...@@ -122,7 +114,17 @@ ...@@ -122,7 +114,17 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/9.2.1/jars" />
...@@ -131,11 +133,13 @@ ...@@ -131,11 +133,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/9.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/2.0.0-alpha2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
......
...@@ -72,6 +72,19 @@ sails$ vagrant ssh ...@@ -72,6 +72,19 @@ sails$ vagrant ssh
[vagrant@localhost src]$ sails console [vagrant@localhost src]$ sails console
``` ```
Descargar upload.zip y symbolstx.zip desde el servidor de Yottacode,
descomprimir y crear enlaces simbólicos (en /vagrant/):
```
scp ec2-user@dev.yottacode.com:~/upload.tgz .
scp ec2-user@dev.yottacode.com:~/symbolstx.tgz .
tar zxvf upload.tgz
tar zxvf symbolstx.tgz
ln -s symbolstx_96x82 symbolstx
rm upload.tgz
rm symbolstx.tgz
```
Es importante asegurarse de (si no hemos generado claves SSL) editar `src/config/local.js` Es importante asegurarse de (si no hemos generado claves SSL) editar `src/config/local.js`
y quitar lo relativo a certificados SSL (toda la entrada de la clave `ssl`). y quitar lo relativo a certificados SSL (toda la entrada de la clave `ssl`).
Si hacemos esto, también tendremos que apuntar Angular al backend correcto (no usar https, sino http) Si hacemos esto, también tendremos que apuntar Angular al backend correcto (no usar https, sino http)
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
Vagrant.configure(2) do |config| Vagrant.configure(2) do |config|
# "ubuntu/trusty64" for ubuntu environment # "ubuntu/trusty64" for ubuntu environment
# "boxcutter/centos71" for AWS similar environment # "boxcutter/centos72" for AWS similar environment
config.vm.box = "boxcutter/centos72" config.vm.box = "aspyatkin/ubuntu-16.04-server-amd64"
config.vm.network "forwarded_port", guest: 1337, host: 1337 config.vm.network "forwarded_port", guest: 1337, host: 1337
config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.network "forwarded_port", guest: 80, host: 8080
config.ssh.insert_key = false config.ssh.insert_key = false
......
--- ---
- name: Update apt-get cache - name: Set MySQL root password before installing
apt: debconf: name='mysql-server' question='mysql-server/root_password' value='{{database_root_passwd | quote}}' vtype='password'
update-cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install mysql packages - name: Confirm MySQL root password before installing
apt: debconf: name='mysql-server' question='mysql-server/root_password_again' value='{{database_root_passwd | quote}}' vtype='password'
name: "{{ item }}"
state: present
with_items:
- mysql-server
- mysql-client
- python-mysqldb # required by ansible
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install mysql packages - name: Install MySQL
yum: apt: package={{ item }} state=installed force=yes update_cache=yes cache_valid_time=3600
name: "{{ item }}" when: ansible_os_family == 'Debian'
state: present
with_items: with_items:
- mysql-server - mysql-server
- MySQL-python # required by ansible - mysql-client
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon' - python-mysqldb
- name: Enable and start mysql service - name: Deletes anonymous MySQL server user for localhost
service: mysql_user: user="" state="absent" login_password='{{ database_root_passwd }}' login_user=root
name: mysql
state: restarted
enabled: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Enable and start mysql service
service:
name: mysqld
state: restarted
enabled: yes
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
- name: Set mysql root password - name: Secures the MySQL root user
debconf: mysql_user: user="root" password="{{ database_root_passwd }}" host="{{ item }}" login_password="{{database_root_passwd}}" login_user=root
name: mysql-server
question: "mysql-server/{{ item }}"
value: "{{ database_root_passwd | quote }}"
vtype: password
with_items: with_items:
- root_password - 127.0.0.1
- root_password_again - localhost
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - ::1
- "{{ ansible_fqdn }}"
- name: Reading temporary password
command: bash -c "cat /var/log/mysqld.log | grep \"temporary password\" | sed \"s/.* \\+//g\""
register: tmp_mysql_password
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
- name: Set mysql root password - name: Removes the MySQL test database
shell: "/usr/bin/mysqladmin -u root -p\"{{ tmp_mysql_password.stdout }}\" password \"{{ database_root_passwd | quote }}\"" mysql_db: db=test state=absent login_password="{{ database_root_passwd }}" login_user=root
ignore_errors: yes
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
- deb - deb
- deb-src - deb-src
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Add Nodesource repositories - name: Add Nodesource repositories
yum: yum:
name: "https://rpm.nodesource.com/pub_{{ nodejs_major_version }}.x/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm" name: "https://rpm.nodesource.com/pub_{{ nodejs_major_version }}.x/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm"
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
name: nodejs name: nodejs
state: present state: present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install NodeJS - name: Install NodeJS
yum: yum:
name: nodejs name: nodejs
......
...@@ -95,6 +95,8 @@ module.exports = { ...@@ -95,6 +95,8 @@ module.exports = {
if (!supervisor.isSupAdmin && !stuSup) if (!supervisor.isSupAdmin && !stuSup)
throw new Error("User without students linked to"); throw new Error("User without students linked to");
return res.ok({ return res.ok({
user: supervisor, user: supervisor,
server_time: (new Date()).getTime(), server_time: (new Date()).getTime(),
...@@ -405,6 +407,11 @@ module.exports = { ...@@ -405,6 +407,11 @@ module.exports = {
var students = []; var students = [];
async.each(stuSups, async.each(stuSups,
function(stuSup, cb) { function(stuSup, cb) {
// Filter logically deleted students
if (stuSup.student.office == null)
cb();
var student = stuSup.student; var student = stuSup.student;
student.supervision = req.token.office ? 2 : 1; student.supervision = req.token.office ? 2 : 1;
VStuLastInstruction.findOne({student: student.id}) VStuLastInstruction.findOne({student: student.id})
......
...@@ -86,7 +86,9 @@ module.exports = { ...@@ -86,7 +86,9 @@ module.exports = {
status: 'invisible', status: 'invisible',
highlight: false, highlight: false,
color: null, color: null,
expression: null expression: null,
legend: null,
legend_size: 'small'
}; };
if (typeof attributes === 'object') { if (typeof attributes === 'object') {
...@@ -117,6 +119,15 @@ module.exports = { ...@@ -117,6 +119,15 @@ module.exports = {
if (!((/^(invisible|enabled|disabled)$/).test(validAttributes.status))) { if (!((/^(invisible|enabled|disabled)$/).test(validAttributes.status))) {
delete validAttributes.status; delete validAttributes.status;
} }
if (typeof validAttributes.expression !== 'string') {
delete validAttributes.expression;
}
if (typeof validAttributes.legend !== 'boolean') {
delete validAttributes.legend;
}
if (!((/^(small|large)$/).test(validAttributes.legend_size))) {
delete validAttributes.legend_size;
}
if (typeof validAttributes.highlight !== 'boolean') { if (typeof validAttributes.highlight !== 'boolean') {
delete validAttributes.highlight; delete validAttributes.highlight;
} }
...@@ -137,7 +148,7 @@ module.exports = { ...@@ -137,7 +148,7 @@ module.exports = {
*/ */
beforeCreate: function (attrs, next) { beforeCreate: function (attrs, next) {
if (typeof attrs.attributes !== 'object') { if (typeof attrs.attributes !== 'object') {
attrs.attributes = JSON.parse(attrs.attributes); attrs.attributes = JSON.parse(attrs.attributes);
} }
attrs.attributes = StuPicto.getValidAttributes(attrs.attributes); attrs.attributes = StuPicto.getValidAttributes(attrs.attributes);
next(); next();
......
...@@ -169,6 +169,7 @@ module.exports = { ...@@ -169,6 +169,7 @@ module.exports = {
}, },
legend: false, legend: false,
legend_size: 'normal', legend_size: 'normal',
pic: "defaultAvatar.jpg",
size: 'normal', size: 'normal',
picto_background: '#0000ff', picto_background: '#0000ff',
tape_background: '#00ffff', tape_background: '#00ffff',
...@@ -194,6 +195,9 @@ module.exports = { ...@@ -194,6 +195,9 @@ module.exports = {
} }
}); });
} }
if (typeof validAttributes.pic !== 'string') {
delete validAttributes.pic;
}
if (typeof validAttributes.input_selection !== 'object') { if (typeof validAttributes.input_selection !== 'object') {
delete validAttributes.input_selection; delete validAttributes.input_selection;
} else { } else {
...@@ -504,7 +508,6 @@ module.exports = { ...@@ -504,7 +508,6 @@ module.exports = {
if (err || !student) if (err || !student)
throw err; throw err;
// set office to NULL to unlink it
student.office = null; student.office = null;
student.save(function(err, saved) { student.save(function(err, saved) {
if (err) return cb(err); if (err) return cb(err);
......
...@@ -250,6 +250,7 @@ ...@@ -250,6 +250,7 @@
"state_spontaneous": "Spontaneous", "state_spontaneous": "Spontaneous",
"state_supervised": "Supervised", "state_supervised": "Supervised",
"student_added": "Student added", "student_added": "Student added",
"student_already_exists": "A student with that username already exists, please try with another one",
"student_deleted": "Student deleted", "student_deleted": "Student deleted",
"student_not_added": "Student not added", "student_not_added": "Student not added",
"student_not_deleted": "Student not deleted", "student_not_deleted": "Student not deleted",
......
...@@ -251,6 +251,7 @@ ...@@ -251,6 +251,7 @@
"state_spontaneous": "Espontáneo", "state_spontaneous": "Espontáneo",
"state_supervised": "Guiado", "state_supervised": "Guiado",
"student_added": "Estudiante añadido", "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_deleted": "Estudiante eliminado",
"student_not_added": "Estudiante no añadido", "student_not_added": "Estudiante no añadido",
"student_not_deleted": "No se ha podido eliminar el estudiante", "student_not_deleted": "No se ha podido eliminar el estudiante",
......
...@@ -57,7 +57,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -57,7 +57,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope.isCategory = function (studentPicto) { $scope.isCategory = function (studentPicto) {
return studentPicto.attributes.id_cat === null && return studentPicto.attributes.id_cat === null &&
studentPicto.attributes.coord_x !== 0 && studentPicto.attributes.coord_y !== 0 &&
typeof studentPicto.attributes.free_category_coord_x !== 'number' && typeof studentPicto.attributes.free_category_coord_x !== 'number' &&
typeof studentPicto.attributes.free_category_coord_y !== 'number'; typeof studentPicto.attributes.free_category_coord_y !== 'number';
}; };
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-init="colIndex = $index" ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
class="disabled" class="disabled"
...@@ -108,6 +109,7 @@ ...@@ -108,6 +109,7 @@
ng-repeat="studentPicto in studentPictoRow track by $index" ng-repeat="studentPicto in studentPictoRow track by $index"
popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter"> popover-trigger="mouseenter">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
class="disabled" class="disabled"
...@@ -167,6 +169,7 @@ ...@@ -167,6 +169,7 @@
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-init="colIndex = $index" ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
class="disabled" class="disabled"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<h4 class="modal-title" id="myModalLabel" translate>pictogram_setup</h4> <h4 class="modal-title" id="myModalLabel" translate>pictogram_setup</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<ul class="list-group"> <ul class="list-group">
<li class="list-group-item"> <li class="list-group-item">
<p translate>expression</p> <p translate>expression</p>
...@@ -25,16 +25,21 @@ ...@@ -25,16 +25,21 @@
<!-- <!--
<li class="list-group-item"> <li class="list-group-item">
<div class="checkbox"> <div class="checkbox">
<label><input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.magnify" ng-change="update_properties()"> Aumentado</label> <label><input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.magnify" ng-change="update_properties()"> Aumentado</label>
</div> </div>
</li> </li>
--> -->
<li class="list-group-item"> <!-- <li class="list-group-item">
<div class="checkbox"> <div class="checkbox">
<label><input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.highlight" ng-change="update_properties()" translate> highlighted</label> <label><input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.highlight" ng-change="update_properties()" translate> highlighted</label>
</div> </div>
</li> </li>
-->
<li class="list-group-item">
<div class="checkbox">
<input data-toggle="toggle" type="checkbox" ng-model="studentPicto.attributes.legend" ng-change="update_properties()"><label translate>legend</label>
</div>
</ul> </ul>
</div> </div>
<!-- End modal-body --> <!-- End modal-body -->
</div> </div>
\ No newline at end of file
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
<input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/> <input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/>
</div> </div>
<div class="form-group"> <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>
<div class="form-group"> <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> </div>
<legend translate>personal_data</legend> <legend translate>personal_data</legend>
<div class="form-group"> <div class="form-group">
......
...@@ -24,7 +24,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl( ...@@ -24,7 +24,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
gender: 'F', gender: 'F',
lang: 'es-es', lang: 'es-es',
notes: '', notes: '',
pic: '/app/img/default.jpg', pic: 'defaultAvatar.jpg',
office: $scope.user.office || { name: '' } office: $scope.user.office || { name: '' }
}; };
...@@ -121,7 +121,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl( ...@@ -121,7 +121,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
// between the new element created and the form fields // between the new element created and the form fields
$scope.resetForm(); $scope.resetForm();
// Show the add form to new adding // Hide the add form to new adding
$scope.hidestudentadd = true; $scope.hidestudentadd = true;
// Update counters // Update counters
...@@ -130,14 +130,17 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl( ...@@ -130,14 +130,17 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
}) })
.error(function (err) { .error(function (err) {
var errorMessage = 'student_not_added'; var errorMessage = 'student_not_added';
console.log(err);
if (typeof err == "string" && err.search("Maximum number of enrolments reached") > 0) if (typeof err == "string" && err.search("Maximum number of enrolments reached") > 0)
errorMessage = 'max_licenses_reached'; errorMessage = 'max_licenses_reached';
if (typeof err == "string" && err.search("already exists") > 0)
errorMessage = 'student_already_exists';
else if (err && err.status === 400) else if (err && err.status === 400)
errorMessage = 'invalid_fields'; errorMessage = 'invalid_fields';
ngToast.danger({ content: $translate.instant(errorMessage) }); ngToast.danger({ content: $translate.instant(errorMessage) });
$scope.hidestudentadd = true;
}); });
}; };
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<fieldset> <fieldset>
<legend translate>change_password</legend> <legend translate>change_password</legend>
<div class="form-group"> <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" /> <input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formdata.password" />
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -11,8 +11,11 @@ ...@@ -11,8 +11,11 @@
<!-- Add Student button and Search row --> <!-- Add Student button and Search row -->
<div class="row"> <div class="row">
<div class="col-xs-3"> <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>
<div class="col-xs-6 input-group"> <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"> <input type="text" ng-model="search_students" id="search_students" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
...@@ -33,7 +36,7 @@ ...@@ -33,7 +36,7 @@
</div> </div>
</td> </td>
<td> <td>
<h4>{{student.name}} {{student.surname}}</h4> <h4>{{student.surname}}, {{student.name}}</h4>
</td> </td>
<td> <td>
<p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p> <p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p>
......
...@@ -451,6 +451,21 @@ textarea.editable{ ...@@ -451,6 +451,21 @@ textarea.editable{
.picto .picto_options .picto_minus{ position: absolute; top: 2px; right: 2px; } .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 */ /* In addpicto */
#collections{ #collections{
height: 400px; height: 400px;
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
&__title { &__title {
margin-top: 0; margin-top: 0;
color: white; color: black;
text-transform: capitalize; text-transform: capitalize;
} }
} }
...@@ -468,7 +468,7 @@ function sqlTypeCast(attr) { ...@@ -468,7 +468,7 @@ function sqlTypeCast(attr) {
break; break;
case 'datetime': case 'datetime':
expandedType = 'DATETIME(3)'; expandedType = 'DATETIME';
break; break;
case 'time': case 'time':
...@@ -499,8 +499,7 @@ function toSqlDate(date) { ...@@ -499,8 +499,7 @@ function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' + ('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + '.' + ('00' + date.getSeconds()).slice(-2);
('00' + date.getMilliseconds()).slice(-3);
return date; return date;
} }
......
...@@ -242,8 +242,7 @@ utils.toSqlDate = function toSqlDate(date) { ...@@ -242,8 +242,7 @@ utils.toSqlDate = function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' + ('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' + ('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' + ('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + '.' + ('00' + date.getSeconds()).slice(-2);
('00' + date.getMilliseconds()).slice(-2);
return date; return date;
}; };
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