Commit eabea625 by Arturo Montejo Ráez

Merge branch 'develop' of http://gitlab.ujaen.es/yotta/pictogram into develop

parents 0d43cf5f e3b77e36
...@@ -145,7 +145,14 @@ public class RestapiWrapper { ...@@ -145,7 +145,14 @@ public class RestapiWrapper {
if (Character.isAlphabetic(response.charAt(0))) if (Character.isAlphabetic(response.charAt(0)))
response.append('\'').insert(0,'\''); response.append('\'').insert(0,'\'');
Log.i(LOG_TAG, "Raw server answer: " + response);
for (int i=0;i<(int)(((float)response.length())/3000)+1;i++) {
int begin= i * 3000;
int end = (i+1) * 3000;
if (end>response.length()) end=response.length();
Log.d(LOG_TAG, "Raw server answer(" + i+ "): " + response.substring(begin, end));
}
try { try {
JSONresponse = new JSONObject("{ "+SERVER_RESULT+": " + response + (responseCode == HttpURLConnection.HTTP_OK JSONresponse = new JSONObject("{ "+SERVER_RESULT+": " + response + (responseCode == HttpURLConnection.HTTP_OK
? "}" ? "}"
...@@ -154,7 +161,7 @@ public class RestapiWrapper { ...@@ -154,7 +161,7 @@ public class RestapiWrapper {
JSONresponse = null; JSONresponse = null;
Log.e(RestapiWrapper.class.getCanonicalName(),e.getMessage()); Log.e(RestapiWrapper.class.getCanonicalName(),e.getMessage());
} }
Log.i(LOG_TAG, "server answer: " + JSONresponse.toString()); Log.i(LOG_TAG, "Server answer: " + JSONresponse.toString());
return JSONresponse; return JSONresponse;
} }
......
...@@ -135,8 +135,8 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -135,8 +135,8 @@ public class Vocabulary implements Iterable<Picto> {
private boolean synchronize_upload() { private boolean synchronize_upload() {
boolean upload_pending=false; boolean upload_pending=false;
try { try {
this.pictos.clear(); if (this.pictos.isEmpty())
PCBcontext.getPcbdb().getStudentVocabulary(this); PCBcontext.getPcbdb().getStudentVocabulary(this);
} catch (JSONException e) { } catch (JSONException e) {
Log.e(this.getClass().getName(), " Picto json error from local storage: " + e.getMessage()); Log.e(this.getClass().getName(), " Picto json error from local storage: " + e.getMessage());
} }
...@@ -254,7 +254,7 @@ public class Vocabulary implements Iterable<Picto> { ...@@ -254,7 +254,7 @@ public class Vocabulary implements Iterable<Picto> {
pictos_cat = new LinkedList<>(); pictos_cat = new LinkedList<>();
pictos.put(new Integer(picto.get_category()),pictos_cat); pictos.put(new Integer(picto.get_category()),pictos_cat);
} }
pictos_cat.add(picto);
imgs.add(new Img(picto.get_id(), picto.get_url(), Img.VOCABULARY)); imgs.add(new Img(picto.get_id(), picto.get_url(), Img.VOCABULARY));
} }
Log.d(this.getClass().getName(), "Vocabulary size: " + updated_collection.length); Log.d(this.getClass().getName(), "Vocabulary size: " + updated_collection.length);
......
...@@ -39,7 +39,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -39,7 +39,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
private Vector<iNetServiceStatus> listeners; private Vector<iNetServiceStatus> listeners;
private static final long restfullSynchroTimming=PCBcontext.getContext().getResources().getInteger(R.integer.netservice_force_restfull_synchro)*1000; private static final long restfullSynchroTimming=PCBcontext.getContext().getResources().getInteger(R.integer.netservice_force_restfull_synchro)*1000;
private long lastRestfullSynchro; private long nextRestfullSynchro;
public NetService(int delay, iNetServiceStatus listener) { public NetService(int delay, iNetServiceStatus listener) {
this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session); this.updated=RestapiWrapper.ping(PCBcontext.getContext().getResources().getString(R.string.server), ping_session);
...@@ -164,7 +164,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -164,7 +164,7 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
Log.e(LOG_TAG, "PING JSON ERROR: " + result + " " + e.getMessage()); Log.e(LOG_TAG, "PING JSON ERROR: " + result + " " + e.getMessage());
} }
if (!updated) { if (!updated) {
lastRestfullSynchro = new Date().getTime(); nextRestfullSynchro = new Date().getTime();
updated = true; updated = true;
if (PCBcontext.is_user_logged()) //si el usuario aun no hizo login, en realidad no es necesario hacer nada if (PCBcontext.is_user_logged()) //si el usuario aun no hizo login, en realidad no es necesario hacer nada
// Comprobar si hay usuario offline, para hacer login transparente // Comprobar si hay usuario offline, para hacer login transparente
...@@ -183,13 +183,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -183,13 +183,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
//cada restfullSynchroTimming aprox. se fuerza sincronización de vocabulario y configuración de usuario //cada restfullSynchroTimming aprox. se fuerza sincronización de vocabulario y configuración de usuario
long now = new Date().getTime(); long now = new Date().getTime();
if (PCBcontext.is_user_logged()) { if (PCBcontext.is_user_logged()) {
if (restfullSynchroTimming > 0 && (now - lastRestfullSynchro > restfullSynchroTimming)) { if (restfullSynchroTimming > 0 && (now>= nextRestfullSynchro)) {
Log.i(LOG_TAG, "Vocabulary request."); Log.i(LOG_TAG, "Vocabulary request.");
PCBcontext.getVocabulary().synchronize(); PCBcontext.getVocabulary().synchronize();
synchronizeStudentAttributes(); synchronizeStudentAttributes();
lastRestfullSynchro = now; nextSynchro(now+restfullSynchroTimming);
} }
} else lastRestfullSynchro = new Date().getTime(); } else nextSynchro(now+restfullSynchroTimming);
} }
} }
...@@ -206,6 +206,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin { ...@@ -206,6 +206,13 @@ public class NetService implements Runnable, RestapiWrapper.iSilentLogin {
} }
} }
public void nextSynchro(long next) {
nextRestfullSynchro = next;
}
public long getSynchroTimingLength(){
return restfullSynchroTimming;
}
private void synchronizeStudentAttributes() { private void synchronizeStudentAttributes() {
int id=PCBcontext.getPcbdb().getCurrentUser().get_id_stu(); int id=PCBcontext.getPcbdb().getCurrentUser().get_id_stu();
PCBcontext.getRestapiWrapper().ask("stu/" + id, new RestapiWrapper.iRestapiListener() { PCBcontext.getRestapiWrapper().ask("stu/" + id, new RestapiWrapper.iRestapiListener() {
......
...@@ -4,10 +4,13 @@ import android.util.Log; ...@@ -4,10 +4,13 @@ import android.util.Log;
import com.github.nkzawa.emitter.Emitter; import com.github.nkzawa.emitter.Emitter;
import com.yottacode.pictogram.dao.Picto; import com.yottacode.pictogram.dao.Picto;
import com.yottacode.pictogram.tools.PCBcontext;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.Date;
/** /**
* Websocket Vocabulary Room based on Room * Websocket Vocabulary Room based on Room
* @author Fernando Martinez Santiago * @author Fernando Martinez Santiago
...@@ -50,7 +53,7 @@ public class VocabularyTalk implements Emitter.Listener { ...@@ -50,7 +53,7 @@ public class VocabularyTalk implements Emitter.Listener {
JSONObject picto_stupicto = stu_picto.optJSONObject(param_picto); JSONObject picto_stupicto = stu_picto.optJSONObject(param_picto);
int picto_id = picto_stupicto.getInt(param_picto_id); int picto_id = picto_stupicto.getInt(param_picto_id);
int picto_cat = attrs_stu_picto!=null ? attrs_stu_picto.optInt(param_picto_cat, Picto.NO_CATEGORY) : 0; int picto_cat = attrs_stu_picto!=null ? attrs_stu_picto.optInt(param_picto_cat, Picto.NO_CATEGORY) : 0;
PCBcontext.getNetService().nextSynchro(new Date().getTime()+PCBcontext.getNetService().getSynchroTimingLength()*2); //nos saltamos una sincronización para evitar que llegue antes que los websockets
Log.i(LOG_TAG, "Received message '" + action + Log.i(LOG_TAG, "Received message '" + action +
"' for picto " + picto_id + " (cat " + picto_cat + ", picto: " + picto_stupicto); "' for picto " + picto_id + " (cat " + picto_cat + ", picto: " + picto_stupicto);
for (iVocabularyListener listener: this.listeners) for (iVocabularyListener listener: this.listeners)
......
...@@ -21,6 +21,7 @@ android { ...@@ -21,6 +21,7 @@ android {
resValue "bool","NotifyAllwaysVisible","false" resValue "bool","NotifyAllwaysVisible","false"
resValue "string", "VersionManagerClass", "com.yottacode.pictogram.supervisor_tablet.net.VersionManager" resValue "string", "VersionManagerClass", "com.yottacode.pictogram.supervisor_tablet.net.VersionManager"
resValue "string","apk","pictograms.apk" resValue "string","apk","pictograms.apk"
resValue "string","google_play_apk","https://play.google.com/store/apps/details?id=com.yottacode.supervisor_tablet"
// signingConfig signingConfigs.config // signingConfig signingConfigs.config
} }
productFlavors { productFlavors {
......
...@@ -26,8 +26,7 @@ public class VersionManager implements iVersionManager { ...@@ -26,8 +26,7 @@ public class VersionManager implements iVersionManager {
public void newVersionAlert(final float version, final Context context, final float vnew) { public void newVersionAlert(final float version, final Context context, final float vnew) {
final SpannableString s = new SpannableString(context.getResources().getString(R.string.server) final SpannableString s = new SpannableString(context.getResources().getString(R.string.google_play_apk));
+ "/" + context.getResources().getString(com.yottacode.pictogram.R.string.apk));
final TextView tx1 = new TextView(context); final TextView tx1 = new TextView(context);
tx1.setText("\t"+context.getResources().getString(R.string.new_version_detail) + tx1.setText("\t"+context.getResources().getString(R.string.new_version_detail) +
......
...@@ -71,40 +71,42 @@ public class SessionActivity extends FragmentActivity implements ListInstruction ...@@ -71,40 +71,42 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
} }
private void evaluateMsg(final int msg_pos, final String evaluation_value, final int evaluation_translation, final int evaluation_bitmap) { private void evaluateMsg(final int msg_pos, final String evaluation_value, final int evaluation_translation, final int evaluation_bitmap) {
final SessionFragment sessionFragment = (SessionFragment) getSupportFragmentManager().findFragmentByTag(SessionActivity.FRAGMENT_SESSION); final SessionFragment sessionFragment = (SessionFragment) getSupportFragmentManager().findFragmentByTag(SessionActivity.FRAGMENT_SESSION);
final int currentMsgId=SessionActivity.this.msgs.get(msg_pos); final int currentMsgId=SessionActivity.this.msgs.get(msg_pos);
SessionWrapper.evaluateTry(currentMsgId, msg_pos==this.msgs.size()-1, evaluation_value, new SessionWrapper.iTryUpdated() { if (sessionFragment.get_current_msg_text().trim().length()>0) //no se permiten trys vacios
@Override SessionWrapper.evaluateTry(currentMsgId, msg_pos==this.msgs.size()-1, evaluation_value, new SessionWrapper.iTryUpdated() {
public void update(int next_try_id) { @Override
addLogMsg("añadiendo "+ sessionFragment.get_current_msg_text()+"."); public void update(int next_try_id) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),evaluation_bitmap); addLogMsg("añadiendo "+ sessionFragment.get_current_msg_text()+".");
sessionFragment.evaluateMsg(bitmap,getString(evaluation_translation),msg_pos); Bitmap bitmap = BitmapFactory.decodeResource(getResources(),evaluation_bitmap);
addLogMsg("#"+(msg_pos<9 ? "0" : "")+(msg_pos+1)+sessionFragment.get_msg_text(msg_pos)); sessionFragment.evaluateMsg(bitmap,getString(evaluation_translation),msg_pos);
if (!msgs.containsValue(next_try_id)) addLogMsg("#"+(msg_pos<9 ? "0" : "")+(msg_pos+1)+sessionFragment.get_msg_text(msg_pos));
new_try(sessionFragment, next_try_id); if (!msgs.containsValue(next_try_id))
if (evaluation_value!=null && msg_pos==msgs.size()-1){ new_try(sessionFragment, next_try_id);
SessionWrapper.newTry(id_session, new SessionWrapper.iTryUpdated() { if (evaluation_value!=null && msg_pos==msgs.size()-1){
@Override SessionWrapper.newTry(id_session, new SessionWrapper.iTryUpdated() {
public void update(int id) { @Override
int pos_newmsg = sessionFragment.newMsg(); public void update(int id) {
msgs.put(pos_newmsg, id); int pos_newmsg = sessionFragment.newMsg();
addLogMsg(getString(R.string.session_log_newtry)); msgs.put(pos_newmsg, id);
} addLogMsg(getString(R.string.session_log_newtry));
}
@Override
public void error(String error) { @Override
addLogMsg(getString(R.string.session_error)); public void error(String error) {
} addLogMsg(getString(R.string.session_error));
}); }
});
}
} }
}
@Override @Override
public void error(String error) { public void error(String error) {
addLogMsg(getString(R.string.session_error)+":"+error); addLogMsg(getString(R.string.session_error)+":"+error);
Log.e(LOG_TAG,"server error:"+error+" when updating try "+currentMsgId+" to "+evaluation_value); Log.e(LOG_TAG,"server error:"+error+" when updating try "+currentMsgId+" to "+evaluation_value);
} }
}); });
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -13,6 +13,11 @@ Changes to be performed manually in servers to upgrade ...@@ -13,6 +13,11 @@ Changes to be performed manually in servers to upgrade
## Database ## Database
- update arasaac uri
`source update_arasaac_color_uri.sql`
- add B&W arasaac pictos
`source arasaac_byn.sql`
(already done in dev & pre) (already done in dev & pre)
- add arasaac to source table - add arasaac to source table
......
...@@ -352,7 +352,7 @@ module.exports = { ...@@ -352,7 +352,7 @@ module.exports = {
var l = []; var l = [];
var fs = require('fs'); var fs = require('fs');
Picto.find({ source: 3}) Picto.find({ source: req.params.source})
.paginate({page: req.params.page, limit:req.params.limit}) .paginate({page: req.params.page, limit:req.params.limit})
.populate('expressions', { lang: req.params.lang }) .populate('expressions', { lang: req.params.lang })
.then(function (pictos) { .then(function (pictos) {
......
...@@ -1189,70 +1189,41 @@ module.exports = { ...@@ -1189,70 +1189,41 @@ module.exports = {
/** /**
* Upload a custom sound associated to a picto * Upload a custom sound associated to a picto
* @param {request} req * @param {request} req
* id_sup, * id_stu_picto,
* id_picto,
* *
* @param {response} res * @param {response} res
* { * {
* id: <stu_picto ID>, * stu_picto
* student: <student ID>,
* attributes: {
* id_cat: categoryId or null,
* coord_x: 1 .. 5 or null,
* coord_y: 1 .. 10 or null,
* free_category_coord_x: 0 .. 4 or null,
* free_category_coord_y: 0 .. 9 or null,
* status: '[invisible]/enabled/disabled',
* highlight: true/[false],
* color: any valid HEX color or [null],
* expression: 'custom expression',
* legend: true/[false],
* uri_sound: 'path of sound associated',
* user_avatar:
* },
* picto: {
* id: <pictoID>,
* source: <sourceID>,
* owner: <ownerID> or null,
* id: <pictoID>,
* uri: <URL to image>,
* category: <categoryID>
* }
* }
* } * }
*/ */
upload_sound: function (req, res) { upload_sound: function (req, res) {
console.log("sup id: " + req.params.id_supervisor ); var soundFileName;
Supervisor.findOne({ id: req.params.id_supervisor }).then(function (supervisor) { var soundDirectory = sails.config.pictogram.paths.pictoSoundDirectory;
var soundFileName; soundFileName = sails.config.pictogram.paths.getCustomPictoSoundFilename(req.params.id_stu_picto);
var soundDirectory = sails.config.pictogram.paths.pictoSoundDirectory; req.file('file').upload({
if (!supervisor) maxBytes: 1048576,
throw new Error("No supervisor found"); dirname: soundDirectory,
saveAs: soundFileName
soundFileName = sails.config.pictogram.paths.getSupervisorCustomPictoSoundFilename(supervisor.id); }, function whenDone(err, uploadedFiles) {
var fs = require('fs');
req.file('file').upload({
maxBytes: 1048576, if (err || (uploadedFiles.length === 0))
dirname: soundDirectory, return res.serverError("Error uploading " + err ? err : "");
saveAs: soundFileName
},function whenDone(err, uploadedFiles) { StuPicto.findOne({ id: req.params.id_stu_picto })
var fs = require('fs'); .then((sp) => {
if (!sp)
if (err || (uploadedFiles.length === 0)) throw Error("Not found");
return res.serverError("Error uploading " + err ? err : ""); sp.attributes.uri_sound = soundFileName;
sp.save(function (err) {
StuPicto.findOne({ id: req.body.id}) if (err) throw err;
.then(picto => { return res.ok(sp);
return res.ok(picto);
})
.catch(err => {
fs.unlink(uploadedFiles[0].fd);
return res.serverError("Error uploading " + err);
}); });
})
.catch(err => {
fs.unlink(uploadedFiles[0].fd);
return res.serverError("Error uploading " + err);
}); });
})
.catch(function (err) {
return res.serverError("Error uploading sound: " + err);
}); });
}, },
......
...@@ -137,8 +137,8 @@ module.exports = { ...@@ -137,8 +137,8 @@ module.exports = {
if (!((/^#([0-9a-f]{3}){1,2}$/i).test(validAttributes.color))) { if (!((/^#([0-9a-f]{3}){1,2}$/i).test(validAttributes.color))) {
delete validAttributes.color; delete validAttributes.color;
} }
if (typeof validAttributes.sound_uri!== 'string') { if (typeof validAttributes.uri_sound!== 'string') {
delete validAttributes.sound_uri; delete validAttributes.uri_sound;
} }
if (typeof validAttributes.user_avatar !== 'string') { if (typeof validAttributes.user_avatar !== 'string') {
delete validAttributes.user_avatar; delete validAttributes.user_avatar;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"apply":"Apply", "apply":"Apply",
"annual": "Annual", "annual": "Annual",
"April": "April", "April": "April",
"arasaac_license": "Los símbolos pictográficos utilizados en esta sección son propiedad de CATEDU (http://arasaac.org/) bajo licencia Creative Commons y han sido creados por Sergio Palao.", "arasaac_license": "The pictographic symbols used in this section are the property of CATEDU (http://arasaac.org/) under a Creative Commons license and have been created by Sergio Palau.",
"arasaac_license_import": "The pictographic symbols used in this section are the property of CATEDU (http://arasaac.org/) under a Creative Commons license and have been created by Sergio Palau. By importing you accept the ", "arasaac_license_import": "The pictographic symbols used in this section are the property of CATEDU (http://arasaac.org/) under a Creative Commons license and have been created by Sergio Palau. By importing you accept the ",
"arasaac_license_import2": "terms of use", "arasaac_license_import2": "terms of use",
"arasaac_license_link": "http://www.arasaac.org/condiciones_uso.php", "arasaac_license_link": "http://www.arasaac.org/condiciones_uso.php",
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"background": "Background", "background": "Background",
"beep": "Beep", "beep": "Beep",
"birthdate": "Birthdate", "birthdate": "Birthdate",
"black_and_white": "B&W",
"cancel": "Cancel", "cancel": "Cancel",
"cannot_delete_method": "Method could not be deleted, maybe due to existing recorded sessions.", "cannot_delete_method": "Method could not be deleted, maybe due to existing recorded sessions.",
"cannot_delete_instruction": "Instruction could not be deleted, maybe due to existing recorded sessions.", "cannot_delete_instruction": "Instruction could not be deleted, maybe due to existing recorded sessions.",
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"background": "Fondo", "background": "Fondo",
"beep": "Pitido", "beep": "Pitido",
"birthdate": "Fecha de nacimiento", "birthdate": "Fecha de nacimiento",
"black_and_white": "ByN",
"cancel": "Cancelar", "cancel": "Cancelar",
"cannot_delete_method": "No se pudo eliminar el método, tal vez porque existen sesiones asociadas.", "cannot_delete_method": "No se pudo eliminar el método, tal vez porque existen sesiones asociadas.",
"cannot_delete_instruction": "No se pudo eliminar la instrucción, tal vez porque existen sesiones asociadas.", "cannot_delete_instruction": "No se pudo eliminar la instrucción, tal vez porque existen sesiones asociadas.",
......
...@@ -94,10 +94,9 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -94,10 +94,9 @@ dashboardControllers.controller('AddPictoCtrl', function (
if(!$scope.showArasaacLicense){ if(!$scope.showArasaacLicense){
$scope.loadingCatPictos = true; $scope.loadingCatPictos = true;
var request = ""; var request = "";
//Request page X from all pictos (symbolstx) //Request page X from all pictos (symbolstx)
request = config.backend + '/picto/' + student.lang + request = config.backend + '/picto/' + student.lang +
'/pic_fromArasaac/page/'+$scope.page+'/limit/'+$scope.limit; '/pic_fromArasaac/page/'+$scope.page+'/limit/'+$scope.limit+'/source/3';
$http.get(request) $http.get(request)
.success(function (data) { .success(function (data) {
...@@ -116,6 +115,34 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -116,6 +115,34 @@ dashboardControllers.controller('AddPictoCtrl', function (
} }
}; };
$scope.load_arasaac_byn_pictos = function () {
$scope.pictos = [];
$scope.page = 1;
if(!$scope.showArasaacLicense){
$scope.loadingCatPictos = true;
var request = "";
//Request page X from all pictos (symbolstx)
request = config.backend + '/picto/' + student.lang +
'/pic_fromArasaac/page/'+$scope.page+'/limit/'+$scope.limit+'/source/4';
$http.get(request)
.success(function (data) {
if (data && $scope.source == 'arasaac_byn'){
$scope.pictos = data;
}
$scope.loadingCatPictos = false;
setTimeout(function () { $scope.$apply(); });
})
.error(function () {
$translate('error_loading_pictos').then(function (translation) {
ngToast.danger({ content: translation });
});
$scope.loadingCatPictos = false;
});
}
};
// //
// Load pictos owned by the actual supervisor // Load pictos owned by the actual supervisor
// //
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-8">
<div class="btn-group" ng-show="!onlyOwn"> <div class="btn-group" ng-show="!onlyOwn">
<button class="btn btn-default" btn-radio="'symbolstx'" ng-model="source" ng-click="open_category_from_bc('0')"> <button class="btn btn-default" btn-radio="'symbolstx'" ng-model="source" ng-click="open_category_from_bc('0')">
<span class="glyphicon glyphicon-th"></span> SymbolStix <span class="glyphicon glyphicon-th"></span> SymbolStix
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
<button class="btn btn-default" btn-radio="'arasaac'" ng-model="source" ng-click="load_arasaac_pictos()"> <button class="btn btn-default" btn-radio="'arasaac'" ng-model="source" ng-click="load_arasaac_pictos()">
<i class="fa fa-th" aria-hidden="true"></i> ARASAAC <i class="fa fa-th" aria-hidden="true"></i> ARASAAC
</button> </button>
<button class="btn btn-default" btn-radio="'arasaac_byn'" ng-model="source" ng-click="load_arasaac_byn_pictos()">
<i class="fa fa-th" aria-hidden="true"></i> ARASAAC {{ 'black_and_white' | translate}}
</button>
<button class="btn btn-default" btn-radio="'ownpictos'" ng-model="source" ng-click="load_own_pictos()"> <button class="btn btn-default" btn-radio="'ownpictos'" ng-model="source" ng-click="load_own_pictos()">
<span class="glyphicon glyphicon-picture"></span> {{ 'own_pictos' | translate }} <span class="glyphicon glyphicon-picture"></span> {{ 'own_pictos' | translate }}
</button> </button>
...@@ -31,7 +34,7 @@ ...@@ -31,7 +34,7 @@
</div> </div>
<!-- Filter form --> <!-- Filter form -->
<div class="col-xs-6"> <div class="col-xs-4">
<form ng-submit="search()"> <form ng-submit="search()">
<div class="input-group" id="search_pictos_box"> <div class="input-group" id="search_pictos_box">
<input type="text" class="form-control" placeholder="{{ 'filter' | translate }}" <input type="text" class="form-control" placeholder="{{ 'filter' | translate }}"
...@@ -75,7 +78,7 @@ ...@@ -75,7 +78,7 @@
<!-- Collections row --> <!-- Collections row -->
<div class="row"> <div class="row">
<div id="arasaac_agreement" class="col-md-12" ng-show="showArasaacLicense && source == 'arasaac'"> <div id="arasaac_agreement" class="col-md-12" ng-show="showArasaacLicense && (source == 'arasaac' || source == 'arasaac_byn')">
<div class="panel panel-warning"> <div class="panel panel-warning">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">ARASAAC</h3> <h3 class="panel-title">ARASAAC</h3>
...@@ -119,7 +122,7 @@ ...@@ -119,7 +122,7 @@
</div><!-- /modal-body --> </div><!-- /modal-body -->
<div class="modal-footer"> <div class="modal-footer">
<div class="arasaac_license" ng-show="source == 'arasaac'"> <div class="arasaac_license" ng-show="source == 'arasaac' || source == 'arasaac_byn'">
<p><small>{{'arasaac_license' | translate}}</small></p> <p><small>{{'arasaac_license' | translate}}</small></p>
</div> </div>
<button class="btn btn-success pull-left" ng-show="source == 'ownpictos'" ngf-select ng-model="picFile" accept="image/*" ngf-change="addOwnPicto()"> <button class="btn btn-success pull-left" ng-show="source == 'ownpictos'" ngf-select ng-model="picFile" accept="image/*" ngf-change="addOwnPicto()">
......
...@@ -129,7 +129,7 @@ module.exports.pictogram = { ...@@ -129,7 +129,7 @@ module.exports.pictogram = {
* @param {supervisorId} supervisorId supervisorId * @param {supervisorId} supervisorId supervisorId
* @return {string} fileName * @return {string} fileName
*/ */
getSupervisorCustomPictoSoundFilename: function (supervisorId) { getCustomPictoSoundFilename: function (supervisorId) {
return sails.config.pictogram.paths._getRandomSoundFileName( return sails.config.pictogram.paths._getRandomSoundFileName(
'SUPERVISOR_CUSTOM_PICTO', 'SUPERVISOR_CUSTOM_PICTO',
supervisorId supervisorId
......
...@@ -105,7 +105,7 @@ module.exports.policies = { ...@@ -105,7 +105,7 @@ module.exports.policies = {
login: true, login: true,
create: ['tokenAuth', 'isSupAdmin'], create: ['tokenAuth', 'isSupAdmin'],
upload: ['tokenAuth'], upload: ['tokenAuth'],
upload_sound: ['tokenAuth', 'isSupervisorOfStudent'], upload_sound: ['tokenAuth'],
add_picto: ['tokenAuth', 'isSupervisorOfStudent'], add_picto: ['tokenAuth', 'isSupervisorOfStudent'],
subscribe: ['tokenAuth'], subscribe: ['tokenAuth'],
unsubscribe: true, unsubscribe: true,
......
...@@ -62,7 +62,7 @@ module.exports.routes = { ...@@ -62,7 +62,7 @@ module.exports.routes = {
'GET /picto/:lang/pic_categories/:id_cat': 'PictoController.categories', 'GET /picto/:lang/pic_categories/:id_cat': 'PictoController.categories',
'GET /picto/:lang/pic_fromcategory/:id_cat': 'PictoController.fromcategory', 'GET /picto/:lang/pic_fromcategory/:id_cat': 'PictoController.fromcategory',
'GET /picto/:lang/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx', 'GET /picto/:lang/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx',
'GET /picto/:lang/pic_fromArasaac/page/:page/limit/:limit': 'PictoController.fromArasaac', 'GET /picto/:lang/pic_fromArasaac/page/:page/limit/:limit/source/:source': 'PictoController.fromArasaac',
'GET /picto/:lang/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat', 'GET /picto/:lang/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat',
'GET /picto/:lang/:id_sup/pic_fromSearch/:text/category/:id_cat/source/:source': 'PictoController.fromSearch', 'GET /picto/:lang/:id_sup/pic_fromSearch/:text/category/:id_cat/source/:source': 'PictoController.fromSearch',
...@@ -95,7 +95,7 @@ module.exports.routes = { ...@@ -95,7 +95,7 @@ module.exports.routes = {
'POST /stu/login': 'StudentController.login', 'POST /stu/login': 'StudentController.login',
'POST /stu': 'StudentController.create', 'POST /stu': 'StudentController.create',
'POST /stu/upload': 'StudentController.upload', 'POST /stu/upload': 'StudentController.upload',
'POST /stu/:id_sup/upload/:id_picto': 'StudentController.upload_sound', 'POST /stu/upload/:id_stu_picto': 'StudentController.upload_sound',
'POST /stu/:id_stu/picto/:id_picto': 'StudentController.add_picto', 'POST /stu/:id_stu/picto/:id_picto': 'StudentController.add_picto',
'POST /stu/subscribe': 'StudentController.subscribe', 'POST /stu/subscribe': 'StudentController.subscribe',
'POST /stu/unsubscribe': 'StudentController.unsubscribe', 'POST /stu/unsubscribe': 'StudentController.unsubscribe',
......
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