Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
- Add input focus for author login
- Change mail sending to HTML
- Change space name max length to 35
- Add favicon
- Change version number
  • Loading branch information
smallhacks committed Jul 21, 2019
1 parent e350f3a commit 7c735a5
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 36 deletions.
31 changes: 17 additions & 14 deletions src/client/templates/account/reset-password.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<template name="resetPassword">
<div class="reset-password">
<div class="page-title">{{_ 'reset-password--page-title'}}</div>
<form id="login--form" class="login--form">
<div class="login--wrapper">
<label><b>{{_ 'reset-password--new-password'}}</b></label><br />
<input type="password" name="" class="form-control" id="password" value=""><br />
</div>
<div class="login--button-wrapper">
<button type="submit" class="button button-primary reset-password--button-submit">{{_ 'reset-password--button-submit'}}</button>
</div>
</form>
<div class="login--register-link-wrapper">
<span>{{_ 'login--register'}}<br /><br />
<a href="{{pathFor 'register'}}"> {{_ 'login--register-link'}}</a> !
</span>
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-12 col-lg-8 pt-4 pl-4 pr-4 pb-3 text-center">
<h1 class="mb-5">{{_ 'reset-password--page-title'}}</h1>
<div class="text-justify">
<form id="login--form" class="login--form">
<div class="login--wrapper">
<label><b>{{_ 'reset-password--new-password'}}</b></label><br />
<input type="password" name="" class="form-control" id="password" value=""><br />
</div>
<div class="login--button-wrapper">
<button type="button" class="btn btn-primary w-100 reset-password--button-submit">{{_ 'reset-password--button-submit'}}</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</template>
7 changes: 7 additions & 0 deletions src/client/templates/account/reset-password.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Template.resetPassword.onRendered(function () {

// Enable autofocus
$('#password').focus();
});


