Added Fires page, collection and fire comments
This commit is contained in:
parent
3bf21c8caf
commit
40aedbfdfb
19 changed files with 290 additions and 66 deletions
42
imports/startup/client/comments.js
Normal file
42
imports/startup/client/comments.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* global Comments */
|
||||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import i18n from '/imports/startup/client/i18n';
|
||||
import '/imports/startup/common/comments';
|
||||
|
||||
import './comments.scss';
|
||||
|
||||
i18n.init((err, t) => {
|
||||
Comments.ui.setContent({
|
||||
title: ' ', // i18n.t('Comentarios'),
|
||||
save: t('Guardar'),
|
||||
reply: t('Responder'),
|
||||
edit: t('Editar'),
|
||||
remove: t('Borrar'),
|
||||
'placeholder-textarea': t('Añadir un comentario'),
|
||||
'add-button-reply': t('Añadir una respuesta'),
|
||||
'add-button': t('Añadir comentario'),
|
||||
'you-need-to-login': t('Necesitas iniciar sesión para'),
|
||||
'add comments': t('añadir comentarios'),
|
||||
'like comments': t('puntuar comentarios'),
|
||||
'rate comments': t('puntuar comentarios'),
|
||||
'add replies': t('responder'),
|
||||
'load-more': t('Más comentarios')
|
||||
});
|
||||
|
||||
/* This in client side */
|
||||
Comments.ui.config({
|
||||
limit: 20, // default 10
|
||||
loadMoreCount: 20, // default 20
|
||||
generateAvatar: function genAvatar(user, isAnonymous) {
|
||||
if (isAnonymous) {
|
||||
return i18n.t('Anónimo');
|
||||
}
|
||||
return user.profile && user.profile.name && user.profile.name.first ? user.profile.name.first : null;
|
||||
},
|
||||
template: 'bootstrap', // default 'semantic-ui'
|
||||
// default 'http://s3.amazonaws.com/37assets/svn/765-default-avatar.png'
|
||||
defaultAvatar: '/default-avatar.png',
|
||||
markdown: false
|
||||
});
|
||||
});
|
||||
29
imports/startup/client/comments.scss
Normal file
29
imports/startup/client/comments.scss
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
.comments-section {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.comments-box {
|
||||
max-width: inherit;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p.comment-content {
|
||||
/* white-space: pre-line; */
|
||||
}
|
||||
|
||||
/* remove comment btn danger style */
|
||||
|
||||
div.media-body.comment> div> div> div.btn.btn-danger.remove-action {
|
||||
background-color: white;
|
||||
border: 1px solid rgb(204, 204, 204);
|
||||
color: rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
/* text-area height */
|
||||
.form-control .create-comment {
|
||||
height: 9em;
|
||||
}
|
||||
|
||||
.img-avatar {
|
||||
margin-right: 5px;
|
||||
}
|
||||
16
imports/startup/common/comments.js
Normal file
16
imports/startup/common/comments.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* global Comments */
|
||||
|
||||
// Client and Server
|
||||
Comments.config({
|
||||
rating: 'likes-and-dislikes',
|
||||
allowAnonymous: () => true,
|
||||
anonymousSalt: 'klasddl3lala0l3lasdlas0ol3lasdlao3lasdoaslaldal3lasdclasdlal3lasdladlaq',
|
||||
publishUserFields: {
|
||||
profile: 1
|
||||
},
|
||||
generateUsername: function genUser(user) {
|
||||
console.log(JSON.stringify(user));
|
||||
// FIXME
|
||||
return user.profile && user.profile.name && user.profile.name.first ? user.profile.name.first : '';
|
||||
}
|
||||
});
|
||||
|
|
@ -54,6 +54,9 @@ export function localize() {
|
|||
return { location: { latitude: 40.4146500, longitude: -3.7004000 } };
|
||||
}
|
||||
|
||||
export const gmapKey = process.env.GMAPS_KEY || Meteor.settings.gmaps.key;
|
||||
export const gmapServerKey = Meteor.settings.gmaps.serverKey;
|
||||
|
||||
Meteor.methods({
|
||||
geo: localize,
|
||||
getMapKey() {
|
||||
|
|
@ -61,6 +64,6 @@ Meteor.methods({
|
|||
// https://developers.google.com/maps/documentation/javascript/get-api-key
|
||||
// https://console.developers.google.com/
|
||||
// export GMAPS_KEY=SomeGMapsKey
|
||||
return process.env.GMAPS_KEY || Meteor.settings.gmaps.key;
|
||||
return gmapKey;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,3 +6,4 @@ import './email';
|
|||
import './IPGeocoder';
|
||||
import './migrations';
|
||||
import './notificationsObserver';
|
||||
import '../common/comments';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue