Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
smallhacks committed Apr 6, 2019
2 parents 3eba176 + 56fdd16 commit 55e5eb9
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ alexwine:bootstrap-4
teamon:tinymce
tomi:upload-jquery@=2.2.3
tomi:upload-server
chrismbeckett:toastr
1 change: 1 addition & 0 deletions src/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ [email protected]
cfs:[email protected]
cfs:[email protected]
[email protected]
chrismbeckett:[email protected]_1
chuangbo:[email protected]
[email protected]
copleykj:[email protected]
Expand Down
14 changes: 8 additions & 6 deletions src/client/templates/space/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
{{/if}}
<h5 class="mb-4">{{_ 'home--title'}}</h5>
{{#unless space.permissions.public}}
{{#if codePanel}}
<div class="alert alert-warning alert-dismissible fade show" role="alert">{{{_ 'home--space-code-message'}}} <span style="font-size:1.1em" class="badge badge-secondary">{{space.spaceCode}}</span>
<button type="button" class="close home--hide-code-panel">
<span aria-hidden="true">&times;</span>
</button>
</div>
{{#if ownSpace}}
{{#if codePanel}}
<div class="alert alert-warning alert-dismissible fade show" role="alert">{{{_ 'home--space-code-message'}}} <span style="font-size:1.1em" class="badge badge-secondary">{{space.spaceCode}}</span>
<button type="button" class="close home--hide-code-panel">
<span aria-hidden="true">&times;</span>
</button>
</div>
{{/if}}
{{/if}}
{{/unless}}
{{#each homePosts}}
Expand Down
9 changes: 9 additions & 0 deletions src/client/templates/space/home/home_post_submit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Template.homePostSubmit.onCreated(function() {

toastr.options = {
"positionClass": "toast-bottom-center",
}
});


Template.homePostSubmit.events({

'submit form': function(e, template) {
Expand All @@ -16,6 +24,7 @@ Template.homePostSubmit.events({
tinymce.activeEditor.setContent(''); // Remove textarea content
$(e.target).find('[name=title]').val('');
$('#homePostSubmit').modal('hide');
toastr.success("",TAPi18n.__('home-post-submit--confirm-toast'));
};
});
},
Expand Down
5 changes: 5 additions & 0 deletions src/client/templates/space/lessons/lessons_post_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Template.lessonsPostSubmit.onCreated(function() {
delete Session.keys["fileExt"]; // Clear fileExt session

imageExtensions = ["jpg","jpeg","png","gif"];

toastr.options = {
"positionClass": "toast-bottom-center",
}
});


Expand Down Expand Up @@ -85,6 +89,7 @@ Template.lessonsPostSubmit.events({

$('.lessons-post-submit--button-submit').prop('disabled', true);
$('#lessonsPostSubmit').modal('hide');
toastr.success("",TAPi18n.__('lessons-post-submit--confirm-toast'));
};
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h5 class="modal-title" id="exampleModalLabel">{{_ 'live-feed-category-edit--tit
<div class="modal-body">
<form name="live-feed-category-edit--form" class="live-feed-category-edit--form" id="live-feed-category-edit--form">
<div class="form-group">
<input type="text" class="form-control" name="categoryName" id="categoryName" aria-describedby="categoryName" placeholder="Category name" value="{{categoryName}}">
<input type="text" class="form-control" name="editCategoryName" id="editCategoryName" aria-describedby="editCategoryName" placeholder="Category name" value="{{categoryName}}">
<div class="text-secondary">{{numChars}}/20</div>
</div>
</form>
Expand Down
16 changes: 10 additions & 6 deletions src/client/templates/space/live_feed/live_feed_category_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Template.liveFeedCategoryEdit.onRendered(function() {

$(".live-feed-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
});


Expand All @@ -24,7 +24,7 @@ Template.liveFeedCategoryEdit.events({
var currentCategoryName = Session.get('liveFeedCategoryToEdit');
var categoryType = 'liveFeed';

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) {
Expand All @@ -35,9 +35,13 @@ Template.liveFeedCategoryEdit.events({
Session.set('liveFeedCategoryToEdit',null);
}
});
$('#categoryName').val('');
$('#editCategoryName').val('');
Session.set('numChars', 0); // Count the number of characters
}
else {
$('#liveFeedCategoryEdit').modal('hide');
Session.set('liveFeedCategoryToEdit',null);
}
},
'click .live-feed-category-edit--button-submit': function(e) {
e.preventDefault();
Expand All @@ -59,8 +63,8 @@ Template.liveFeedCategoryEdit.events({
}
});
},
'input #categoryName': function(){
Session.set('numChars', $('#categoryName').val().length);
'input #editCategoryName': function(){
Session.set('numChars', $('#editCategoryName').val().length);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h5 class="modal-title" id="exampleModalLabel">{{_ 'live-feed-post-edit--title'}
{{#if fileUploaded}}
{{#if image}}
<div class="mt-2 mb-4 text-center">
<img class="card-img-top" src="/upload{{fileUploaded.filePath}}" alt="" />
<img class="card-img-top" src="/upload{{filePath}}" alt="" />
<a href="#" class="post-submit--button-delete-image"><i class="fa fa-trash" aria-hidden="true"></i> {{_ 'post-submit--delete-image'}}</a>
</div>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h5 class="modal-title" id="exampleModalLabel">{{_ 'resources-category-edit--tit
<div class="modal-body">
<form name="resources-category-edit--form" class="resources-category-edit--form" id="resources-category-edit--form">
<div class="form-group">
<input type="text" class="form-control" name="categoryName" id="categoryName" aria-describedby="categoryName" placeholder="Category name" value="{{categoryName}}">
<input type="text" class="form-control" name="editCategoryName" id="editCategoryName" aria-describedby="editCategoryName" placeholder="Category name" value="{{categoryName}}">
<div class="text-secondary">{{numChars}}/20</div>
</div>
</form>
Expand Down
17 changes: 10 additions & 7 deletions src/client/templates/space/resources/resources_category_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});


Expand All @@ -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) {
Expand All @@ -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();
Expand All @@ -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);
}
});

Expand Down
5 changes: 5 additions & 0 deletions src/client/templates/space/resources/resources_post_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
});


Expand Down Expand Up @@ -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'));
};
});
},
Expand Down
2 changes: 2 additions & 0 deletions src/client/templates/space/space_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
Expand Down
3 changes: 3 additions & 0 deletions src/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.<br>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",
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/lib/i18n/fr-FR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.<br>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",
Expand All @@ -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",
Expand Down

0 comments on commit 55e5eb9

Please sign in to comment.