Template.resetPassword.events({

'submit form': function(e) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/templates/admin/admin_space_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Template.adminSpaceSubmit.onRendered(function () {
"spaceName": {
required: true,
minlength: 3,
maxlength: 20
maxlength: 35
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/client/templates/headers/space_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<nav class="bg-white" style="z-index:500;height:52px;line-height:52px;border-bottom:solid 1px #efefef;">
<div class="container h-100">
<div class="row justify-content-center h-100">
<div class="col-4 col-lg-3" style="">
<div class="col-4 col-lg-4" style="">
<a role="button" id="sidebarCollapse" class="btn-icon d-inline d-lg-none">
<i class="fas fa-bars fa-lg d-inline"></i>
</a>
Expand All @@ -11,7 +11,7 @@
</a>
<span class="d-none d-sm-none d-lg-inline">{{space.title}}</span>
</div>
<div class="col-8 text-right">
<div class="col-8 col-lg-7 text-right">
{{#if ownSpace}}
<a href="{{pathFor 'userSettings'}}" class="px-3 mr-4">
<i class="fa fa-user fa-fw"></i>
Expand Down
6 changes: 3 additions & 3 deletions src/client/templates/headers/users_header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template name="usersHeader">
<nav class="bg-white" style="z-index:500;height:52px;line-height:52px;border-bottom:solid 1px #efefef;">
<div class="container h-100">
<div class="row justify-content-center">
<div class="row justify-content-center h-100">
<div class="col-6" style="">
<a class="navbar-brand menu-item" data-id="1" href="#">
<img alt="logo" height="55" src="/img/logo_black.svg">
<a class="menu-item h-100" href="#">
<img alt="logo" style="height: 55px; padding: 0px 10px 5px 0;" src="/img/logo_black.svg">
</a>
<span>{{space.title}}</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/client/templates/space/home/home_post_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h5 class="modal-title" id="exampleModalLabel">{{_ 'home-post-edit--title'}}</h5
<form name="home-post-edit--form" id="home-post-edit--form">

<div class="form-group">
<input type="text" class="form-control" name="title" id="title" aria-describedby="title" placeholder="Title of the section" value="{{post.title}}"></div>
<input type="text" class="form-control" name="title" id="title" aria-describedby="title" placeholder="{{_ 'home-post-submit--placeholder'}}" value="{{post.title}}"></div>
<div class="form-group">

<textarea name="body" id="body-edit-tinymce" class="form-control home-post-edit--textarea" placeholder="" aria-label="" aria-describedby="basic-addon2">{{post.body}}</textarea>
Expand Down
4 changes: 2 additions & 2 deletions src/client/templates/space/settings/general_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Template.generalSettings.events({

var newName = prompt(TAPi18n.__('space-edit--rename-space-message')+" :", this.space.title);
if (newName && newName != currentSpaceName && newName !="") {
if (newName.length < 4 || newName.length > 19) {
alert("The name must be at least 3 characters and at most 20");
if (newName.length < 4 || newName.length > 35) {
alert("The name must be at least 3 characters and at most 35");
}
else {
var spaceProperties = {
Expand Down
1 change: 1 addition & 0 deletions src/client/templates/space/space_sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template name="spaceSidebar">
<div class="bg-beekee pt-5 d-lg-none">
<img style="height: 80px;" class="pl-2 pb-2 mt-3" alt="logo" src="/img/logo_white.svg">
<div class="pl-2 pb-2 small">{{space.title}}</div>
</div>
<ul class="sidebar nav flex-column align-items-start justify-content-between">
<li class="nav-item sidebar-item {{selectedMenuItemBg 1}}">
Expand Down
2 changes: 1 addition & 1 deletion src/client/templates/space/space_submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Template.spaceSubmit.onRendered(function () {
"spaceName": {
required: true,
minlength: 3,
maxlength: 20
maxlength: 35
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/client/templates/space/space_users.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ <h4>{{_ 'space-users--page-title'}}</h4>
<div class="text-secondary">{{numChars}}/15</div>
</div>
<div class="text-right">
<a href="{{pathFor 'space' _id=this.space._id}}" role="button" class="btn btn-secondary">Cancel</a>
<a href="#" role="button" class="btn btn-primary space-users--button-submit-author">Change</a>
<a href="{{pathFor 'space' _id=this.space._id}}" role="button" class="btn btn-secondary">{{_ 'modal--cancel'}}</a>
<a href="#" role="button" class="btn btn-primary space-users--button-submit-author">{{_ 'modal--submit'}}</a>
</div>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h4>{{_ 'space-users-first-connection--page-title'}}</h4>
<p class="text-secondary">{{_ 'space-users--page-description'}}</p>
<form id="space-users--form" name="space-users--form">
<div class="form-group">
<input type="text" class="form-control" id="space-users--input" aria-describedby="emailHelp" placeholder="{{_ 'space-users--input-choose-author-placeholder'}}">
<input type="text" class="form-control" id="space-users-first-connection--author-name" aria-describedby="emailHelp" placeholder="{{_ 'space-users--input-choose-author-placeholder'}}">
</div>
<div class="text-right">
<a href="{{pathFor 'indexStudent'}}" role="button" class="btn btn-secondary">Cancel</a>
Expand Down
9 changes: 8 additions & 1 deletion src/client/templates/space/space_users_first_connection.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
Template.spaceUsersFirstConnection.onRendered(function () {

// Enable autofocus
$('#space-users-first-connection--author-name').focus();
});


Template.spaceUsersFirstConnection.events({

'submit form': function(event, template) {
event.preventDefault();

var authorName = $('#space-users--input').val().trim();
var authorName = $('#space-users-first-connection--author-name').val().trim();

if (authorName != "") {
if (Authors.findOne({name:authorName})) {
Expand Down
8 changes: 7 additions & 1 deletion src/lib/collections/authors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ Authors.allow({
Meteor.methods({

authorInsert: function(name, spaceId) {
Authors.insert({name: name, spaceId: spaceId, nRefs: 0});
Authors.insert({name: name, spaceId: spaceId, nRefs: 0},function(error) {
if (error) {
console.log("Error when inserting author : "+error.message);
} else {
console.log("Author inserted");
}
});
},
authorEdit: function(spaceId, oldName, newName) {
var author = Authors.findOne({name: oldName, spaceId: spaceId});
Expand Down
4 changes: 4 additions & 0 deletions src/lib/collections/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ Meteor.methods({
// postFromCloud: postFromCloud // Workaround bug sync
});

// Get client IP address
if (Meteor.isServer)
post = _.extend(postAttributes, {clientIP: this.connection.clientAddress});

var space = Spaces.findOne(postAttributes.spaceId);

category = Categories.findOne({spaceId: postAttributes.spaceId, name: postAttributes.category}); // Increment category nRefs
Expand Down
1 change: 1 addition & 0 deletions src/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"home-post-submit--placeholder":"Title of the section",
"home-post-submit--confirm-toast":"The new section has been added.",
"modal--close":"Close",
"modal--cancel":"Cancel",
"modal--delete":"Delete",
"modal--submit":"Submit",
"modal--save":"Save changes",
Expand Down
1 change: 1 addition & 0 deletions src/lib/i18n/fr-FR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"home-post-delete--title":"Supprimer cette section",
"home-post-delete--confirm":"Supprimer cette section ?",
"modal--close":"Fermer",
"modal--cancel":"Annuler",
"modal--delete":"Supprimer",
"modal--save":"Sauver les changements",
"modal--submit":"Soumettre",
Expand Down
1 change: 1 addition & 0 deletions src/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<meta name="google-site-verification" content="YxY2zGSnW7iGyAkXqQjh21ZrI9CTQhOFUztqlrbDeY4" />
<link rel="stylesheet" href="/fonts/font-awesome/css/fontawesome-all.min.css">
<link rel="stylesheet" href="/fonts/ionicons/css/ionicons.min.css">
<link rel="shortcut icon" type="image/ico" href="/img/favicon.png" />
</head>
2 changes: 1 addition & 1 deletion src/private/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.29"
"version": "1.3"
}
12 changes: 6 additions & 6 deletions src/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ Meteor.startup(function() {

// ### Mail configuration ###
process.env.MAIL_URL = 'smtp://'+Meteor.settings.mailAddress+':'+Meteor.settings.mailPassword+'@'+Meteor.settings.mailServer;
Accounts.emailTemplates.from = "beekee.ch <[email protected]>";
Accounts.emailTemplates.from = "Beekee Live <[email protected]>";

// Reset Password mail configuration
Accounts.emailTemplates.resetPassword.text = function (user, url) {
return "Hi, \n\n You recently requested to reset your password for your Beekee account.\n\n Click the link below to reset it. : \n"
return "Hi, \n\n You recently requested to reset your password for your Beekee Live account.\n\n Click the link below to reset it. : \n"
+ url
+ "\n\n If you did not requested a password reset, please ignore this email."
+ "\n\n Thanks,"
+ "\n\n Beekee Team";
+ "\n\n Beekee Live Team";
};
Accounts.emailTemplates.resetPassword.subject = function () {
return "Reset your Beekee password";
return "Reset your Beekee Live password";
};

Accounts.urls.resetPassword = function(token) {
return 'http://web.beekee.ch/reset-password/' + token;
return 'http://live.beekee.ch/reset-password/' + token;
};
});

Expand All @@ -37,7 +37,7 @@ Meteor.methods({
to: to,
from: from,
subject: subject,
text: text
html: text
});
},
'adminSetNewPassword': function(adminId, userId, newPassword) { // Admin can forcibly change the password for a user
Expand Down

0 comments on commit 7c735a5

Please sign in to comment.