diff --git a/src/client/templates/space/resources/resources_category_edit.js b/src/client/templates/space/resources/resources_category_edit.js
index df03891..3dda08b 100644
--- a/src/client/templates/space/resources/resources_category_edit.js
+++ b/src/client/templates/space/resources/resources_category_edit.js
@@ -2,15 +2,14 @@ Template.resourcesCategoryEdit.onRendered(function() {
$(".resources-category-edit--form").validate({
rules: {
- categoryName: {
+ editCategoryName: {
required: true,
minlength: 1,
maxlength: 20
}
}
});
-
- Session.set('numChars', 0); // Count the number of characters
+ Session.set('numChars', $('#editCategoryName').val().length); // Count the number of characters
});
@@ -24,7 +23,7 @@ Template.resourcesCategoryEdit.events({
var currentCategoryName = Session.get('resourcesCategoryToEdit');
var categoryType = 'resource';
- var newCategoryName = $(e.target).find('[name=categoryName]').val();
+ var newCategoryName = $(e.target).find('[name=editCategoryName]').val();
if (currentCategoryName != newCategoryName) {
Meteor.call('categoryEdit', spaceId, categoryType, currentCategoryName, newCategoryName, function(error) {
@@ -35,9 +34,13 @@ Template.resourcesCategoryEdit.events({
Session.set('resourcesCategoryToEdit',null);
}
});
- $('#categoryName').val('');
+ $('#editCategoryName').val('');
Session.set('numChars', 0); // Count the number of characters
}
+ else {
+ $('#resourcesCategoryEdit').modal('hide');
+ Session.set('resourcesCategoryToEdit',null);
+ }
},
'click .resources-category-edit--button-submit': function(e) {
e.preventDefault();
@@ -59,8 +62,8 @@ Template.resourcesCategoryEdit.events({
}
});
},
- 'input #categoryName': function(){
- Session.set('numChars', $('#categoryName').val().length);
+ 'input #editCategoryName': function(){
+ Session.set('numChars', $('#editCategoryName').val().length);
}
});
diff --git a/src/client/templates/space/resources/resources_post_submit.js b/src/client/templates/space/resources/resources_post_submit.js
index 7139c76..ce347ce 100644
--- a/src/client/templates/space/resources/resources_post_submit.js
+++ b/src/client/templates/space/resources/resources_post_submit.js
@@ -7,6 +7,10 @@ Template.resourcesPostSubmit.onCreated(function() {
delete Session.keys["fileExt"]; // Clear fileExt session
imageExtensions = ["jpg","jpeg","png","gif"];
+
+ toastr.options = {
+ "positionClass": "toast-bottom-center",
+ }
});
@@ -76,6 +80,7 @@ Template.resourcesPostSubmit.events({
delete Session.keys["fileExt"]; // Clear fileId session
delete Session.keys["filePath"]; // Clear fileExt session
$('#resourcesPostSubmit').modal('hide');
+ toastr.success("",TAPi18n.__('resources-post-submit--confirm-toast'));
};
});
},
diff --git a/src/client/templates/space/space_sidebar.js b/src/client/templates/space/space_sidebar.js
index d2037ae..f2aa5a6 100644
--- a/src/client/templates/space/space_sidebar.js
+++ b/src/client/templates/space/space_sidebar.js
@@ -18,12 +18,14 @@ Template.spaceSidebar.events({
'click .space-sidebar--live-feed-category-edit': function(e) {
e.preventDefault();
var categoryName = $(e.target).data("category");
+ Session.set('numChars', categoryName.length); // Count the number of characters
Session.set('liveFeedCategoryToEdit',categoryName);
$('#liveFeedCategoryEdit').modal('show');
},
'click .space-sidebar--resources-category-edit': function(e) {
e.preventDefault();
var categoryName = $(e.target).data("category");
+ Session.set('numChars', categoryName.length); // Count the number of characters
Session.set('resourcesCategoryToEdit',categoryName);
$('#resourcesCategoryEdit').modal('show');
},
diff --git a/src/lib/i18n/en.i18n.json b/src/lib/i18n/en.i18n.json
index b37b1d3..7939151 100644
--- a/src/lib/i18n/en.i18n.json
+++ b/src/lib/i18n/en.i18n.json
@@ -199,6 +199,7 @@
"home-post-edit--title":"Edit section",
"home-post-submit--title":"Add a section",
"home-post-submit--placeholder":"Title of the section",
+ "home-post-submit--confirm-toast":"The new section has been added.",
"modal--close":"Close",
"modal--delete":"Delete",
"modal--submit":"Submit",
@@ -211,6 +212,7 @@
"lessons-post-submit--title-placeholder":"Title of the lesson",
"lessons-post-submit--description-placeholder":"Description of the lesson",
"lessons-post-submit--help":"Lessons must be exported in HTML5 format within Storyline.
The resulting folder must be zipped before being uploaded, and the .zip file must have the same name as the zipped folder it contains.",
+ "lessons-post-submit--confirm-toast":"The new lesson has been added.",
"lessons-post-delete--confirm":"Do you want to delete this lesson ?",
"lessons-post-delete--title":"Delete this lesson",
"lessons-post-edit--title":"Edit lesson",
@@ -220,6 +222,7 @@
"resources-post-submit--title":"Add a resource",
"resources-post-submit--title-placeholder":"Title of the resource",
"resources-post-submit--description-placeholder":"Description of the ressource",
+ "resources-post-submit--confirm-toast":"The new resource has been added.",
"resources--submit-button":"Add a resource",
"resources-category-edit--title":"Edit a category",
"resources-category-submit--title":"Add a category",
diff --git a/src/lib/i18n/fr-FR.i18n.json b/src/lib/i18n/fr-FR.i18n.json
index ab34f43..043cd8c 100644
--- a/src/lib/i18n/fr-FR.i18n.json
+++ b/src/lib/i18n/fr-FR.i18n.json
@@ -203,6 +203,7 @@
"home-post-edit--title":"Modifier la section",
"home-post-submit--title":"Ajouter une section",
"home-post-submit--placeholder":"Titre de la section",
+ "home-post-submit--confirm-toast":"La section a été ajoutée.",
"lessons--title":"Leçons",
"lessons--subtitle":"eBriefing materials",
"lessons--submit-button":"Ajouter une leçon",
@@ -211,6 +212,7 @@
"lessons-post-submit--title-placeholder":"Titre de la leçon",
"lessons-post-submit--description-placeholder":"Description de la leçon",
"lessons-post-submit--help":"Les leçons doivent être exportées au format HTML5 à partir du logiciel Storyline.
Le dossier résultant doit être zippé avant d'être uploadé, et le .zip doit avoir le même nom que le dossier qu'il contient.",
+ "lessons-post-submit--confirm-toast":"La leçon a été ajoutée.",
"lessons-post-delete--confirm":"Voulez-vous supprimer cette leçon ?",
"lessons-post-delete--title":"Supprimer cette leçon",
"lessons-post-edit--title":"Editer une leçon",
@@ -220,6 +222,7 @@
"resources-post-submit--title":"Ajouter une ressource",
"resources-post-submit--title-placeholder":"Titre de la ressource",
"resources-post-submit--description-placeholder":"Description de la ressource",
+ "resources-post-submit--confirm-toast":"La ressource a été ajoutée.",
"resources--submit-button":"Ajouter une ressource",
"resources-category-edit--title":"Éditer une catégorie",
"resources-category-submit--title":"Ajouter une catégorie",