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
.idea
android/Pictogram/.idea
android/Pictogram/commonlibrary/commonlibrary.iml
android/Pictogram/commonlibrary/local.properties
android/Pictogram/commonlibrary/gradle
android/Pictogram/commonlibrary/gradlew
android/Pictogram/commonlibrary/gradlew.bat
android/Pictogram/tablet/tablet.iml
android/Pictogram/watch/watch.iml
android/Pictogram/Pictogrammar.iml
......
......@@ -11,9 +11,6 @@ android {
versionName "1.0"
resValue "string", "db_name", "PCB.db"
resValue "string", "core_vocabulary", "core_vocabulary"
resValue "integer", "rows", "5"
resValue "integer", "columns", "10"
}
buildTypes {
release {
......
......@@ -43,7 +43,7 @@ public class Picto extends Img {
static String INVISIBLE = "invisible";
}
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 {
*/
public boolean is_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.getFreeRow() == -1;
}
......
package com.yottacode.pictogram.dao;
import java.io.IOException;
import org.json.JSONObject;
import org.json.JSONException;
import android.content.Context;
import android.graphics.Bitmap;
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
......@@ -29,7 +28,7 @@ public class User {
static String CATEGORIES = "categories";
static String INPUT_FEEDBACK = "input feedback";
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_VOICE = "tts voice";
}
......@@ -38,6 +37,7 @@ public class User {
private JSONObject attributes_stu;
private Img img_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 {
......@@ -62,6 +62,7 @@ public class User {
this.gender_sup=gender_sup;
this.lang_sup=lang_sup;
this.tts_engine_sup=tts_engine_sup;
}
......@@ -259,18 +260,21 @@ public class User {
}
}
/**
*
* @return pictogram size of the student configuration (default: "normal")
*/
public String get_pictogram_size() {
public boolean is_picto_size_big() {
try {
return this.attributes_stu.getString(JSON_STUDENT_ATTTRS.PICTOGRAM_SIZE);
} catch (JSONException e) {
return "normal";
return !get_json_attr(JSON_STUDENT_ATTTRS.PICTOGRAM_SIZE).equals("normal");
} catch (Exception e) {
return true;
}
}
public boolean is_supervisor() {
return get_id_sup()!=User.NO_SUPERVISOR;
}
......@@ -288,4 +292,4 @@ public class User {
}
\ No newline at end of file
}
......@@ -56,10 +56,11 @@ public final class PCBcontext {
*/
public static void set_user(User student, String token, iImgDownloaderListener listener) {
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 ");
}
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);
pcbdb = new PCBDBHelper(null, 1, student);
pcbdb.user_online(token!=null);
......@@ -70,6 +71,7 @@ public final class PCBcontext {
}
public static void unset_user() {
Log.i(PCBcontext.class.getCanonicalName(), "User unset. Student " + getPcbdb().getCurrentUser().get_name_stu());
pcbdb = null;
if (room!=null) room.exit();
room = null;
......
......@@ -51,8 +51,6 @@
<string name="nogrammar">Advertencia: Lenguaje no soportado</string>
<string name="pictogrammar">SUpO_PICTOES</string>
<item type="integer" name="maxInTape">8</item>
<!--Upload local img -->
<string name="enterImgLabel">Introduzca etiqueta de la imagen</string>
<string name="notNewCats">No puede añadir nuevas categorias</string>
......
......@@ -10,4 +10,7 @@
<dimen name="picto_normal_height">75dp</dimen>
<dimen name="picto_normal_width">75dp</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>
......@@ -60,7 +60,6 @@
<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>
<item name="maxInTape" type="integer">8</item>
<string name="title_activity_img_label">img_label</string>
<!-- Strings related to login -->
......
......@@ -57,15 +57,16 @@
/>
<TextView
android:text="SUPERVISOR"
android:textStyle="bold"
android:textColor="@color/green"
android:layout_width="200px"
android:layout_height="50px"
android:layout_marginLeft="20px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/textView3"
android:textAppearance="@style/TextAppearance.AppCompat"
android:id="@+id/text_supervisor"
android:layout_below="@+id/imageView"
android:layout_alignStart="@+id/imageView" />
android:layout_toEndOf="@+id/serialmail"
android:layout_marginLeft="60px"
/>
</RelativeLayout>
......
......@@ -9,6 +9,10 @@ android {
versionCode 1
versionName "1.0"
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 {
release {
......
......@@ -10,8 +10,6 @@ import android.view.Window;
import android.view.WindowManager;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.PCBcontext;
public class MainActivity extends Activity {
......@@ -27,9 +25,6 @@ public class MainActivity extends Activity {
// For deactivating the lock screen (just before setContentView)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
PCBcontext.init(this, new NetServiceTablet());
Class serialClass;
try {
serialClass=Class.forName(getString(R.string.SerialClass));
......
......@@ -19,17 +19,29 @@ import java.io.IOException;
*/
public class PictoItemViewGenerator {
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) {
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);
FrameLayout layout = (FrameLayout) convertView.findViewById(R.id.picto_grid_item_layout);
ImageView pictoImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_image);
ImageView redCrossImage = (ImageView) convertView.findViewById(R.id.picto_grid_item_redcross);
RelativeLayout layoutWrapper ;
FrameLayout layout ;
ImageView pictoImage ;
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.setBackground(null);
layoutWrapper.setAlpha(0.25f);
......
......@@ -93,12 +93,25 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
// Button used for showing the picto category view
ImageButton showPictoCategoriesViewButton;
int maxColumns,maxRows,maxInTape;
@Override
protected void onCreate(Bundle 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);
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.currentCategory = null;
......@@ -143,21 +156,24 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
this.pictoCategoryGridView = (GridView) this.findViewById(R.id.picto_category_grid_view);
this.pictoCategoryGridView.setAdapter(this.pictoCategoryGridAdapter);
// @TODO take this value from user configuration (0: normal, 1: large)
int pictogramSize = 0;
if (pictogramSize == 0) {
this.pictoMainGridView.setNumColumns(10);
this.pictoCategoryGridView.setNumColumns(10);
} else if (pictogramSize == 1) {
this.pictoMainGridView.setNumColumns(4);
this.pictoCategoryGridView.setNumColumns(4);
}
this.pictoMainGridView.setNumColumns(this.maxColumns);
this.pictoCategoryGridView.setNumColumns(this.maxColumns);
// tts = new TextToSpeech(this, this, "IVONA Text-to-Speech HQ");
tts = new TextToSpeech(this, this);
tts.setOnUtteranceProgressListener(new OnTTSEndListener());
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.pictoCategoryGridView.setOnDragListener(new OnPictoDragListener());
......@@ -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
int rows = getResources().getInteger(R.integer.rows);
int cols = getResources().getInteger(R.integer.columns);
Picto[][] mp = new Picto[rows][cols];
Picto[][] mp = new Picto[maxRows][maxColumns];
for (Picto p : list) {
if (PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
......@@ -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}");
*/
for(int i=0; i<rows; i++){
for(int j=0; j<cols; j++){
for(int i=0; i<maxRows; i++){
for(int j=0; j<maxColumns; j++){
if(mp[i][j] != null) ll.add(mp[i][j]);
else ll.add(null); // Add the "blank picto" simulating an empty position
}
......@@ -596,7 +610,6 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
//LinkedList<Picto> ll = vocabulary.next(p);
Log.d(LOG_TAG, "Lista de pictos recuperada: " + ll.toString());
int maxInTape = getResources().getInteger(R.integer.maxInTape);
// If the picto is a category
if (p.is_category()) {
......@@ -604,7 +617,7 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
PCBcontext.getActionLog().log(new TalkAction(TalkAction.SELECT, p));
hidePictoMainGridView();
} else if (tapeAdapter.getCount() < maxInTape) {
} else if (tapeAdapter.getCount() < PictogramActivity.this.maxInTape) {
currentCategory = null;
tapeAdapter.addItem(p);
tapeAdapter.notifyDataSetChanged();
......@@ -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
if (currentCategory != null || !PCBcontext.getPcbdb().getCurrentUser().has_categories()) {
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
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,
if (p.get_id() != 0 &&
!p.get_status().equalsIgnoreCase("invisible") &&
!p.get_status().equalsIgnoreCase("disabled") &&
tapeAdapter.getCount() < 8) {
tapeAdapter.getCount() < PictogramActivity.this.maxInTape) {
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(data, //data to be dragged
......
......@@ -12,6 +12,8 @@ import android.widget.EditText;
import com.yottacode.pictogram.dao.UserLogin;
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 {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PCBcontext.init(this, new NetServiceTablet());
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_serial);
......
......@@ -47,6 +47,7 @@ public class StudentFragmentGrid extends Fragment{
final String TAG_LANG = "lang";
final String TAG_ATTRIBUTES = "attributes";
final String TAG_SUPERVISION="supervision";
ProgressDialog progressDialog;
Vector<Integer> idStudents;
String nameStudents[];
Vector<Bitmap> imageStudents;
......@@ -110,12 +111,12 @@ public class StudentFragmentGrid extends Fragment{
PCBcontext.getDevice().insertUser(new_user);
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);
PCBcontext.set_user(new_user, intent.getStringExtra("token"), new iImgDownloaderListener() {
@Override
public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss();
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
Intent pictogramActivity = new Intent(getActivity(), PictogramActivity.class);
startActivity(pictogramActivity);
}
......@@ -160,12 +161,12 @@ public class StudentFragmentGrid extends Fragment{
}
} //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);
ImgDownloader downloader = new ImgDownloader(getActivity(), new iImgDownloaderListener() {
@Override
public void loadComplete() {
if (progressDialog.isShowing()) progressDialog.dismiss();
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
if (downloaded_students.size() > 1) {
for (int i = 0; i < imgs.size(); i++)
try {
......@@ -200,7 +201,7 @@ public class StudentFragmentGrid extends Fragment{
RestapiWrapper wrapper = new RestapiWrapper(
getActivity().getApplicationContext().getResources().getString(R.string.server), token);
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);
wrapper.ask(operation, new iRestapiListener() {
@Override
......@@ -219,7 +220,7 @@ public class StudentFragmentGrid extends Fragment{
}
@Override
public void result(JSONArray students) {
if (progressDialog.isShowing()) progressDialog.dismiss();
if (progressDialog!=null && progressDialog.isShowing()) progressDialog.dismiss();
StudentFragmentGrid.this.downloaded_students=new Vector();
for (int i=0;i<students.length();i++) {
JSONObject student;
......@@ -308,4 +309,13 @@ public class StudentFragmentGrid extends Fragment{
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 {
return complete;
}
// DEVUELVE último elemento
public Picto getLastItem(){
return pictoLinkedList.getLast();
......
......@@ -11,40 +11,38 @@
<!-- 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
android:layout_width="@dimen/picto_normal_width"
android:layout_height="@dimen/tape_normal_height"
android:src="@drawable/remove_picto_from_tape"
android:id="@+id/button_delete"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/button_tts"
android:layout_alignParentStart="true"
android:paddingLeft="16dp"
android:paddingRight="16dp"
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
android:layout_width="@dimen/picto_normal_width"
android:layout_height="@dimen/tape_normal_height"
android:src="@drawable/send_tape"
android:background="@null"
android:background="@android:color/holo_red_light"
android:id="@+id/button_tts"
android:adjustViewBounds="true"
android:layout_alignParentTop="true"
......@@ -88,7 +86,6 @@
android:layout_width="match_parent"
android:layout_below="@+id/tape_grid_view"
android:layout_alignParentStart="true"
android:numColumns="10"
android:gravity="center_vertical|center|center_horizontal"
android:background="#DDDDDD"
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 @@
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
</RelativeLayout>
<?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>
<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>
......@@ -73,14 +73,6 @@
<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/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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
......@@ -89,6 +81,14 @@
<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/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/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
......
......@@ -43,6 +43,13 @@
<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/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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDefaultFlavorDebug/assets" type="java-test-resource" />
......@@ -51,13 +58,6 @@
<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/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/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/DefaultFlavor/assets" type="java-resource" />
......@@ -66,14 +66,6 @@
<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/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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDefaultFlavor/assets" type="java-test-resource" />
......@@ -82,6 +74,14 @@
<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/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/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
......@@ -106,14 +106,6 @@
<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/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/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
......@@ -122,7 +114,17 @@
<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/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/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/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" />
......@@ -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.support/wearable/2.0.0-alpha2/jars" />
<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/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
......
......@@ -72,6 +72,19 @@ sails$ vagrant ssh
[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`
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)
......
......@@ -3,8 +3,8 @@
Vagrant.configure(2) do |config|
# "ubuntu/trusty64" for ubuntu environment
# "boxcutter/centos71" for AWS similar environment
config.vm.box = "boxcutter/centos72"
# "boxcutter/centos72" for AWS similar environment
config.vm.box = "aspyatkin/ubuntu-16.04-server-amd64"
config.vm.network "forwarded_port", guest: 1337, host: 1337
config.vm.network "forwarded_port", guest: 80, host: 8080
config.ssh.insert_key = false
......
---
- name: Update apt-get cache
apt:
update-cache: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Set MySQL root password before installing
debconf: name='mysql-server' question='mysql-server/root_password' value='{{database_root_passwd | quote}}' vtype='password'
- name: Install mysql packages
apt:
name: "{{ item }}"
state: present
with_items:
- mysql-server
- mysql-client
- python-mysqldb # required by ansible
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Confirm MySQL root password before installing
debconf: name='mysql-server' question='mysql-server/root_password_again' value='{{database_root_passwd | quote}}' vtype='password'
- name: Install mysql packages
yum:
name: "{{ item }}"
state: present
- name: Install MySQL
apt: package={{ item }} state=installed force=yes update_cache=yes cache_valid_time=3600
when: ansible_os_family == 'Debian'
with_items:
- mysql-server
- MySQL-python # required by ansible
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
- mysql-client
- python-mysqldb
- name: Enable and start mysql service
service:
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: Deletes anonymous MySQL server user for localhost
mysql_user: user="" state="absent" login_password='{{ database_root_passwd }}' login_user=root
- name: Set mysql root password
debconf:
name: mysql-server
question: "mysql-server/{{ item }}"
value: "{{ database_root_passwd | quote }}"
vtype: password
- name: Secures the MySQL root user
mysql_user: user="root" password="{{ database_root_passwd }}" host="{{ item }}" login_password="{{database_root_passwd}}" login_user=root
with_items:
- root_password
- root_password_again
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- 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'
- 127.0.0.1
- localhost
- ::1
- "{{ ansible_fqdn }}"
- name: Set mysql root password
shell: "/usr/bin/mysqladmin -u root -p\"{{ tmp_mysql_password.stdout }}\" password \"{{ database_root_passwd | quote }}\""
ignore_errors: yes
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Amazon'
- name: Removes the MySQL test database
mysql_db: db=test state=absent login_password="{{ database_root_passwd }}" login_user=root
......@@ -21,6 +21,7 @@
- deb
- deb-src
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Add Nodesource repositories
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"
......@@ -37,6 +38,7 @@
name: nodejs
state: present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install NodeJS
yum:
name: nodejs
......
......@@ -95,6 +95,8 @@ module.exports = {
if (!supervisor.isSupAdmin && !stuSup)
throw new Error("User without students linked to");
return res.ok({
user: supervisor,
server_time: (new Date()).getTime(),
......@@ -405,6 +407,11 @@ module.exports = {
var students = [];
async.each(stuSups,
function(stuSup, cb) {
// Filter logically deleted students
if (stuSup.student.office == null)
cb();
var student = stuSup.student;
student.supervision = req.token.office ? 2 : 1;
VStuLastInstruction.findOne({student: student.id})
......
......@@ -86,7 +86,9 @@ module.exports = {
status: 'invisible',
highlight: false,
color: null,
expression: null
expression: null,
legend: null,
legend_size: 'small'
};
if (typeof attributes === 'object') {
......@@ -117,6 +119,15 @@ module.exports = {
if (!((/^(invisible|enabled|disabled)$/).test(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') {
delete validAttributes.highlight;
}
......@@ -137,7 +148,7 @@ module.exports = {
*/
beforeCreate: function (attrs, next) {
if (typeof attrs.attributes !== 'object') {
attrs.attributes = JSON.parse(attrs.attributes);
attrs.attributes = JSON.parse(attrs.attributes);
}
attrs.attributes = StuPicto.getValidAttributes(attrs.attributes);
next();
......
......@@ -169,6 +169,7 @@ module.exports = {
},
legend: false,
legend_size: 'normal',
pic: "defaultAvatar.jpg",
size: 'normal',
picto_background: '#0000ff',
tape_background: '#00ffff',
......@@ -194,6 +195,9 @@ module.exports = {
}
});
}
if (typeof validAttributes.pic !== 'string') {
delete validAttributes.pic;
}
if (typeof validAttributes.input_selection !== 'object') {
delete validAttributes.input_selection;
} else {
......@@ -504,7 +508,6 @@ module.exports = {
if (err || !student)
throw err;
// set office to NULL to unlink it
student.office = null;
student.save(function(err, saved) {
if (err) return cb(err);
......
......@@ -250,6 +250,7 @@
"state_spontaneous": "Spontaneous",
"state_supervised": "Supervised",
"student_added": "Student added",
"student_already_exists": "A student with that username already exists, please try with another one",
"student_deleted": "Student deleted",
"student_not_added": "Student not added",
"student_not_deleted": "Student not deleted",
......
......@@ -251,6 +251,7 @@
"state_spontaneous": "Espontáneo",
"state_supervised": "Guiado",
"student_added": "Estudiante añadido",
"student_already_exists": "Ya existe un estudiante con ese nombre de usuario. Por favor, inténtelo de nuevo con algo diferente.",
"student_deleted": "Estudiante eliminado",
"student_not_added": "Estudiante no añadido",
"student_not_deleted": "No se ha podido eliminar el estudiante",
......
......@@ -57,7 +57,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope.isCategory = function (studentPicto) {
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_y !== 'number';
};
......
......@@ -37,6 +37,7 @@
popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......@@ -108,6 +109,7 @@
ng-repeat="studentPicto in studentPictoRow track by $index"
popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......@@ -167,6 +169,7 @@
popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index">
<div class="picto-description"> {{ studentData.attributes.legend?studentPicto.expression.text:'' }} </div>
<img
src="/app/img/redcross.png"
class="disabled"
......
......@@ -6,7 +6,7 @@
<h4 class="modal-title" id="myModalLabel" translate>pictogram_setup</h4>
</div>
<div class="modal-body">
<ul class="list-group">
<li class="list-group-item">
<p translate>expression</p>
......@@ -25,16 +25,21 @@
<!--
<li class="list-group-item">
<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>
</li>
-->
<li class="list-group-item">
<!-- <li class="list-group-item">
<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>
</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>
</div>
<!-- End modal-body -->
</div>
\ No newline at end of file
</div>
......@@ -22,10 +22,11 @@
<input type="username" class="form-control" id="setup_username" placeholder="{{ 'username' | translate }}" required ng-model="formUser.username" readonly/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password" />
<input style="display:none" type="password" name="fakepasswordremembered"/>
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formUser.password"/>
</div>
<div class="form-group">
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm" />
<input type="password" class="form-control" id="setup_password2" placeholder="{{ 'password_confirm' | translate }}" ng-model="formUser.password_confirm"/>
</div>
<legend translate>personal_data</legend>
<div class="form-group">
......
......@@ -24,7 +24,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
gender: 'F',
lang: 'es-es',
notes: '',
pic: '/app/img/default.jpg',
pic: 'defaultAvatar.jpg',
office: $scope.user.office || { name: '' }
};
......@@ -121,7 +121,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
// between the new element created and the form fields
$scope.resetForm();
// Show the add form to new adding
// Hide the add form to new adding
$scope.hidestudentadd = true;
// Update counters
......@@ -130,14 +130,17 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
})
.error(function (err) {
var errorMessage = 'student_not_added';
console.log(err);
if (typeof err == "string" && err.search("Maximum number of enrolments reached") > 0)
errorMessage = 'max_licenses_reached';
if (typeof err == "string" && err.search("already exists") > 0)
errorMessage = 'student_already_exists';
else if (err && err.status === 400)
errorMessage = 'invalid_fields';
ngToast.danger({ content: $translate.instant(errorMessage) });
$scope.hidestudentadd = true;
});
};
......
......@@ -42,6 +42,7 @@
<fieldset>
<legend translate>change_password</legend>
<div class="form-group">
<input style="display:none" type="password" name="fakepasswordremembered"/>
<input type="password" class="form-control" id="setup_password1" placeholder="{{ 'password_new_type' | translate }}" ng-model="formdata.password" />
</div>
<div class="form-group">
......
......@@ -11,8 +11,11 @@
<!-- Add Student button and Search row -->
<div class="row">
<div class="col-xs-3">
<button type="button" class="btn btn-success btn-circle btn-lg" ng-click="resetForm(); hidestudentadd = false" title="{{'add'|translate}}" ng-hide="!user.isSupAdmin || !num_licenses_left"><i class="glyphicon glyphicon-plus"></i></button>
<p class="text-left" ng-hide="!user.isSupAdmin || !num_licenses_left || !hidestudentadd">
<a ng-click="resetForm(); hidestudentadd = false" class="btn btn-success btn-sm" role="button">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {{ 'add_student' | translate }}
</a>
</p>
</div>
<div class="col-xs-6 input-group">
<input type="text" ng-model="search_students" id="search_students" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
......@@ -33,7 +36,7 @@
</div>
</td>
<td>
<h4>{{student.name}} {{student.surname}}</h4>
<h4>{{student.surname}}, {{student.name}}</h4>
</td>
<td>
<p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p>
......
......@@ -451,6 +451,21 @@ textarea.editable{
.picto .picto_options .picto_minus{ position: absolute; top: 2px; right: 2px; }
/* Text above picto */
.picto-description {
position: absolute;
bottom: 0px;
text-align: center;
width: 100%;
background-color: rgba(1, 1, 1, 0.50);
color: white;
margin-left: -2px;
font-weight: 600;
text-transform: uppercase;
font-size: 12px;
word-wrap: break-word;
}
/* In addpicto */
#collections{
height: 400px;
......
......@@ -62,7 +62,7 @@
&__title {
margin-top: 0;
color: white;
color: black;
text-transform: capitalize;
}
}
......@@ -468,7 +468,7 @@ function sqlTypeCast(attr) {
break;
case 'datetime':
expandedType = 'DATETIME(3)';
expandedType = 'DATETIME';
break;
case 'time':
......@@ -499,8 +499,7 @@ function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-3);
('00' + date.getSeconds()).slice(-2);
return date;
}
......
......@@ -242,8 +242,7 @@ utils.toSqlDate = function toSqlDate(date) {
('00' + date.getDate()).slice(-2) + ' ' +
('00' + date.getHours()).slice(-2) + ':' +
('00' + date.getMinutes()).slice(-2) + ':' +
('00' + date.getSeconds()).slice(-2) + '.' +
('00' + date.getMilliseconds()).slice(-2);
('00' + date.getSeconds()).slice(-2);
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