Merge branch 'devel'

# Conflicts:
#	README.md
This commit is contained in:
Sacha Greif 2016-08-29 08:56:34 +09:00
commit d64c0f689f
224 changed files with 2864 additions and 2596 deletions

View file

@ -11,3 +11,6 @@ notices-for-facebook-graph-api-2
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.3.5-remove-old-dev-bundle-link
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package

1
.meteor/.gitignore vendored
View file

@ -1,2 +1,3 @@
dev_bundle
local
meteorite

View file

@ -20,6 +20,7 @@ nova:api
nova:rss
nova:kadira
nova:email
nova:subscribe
############ Customizable Packages ############
@ -29,7 +30,7 @@ nova:base-routes
nova:email-templates
nova:i18n-en-us
accounts-password
accounts-password@1.3.0
# accounts-twitter
# accounts-facebook
@ -39,4 +40,4 @@ nova:debug
############ Your Packages ############
# my-custom-package
# my-custom-package

View file

@ -1 +1 @@
METEOR@1.3.2.4
METEOR@1.4.1.1

View file

@ -1,74 +1,74 @@
accounts-base@1.2.7
accounts-password@1.1.8
aldeed:collection2@2.9.1
aldeed:collection2-core@1.1.1
aldeed:schema-deny@1.0.1
aldeed:schema-index@1.0.1
accounts-base@1.2.11
accounts-password@1.3.0
aldeed:collection2@2.10.0
aldeed:collection2-core@1.2.0
aldeed:schema-deny@1.1.0
aldeed:schema-index@1.1.0
aldeed:simple-schema@1.5.3
allow-deny@1.0.4
autoupdate@1.2.9
babel-compiler@6.6.4
babel-runtime@0.1.8
base64@1.0.8
binary-heap@1.0.8
blaze@2.1.7
blaze-tools@1.0.8
boilerplate-generator@1.0.8
caching-compiler@1.0.4
callback-hook@1.0.8
check@1.2.1
allow-deny@1.0.5
autoupdate@1.3.11
babel-compiler@6.9.1
babel-runtime@0.1.11
base64@1.0.9
binary-heap@1.0.9
blaze@2.1.8
blaze-tools@1.0.9
boilerplate-generator@1.0.9
caching-compiler@1.1.7
callback-hook@1.0.9
check@1.2.3
chuangbo:cookie@1.1.0
coffeescript@1.0.17
coffeescript@1.2.4_1
dburles:collection-helpers@1.0.4
ddp@1.2.5
ddp-client@1.2.7
ddp-common@1.2.5
ddp-rate-limiter@1.0.4
ddp-server@1.2.6
ddp-client@1.3.1
ddp-common@1.2.6
ddp-rate-limiter@1.0.5
ddp-server@1.3.10
deps@1.0.12
diff-sequence@1.0.5
ecmascript@0.4.3
ecmascript-runtime@0.2.10
ejson@1.0.11
email@1.0.12
diff-sequence@1.0.6
ecmascript@0.5.8
ecmascript-runtime@0.3.14
ejson@1.0.12
email@1.1.17
fortawesome:fontawesome@4.5.0
fourseven:scss@3.4.3
geojson-utils@1.0.8
fourseven:scss@3.9.0
geojson-utils@1.0.9
hot-code-push@1.0.4
html-tools@1.0.9
htmljs@1.0.9
http@1.1.5
id-map@1.0.7
html-tools@1.0.10
htmljs@1.0.10
http@1.2.9
id-map@1.0.8
jparker:crypto-core@0.1.0
jparker:crypto-md5@0.1.1
jparker:gravatar@0.5.1
jquery@1.11.8
jquery@1.11.9
kadira:debug@3.2.2
kadira:runtime-dev@0.0.1
livedata@1.0.18
localstorage@1.0.9
logging@1.0.12
matb33:collection-hooks@0.8.1
mdg:validation-error@0.2.0
meteor@1.1.14
localstorage@1.0.11
logging@1.1.15
matb33:collection-hooks@0.8.4
mdg:validation-error@0.5.1
meteor@1.2.17
meteor-base@1.0.4
meteorhacks:fast-render@2.14.0
meteorhacks:fast-render@2.16.0
meteorhacks:inject-data@2.0.0
meteorhacks:inject-initial@1.0.4
meteorhacks:kadira@2.28.7
meteorhacks:kadira-binary-deps@1.4.0
meteorhacks:kadira-profiler@1.2.1
meteorhacks:kadira@2.30.0
meteorhacks:kadira-binary-deps@1.5.0
meteorhacks:kadira-profiler@1.3.0
meteorhacks:meteorx@1.4.1
meteorhacks:picker@1.0.3
meteorhacks:subs-manager@1.6.4
meteorhacks:unblock@1.1.0
minifier-css@1.1.11
minifier-js@1.1.11
minimongo@1.0.16
modules@0.6.1
modules-runtime@0.6.3
mongo@1.1.7
mongo-id@1.0.4
minifier-css@1.2.14
minifier-js@1.2.14
minimongo@1.0.17
modules@0.7.6
modules-runtime@0.7.6
mongo@1.1.12
mongo-id@1.0.5
mongo-livedata@1.0.12
nova:api@0.26.5-nova
nova:base-components@0.26.5-nova
@ -93,48 +93,50 @@ nova:posts@0.26.5-nova
nova:rss@0.26.5-nova
nova:search@0.26.5-nova
nova:settings@0.26.5-nova
nova:subscribe@0.26.5-nova
nova:users@0.26.5-nova
nova:voting@0.26.5-nova
npm-bcrypt@0.8.7
npm-mongo@1.4.43
observe-sequence@1.0.11
ordered-dict@1.0.7
npm-bcrypt@0.9.1
npm-mongo@1.5.48
observe-sequence@1.0.12
ordered-dict@1.0.8
peerlibrary:assert@0.2.5
peerlibrary:fiber-utils@0.6.0
peerlibrary:reactive-mongo@0.1.1
peerlibrary:reactive-publish@0.2.0
peerlibrary:server-autorun@0.5.2
percolatestudio:synced-cron@1.1.0
promise@0.6.7
promise@0.8.4
raix:eventemitter@0.1.3
random@1.0.9
rate-limit@1.0.4
random@1.0.10
rate-limit@1.0.5
react-meteor-data@0.2.9
reactive-dict@1.1.7
reactive-var@1.0.9
reactive-dict@1.1.8
reactive-var@1.0.10
reactrouter:react-router-ssr@3.1.4
reload@1.1.8
retry@1.0.7
routepolicy@1.0.10
service-configuration@1.0.9
session@1.1.5
sha@1.0.7
reload@1.1.10
retry@1.0.8
routepolicy@1.0.11
service-configuration@1.0.10
session@1.1.6
sha@1.0.8
shell-server@0.2.1
softwarerero:accounts-t9n@1.3.4
spacebars@1.0.11
spacebars-compiler@1.0.11
srp@1.0.8
standard-minifier-css@1.0.6
standard-minifier-js@1.0.6
spacebars@1.0.12
spacebars-compiler@1.0.12
srp@1.0.9
standard-minifier-css@1.2.0
standard-minifier-js@1.2.0
standard-minifiers@1.0.6
std:accounts-ui@1.2.6
tmeasday:check-npm-versions@0.3.1
tmeasday:publish-counts@0.7.3
tracker@1.0.13
tracker@1.1.0
ui@1.0.11
underscore@1.0.8
url@1.0.9
utilities:react-list-container@0.1.12
underscore@1.0.9
url@1.0.10
utilities:react-list-container@0.1.14
utilities:smart-methods@0.1.5
utilities:smart-publications@0.1.4
webapp@1.2.8
webapp@1.3.11
webapp-hashing@1.0.9

View file

@ -41,25 +41,27 @@ Note that both versions use the same data format, so you can go back and forth b
[Install Meteor](https://www.meteor.com/install):
```
```sh
curl https://install.meteor.com/ | sh
```
Clone this repository locally:
```sh
git clone git@github.com:TelescopeJS/Telescope.git
```
git clone https://github.com/TelescopeJS/Telescope.git
```
(or `https://github.com/TelescopeJS/Telescope.git`)
Install the necessary NPM packages:
```
```sh
npm install
```
Then run the app with:
```
```sh
meteor
```
@ -130,7 +132,7 @@ Just like Settings, you can specify categories either via the in-app UI or via `
To add new social login options, you'll first need to add your API keys to your `settings.json` file. For example:
```
```json
"oAuth": {
"twitter": {
"consumerKey": "foo",
@ -147,7 +149,7 @@ To add new social login options, you'll first need to add your API keys to your
Then, add the relevant Meteor package:
```
```sh
meteor add accounts-twitter accounts-facebook
```

View file

@ -5,11 +5,12 @@
"npm": "^3.0"
},
"dependencies": {
"bcrypt": "^0.8.7",
"bootstrap": "^4.0.0-alpha.2",
"classnames": "^2.2.3",
"escape-string-regexp": "^1.0.5",
"formsy-react": "^0.18.0",
"formsy-react-components": "^0.7.1",
"formsy-react": "^0.18.1",
"formsy-react-components": "^0.8.1",
"handlebars": "^4.0.5",
"history": "^3.0.0",
"html-to-text": "^2.1.0",

View file

@ -1 +0,0 @@
.build*

View file

@ -1,69 +0,0 @@
accounts-base@1.2.0
aldeed:autoform@5.1.2
aldeed:simple-schema@1.3.2
base64@1.0.3
binary-heap@1.0.3
blaze@2.1.2
blaze-tools@1.0.3
boilerplate-generator@1.0.3
callback-hook@1.0.3
cfs:http-methods@0.0.28
check@1.0.5
cmather:handlebars-server@0.2.0
coffeescript@1.0.6
ddp@1.1.0
deps@1.0.7
ejson@1.0.6
fourseven:scss@2.1.1
geojson-utils@1.0.3
handlebars@1.0.3
html-tools@1.0.4
htmljs@1.0.4
id-map@1.0.3
iron:controller@1.0.7
iron:core@1.0.7
iron:dynamic-template@1.0.7
iron:layout@1.0.7
iron:location@1.0.7
iron:middleware-stack@1.0.7
iron:router@1.0.7
iron:url@1.0.7
jquery@1.11.3_2
json@1.0.3
kestanous:herald@1.3.0
kestanous:herald-email@0.5.0
livedata@1.0.13
localstorage@1.0.3
logging@1.0.7
meteor@1.1.6
minifiers@1.1.5
minimongo@1.0.8
momentjs:moment@2.8.4
mongo@1.1.0
observe-sequence@1.0.6
ordered-dict@1.0.3
random@1.0.3
reactive-dict@1.1.0
reactive-var@1.0.5
retry@1.0.3
routepolicy@1.0.5
service-configuration@1.0.4
session@1.1.0
spacebars@1.0.6
spacebars-compiler@1.0.6
tap:i18n@1.4.1
nova:email@0.3.0
nova:i18n@0.1.0
nova:lib@0.3.1
nova:messages@0.1.0
nova:notifications@0.1.0
nova:posts@0.1.2
nova:settings@0.1.0
nova:subscribe-to-posts@0.1.0
nova:users@0.1.0
templating@1.1.1
tracker@1.0.7
ui@1.0.6
underscore@1.0.3
webapp@1.2.0
webapp-hashing@1.0.3

View file

@ -1 +0,0 @@
Telescope subscribe to posts package, used internally.

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Odebírané příspěvky",
"subscribe_to_thread" : "Odebírat komentáře",
"unsubscribe_from_thread" : "Odhlásit se z odběru komentářů"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Subscribed Posts",
"subscribe_to_thread" : "Subscribe to comment thread",
"unsubscribe_from_thread" : "Unsubscribe from comment thread"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Posts suscritos",
"subscribe_to_thread" : "Suscribirse a esta conversación",
"unsubscribe_from_thread" : "Cancelar la suscripción a esta conversación"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Tellitud postitused",
"subscribe_to_thread" : "Liitu, et teemat kommenteerida",
"unsubscribe_from_thread" : "Loobu teema kommenteerimisest"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "مشترک پست ها",
"subscribe_to_thread" : "مشترک شدن به رشته نظرات",
"unsubscribe_from_thread" : "لغو اشتراک از رشته نظرات"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Posts auxquels vous êtes abonnés",
"subscribe_to_thread" : "S'abonner au fil de commentaires",
"unsubscribe_from_thread" : "Se désabonner du fil de commentaires"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Postingan yang Terlanggan",
"subscribe_to_thread" : "Berlangganan komentar thread ini",
"unsubscribe_from_thread" : "Berhenti berlangganan dari komentar thread ini"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "구독 게시물",
"subscribe_to_thread" : "댓글 구독하기",
"unsubscribe_from_thread" : "댓글 구독취소"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Posty które subskrybujesz",
"subscribe_to_thread" : "Subskrybuj",
"unsubscribe_from_thread" : "Nie subskrybuj"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Postagens inscritas",
"subscribe_to_thread" : "Inscreva-se aos comentários",
"unsubscribe_from_thread" : "Desinscreva-se dos comentários"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Naročnine na Objave",
"subscribe_to_thread" : "Naročite se na komentarje",
"unsubscribe_from_thread" : "Odjavite se od komentarjev"
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "Bevakade inlägg",
"subscribe_to_thread" : "Prenumerera på kommentarstråd",
"unsubscribe_from_thread" : "Avprenumerera på kommentarstråd"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,5 +0,0 @@
{
"subscribed_posts" : "İzlenen Gönderiler",
"subscribe_to_thread" : "Yorum dizisini izle",
"unsubscribe_from_thread" : "Yorum dizisini izlemeyi bırak"
}

View file

@ -1,2 +0,0 @@
{
}

View file

@ -1,15 +0,0 @@
<template name="post_subscribe">
{{#if canSubscribe}}
<div class="post-subscribe module grid-block">
{{#if subscribed}}
<a class="unsubscribe-link" href="#">
<span>{{_ 'unsubscribe_from_thread'}}</span>
</a>
{{else}}
<a class="subscribe-link" href="#">
<span>{{_ 'subscribe_to_thread'}}</span>
</a>
{{/if}}
</div>
{{/if}}
</template>

View file

@ -1,47 +0,0 @@
Template.post_subscribe.helpers({
canSubscribe: function() {
// you cannot subscribe to your own posts
return Meteor.userId() && this.userId !== Meteor.userId();
},
subscribed: function() {
var user = Meteor.user();
if (!user) return false;
return _.include(this.subscribers, user._id);
}
});
Template.post_subscribe.events({
'click .subscribe-link': function(e, instance) {
e.preventDefault();
if (this.userId === Meteor.userId())
return;
var post = this;
if (!Meteor.user()) {
FlowRouter.go('signIn');
Messages.flash(__("please_log_in_first"), "info");
}
Meteor.call('subscribePost', post._id, function(error, result) {
if (result)
Events.track("post subscribed", {'_id': post._id});
});
},
'click .unsubscribe-link': function(e, instance) {
e.preventDefault();
var post = this;
if (!Meteor.user()) {
FlowRouter.go('signIn');
Messages.flash(__("please_log_in_first"), "info");
}
Meteor.call('unsubscribePost', post._id, function(error, result) {
if (result)
Events.track("post unsubscribed", {'_id': post._id});
});
}
});

View file

@ -1,6 +0,0 @@
<template name="user_subscribed_posts">
<div class="user-profile-subscribed grid grid-small grid-module ">
<h3>{{_ "subscribed_posts"}}</h3>
{{> posts_list_controller arguments}}
</div>
</template>

View file

@ -1,22 +0,0 @@
Template.user_subscribed_posts.helpers({
arguments: function () {
var user = this;
return {
template: "posts_list_compact",
options: {
currentUser: user,
fieldLabel: __("subscribedAt"),
fieldValue: function (post) {
var user = this.currentUser;
var item = _.findWhere(user.telescope.subscribedItems.Posts, {itemId: post._id});
return moment(item.subscribedAt).format("MM/DD/YYYY, HH:mm");
}
},
terms: {
view: 'userSubscribedPosts',
userId: user._id,
limit: 5
}
}
}
});

View file

@ -1,10 +0,0 @@
Meteor.publish('userSubscribedPosts', function(terms) {
if (this.userId) {
terms.currentUserId = this.userId; // add userId to terms
}
var parameters = Posts.parameters.get(terms);
var posts = Posts.find(parameters.selector, parameters.options);
return posts;
});

View file

@ -1,140 +0,0 @@
Users.addField({
fieldName: 'telescope.subscribedItems',
fieldSchema: {
type: Object,
optional: true,
blackbox: true,
autoform: {
omit: true
}
}
});
Posts.addField({
fieldName: 'subscribers',
fieldSchema: {
type: [String],
optional: true,
autoform: {
omit: true
}
}
});
Posts.addField({
fieldName: 'subscriberCount',
fieldSchema: {
type: Number,
optional: true,
autoform: {
omit: true
}
}
});
Telescope.modules.add("profileEdit", {
template: 'user_subscribed_posts',
order: 5
});
Telescope.modules.add("commentThreadBottom", {
template: 'post_subscribe',
order: 10
});
Posts.views.add("userSubscribedPosts", function (terms) {
var user = Meteor.users.findOne(terms.userId),
postsIds = [];
if (user && user.telescope.subscribedItems && user.telescope.subscribedItems.Posts) {
postsIds = _.pluck(user.telescope.subscribedItems.Posts, "itemId");
}
return {
find: {_id: {$in: postsIds}},
options: {limit: 5, sort: {postedAt: -1}}
};
});
var hasSubscribedItem = function (item, user) {
return item.subscribers && item.subscribers.indexOf(user._id) != -1;
};
var addSubscribedItem = function (userId, item, collectionName) {
var field = 'telescope.subscribedItems.' + collectionName;
var add = {};
add[field] = item;
Meteor.users.update({_id: userId}, {
$addToSet: add
});
};
var removeSubscribedItem = function (userId, itemId, collectionName) {
var field = 'telescope.subscribedItems.' + collectionName;
var remove = {};
remove[field] = {itemId: itemId};
Meteor.users.update({_id: userId}, {
$pull: remove
});
};
subscribeItem = function (collection, itemId, user) {
var item = collection.findOne(itemId),
collectionName = collection._name.slice(0,1).toUpperCase() + collection._name.slice(1);
if (!user || !item || hasSubscribedItem(item, user))
return false;
// author can't subscribe item
if (item.userId && item.userId === user._id)
return false
// Subscribe
var result = collection.update({_id: itemId, subscribers: { $ne: user._id }}, {
$addToSet: {subscribers: user._id},
$inc: {subscriberCount: 1}
});
if (result > 0) {
// Add item to list of subscribed items
var obj = {
itemId: item._id,
subscribedAt: new Date()
};
addSubscribedItem(user._id, obj, collectionName);
}
return true;
};
unsubscribeItem = function (collection, itemId, user) {
var user = Meteor.user(),
item = collection.findOne(itemId),
collectionName = collection._name.slice(0,1).toUpperCase()+collection._name.slice(1);
if (!user || !item || !hasSubscribedItem(item, user))
return false;
// Unsubscribe
var result = collection.update({_id: itemId, subscribers: user._id }, {
$pull: {subscribers: user._id},
$inc: {subscriberCount: -1}
});
if (result > 0) {
// Remove item from list of subscribed items
removeSubscribedItem(user._id, itemId, collectionName);
}
return true;
};
Meteor.methods({
subscribePost: function(postId) {
check(postId, String);
return subscribeItem.call(this, Posts, postId, Meteor.user());
},
unsubscribePost: function(postId) {
check(postId, String);
return unsubscribeItem.call(this, Posts, postId, Meteor.user());
}
});

View file

@ -1,5 +0,0 @@
{
"translation_function_name": "__",
"helper_name": "_",
"namespace": "project"
}

View file

@ -1,61 +0,0 @@
Package.describe({
name: "subscribe-to-posts",
summary: "Subscribe to posts to be notified when they get new comments",
version: "0.26.5-nova",
git: "https://github.com/TelescopeJS/telescope-subscribe-to-posts.git"
});
Package.onUse(function (api) {
api.versionsFrom("METEOR@1.0");
// --------------------------- 1. Meteor packages dependencies ---------------------------
// automatic (let the package specify where it's needed)
api.use(['nova:core@0.26.5-nova']);
// ---------------------------------- 2. Files to include ----------------------------------
// i18n config (must come first)
api.addFiles([
'package-tap.i18n'
], ['client', 'server']);
// both
api.addFiles([
'lib/subscribe-to-posts.js',
], ['client', 'server']);
// client
api.addFiles([
'lib/client/templates/post_subscribe.html',
'lib/client/templates/post_subscribe.js',
'lib/client/templates/user_subscribed_posts.html',
'lib/client/templates/user_subscribed_posts.js'
], ['client']);
// server
api.addFiles([
'lib/server/publications.js'
], ['server']);
// i18n languages (must come last)
var languages = ["ar", "bg", "cs", "da", "de", "el", "en", "es", "et", "fr", "hu", "id", "it", "ja", "kk", "ko", "nl", "pl", "pt-BR", "ro", "ru", "sl", "sv", "th", "tr", "vi", "zh-CN"];
var languagesPaths = languages.map(function (language) {
return "i18n/"+language+".i18n.json";
});
api.addFiles(languagesPaths, ["client", "server"]);
api.export([
'subscribeItem',
'unsubscribeItem'
]);
});

View file

@ -1,227 +0,0 @@
{
"dependencies": [
[
"application-configuration",
"1.0.3"
],
[
"base64",
"1.0.1"
],
[
"binary-heap",
"1.0.1"
],
[
"blaze",
"2.0.3"
],
[
"blaze-tools",
"1.0.1"
],
[
"boilerplate-generator",
"1.0.1"
],
[
"callback-hook",
"1.0.1"
],
[
"check",
"1.0.2"
],
[
"cmather:handlebars-server",
"2.0.0"
],
[
"coffeescript",
"1.0.4"
],
[
"ddp",
"1.0.11"
],
[
"deps",
"1.0.5"
],
[
"ejson",
"1.0.4"
],
[
"follower-livedata",
"1.0.2"
],
[
"geojson-utils",
"1.0.1"
],
[
"handlebars",
"1.0.1"
],
[
"html-tools",
"1.0.2"
],
[
"htmljs",
"1.0.2"
],
[
"id-map",
"1.0.1"
],
[
"iron:controller",
"1.0.0"
],
[
"iron:core",
"1.0.3"
],
[
"iron:dynamic-template",
"1.0.3"
],
[
"iron:layout",
"1.0.3"
],
[
"iron:location",
"1.0.3"
],
[
"iron:middleware-stack",
"1.0.0"
],
[
"iron:router",
"1.0.1"
],
[
"iron:url",
"1.0.3"
],
[
"jquery",
"1.0.1"
],
[
"json",
"1.0.1"
],
[
"logging",
"1.0.5"
],
[
"meteor",
"1.1.3"
],
[
"minifiers",
"1.1.2"
],
[
"minimongo",
"1.0.5"
],
[
"mongo",
"1.0.8"
],
[
"observe-sequence",
"1.0.3"
],
[
"ordered-dict",
"1.0.1"
],
[
"random",
"1.0.1"
],
[
"reactive-dict",
"1.0.4"
],
[
"reactive-var",
"1.0.3"
],
[
"retry",
"1.0.1"
],
[
"routepolicy",
"1.0.2"
],
[
"session",
"1.0.4"
],
[
"spacebars",
"1.0.3"
],
[
"spacebars-compiler",
"1.0.3"
],
[
"tap:http-methods",
"0.0.23"
],
[
"tap:i18n",
"1.2.1"
],
[
"telescope-base",
"0.0.0"
],
[
"nova:i18n",
"0.0.0"
],
[
"telescope-lib",
"0.2.9"
],
[
"templating",
"1.0.9"
],
[
"tracker",
"1.0.3"
],
[
"ui",
"1.0.4"
],
[
"underscore",
"1.0.1"
],
[
"webapp",
"1.1.4"
],
[
"webapp-hashing",
"1.0.1"
]
],
"pluginDependencies": [],
"toolVersion": "meteor-tool@1.0.35",
"format": "1.0"
}

View file

@ -3,6 +3,8 @@ Let's add a callback to the new post method that
appends a random emoji to the newly submitted post's title.
*/
import Telescope from 'meteor/nova:lib';
function PostsNewAddRandomEmoji (post, user) {
post.title = post.title + " " +_.sample(["🎉", "💎", "☠", "⏱", "🎈", "⛱"])

View file

@ -2,6 +2,8 @@
This file centralizes all our custom component overrides.
*/
import Telescope from 'meteor/nova:lib';
import CustomLogo from "./components/CustomLogo.jsx";
import CustomNewsletter from "./components/CustomNewsletter.jsx";
import CustomPostsItem from "./components/CustomPostsItem.jsx";

View file

@ -7,6 +7,7 @@ all of the class's other methods (other render
functions, event handlers, etc.).
*/
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, FormattedRelative } from 'react-intl';
import { Button } from 'react-bootstrap';

View file

@ -1,6 +1,9 @@
/*
Let's add an international label to the field added in custom_fields.js
*/
import Telescope from 'meteor/nova:lib';
Telescope.strings.en = {
...Telescope.strings.en, // get all the string translated
"posts.color": "Color" // add a new one (collection.field: "Label")

View file

@ -3,6 +3,7 @@ A new custom route for our custom page.
Browse to http://localhost:3000/my-custom-route to see it.
*/
import Telescope from 'meteor/nova:lib';
import MyCustomPage from './components/MyCustomPage.jsx';
Telescope.routes.add({name:"myCustomRoute", path:"/my-custom-route", component:MyCustomPage});

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import Posts from "meteor/nova:posts";
import Comments from "meteor/nova:comments";
import Users from 'meteor/nova:users';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage } from 'react-intl';
import NovaForm from "meteor/nova:forms";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage } from 'react-intl';
import { Button, DropdownButton, MenuItem, Modal } from 'react-bootstrap';
@ -67,7 +68,11 @@ class CategoriesList extends Component {
}
renderCategoryNewButton() {
return <div className="category-menu-item dropdown-item"><MenuItem><Button bsStyle="primary" onClick={this.openCategoryNewModal}><FormattedMessage id="categories.new"/></Button></MenuItem></div>;
return (
<Telescope.components.CanDo action="categories.new">
<div className="category-menu-item dropdown-item"><MenuItem><Button bsStyle="primary" onClick={this.openCategoryNewModal}><FormattedMessage id="categories.new"/></Button></MenuItem></div>
</Telescope.components.CanDo>
);
// const CategoriesNewForm = Telescope.components.CategoriesNewForm;
// return (
// <ModalTrigger title="New Category" component={<MenuItem className="dropdown-item post-category"><Button bsStyle="primary">New Category</Button></MenuItem>}>
@ -92,14 +97,14 @@ class CategoriesList extends Component {
id="categories-dropdown"
>
<div className="category-menu-item dropdown-item">
<LinkContainer to={{pathname:"/", query: currentQuery}} activeClassName="category-active">
<LinkContainer to={{pathname:"/", query: currentQuery}}>
<MenuItem eventKey={0}>
<FormattedMessage id="categories.all"/>
</MenuItem>
</LinkContainer>
</div>
{categories && categories.length > 0 ? categories.map((category, index) => <Telescope.components.Category key={index} category={category} index={index} openModal={_.partial(this.openCategoryEditModal, index)}/>) : null}
{Users.canDo(this.context.currentUser, "categories.new") ? this.renderCategoryNewButton() : null}
{this.renderCategoryNewButton()}
</DropdownButton>
<div>
{/* modals cannot be inside DropdownButton component (see GH issue) */}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { Button, DropdownButton, MenuItem } from 'react-bootstrap';
import classNames from "classnames";
@ -9,7 +10,11 @@ import Users from 'meteor/nova:users';
class Category extends Component {
renderEdit() {
return <a onClick={this.props.openModal} className="edit-category-link"><Telescope.components.Icon name="edit"/></a>;
return (
<Telescope.components.CanDo action="categories.edit.all">
<a onClick={this.props.openModal} className="edit-category-link"><Telescope.components.Icon name="edit"/></a>
</Telescope.components.CanDo>
);
// return (
// <ModalTrigger title="Edit Category" component={<a className="edit-category-link"><Telescope.components.Icon name="edit"/></a>}>
// <Telescope.componentsCategoriesEditForm category={this.props.category}/>
@ -28,7 +33,7 @@ class Category extends Component {
return (
<div className="category-menu-item dropdown-item">
<LinkContainer to={{pathname:"/", query: newQuery}} activeClassName="category-active">
<LinkContainer to={{pathname:"/", query: newQuery}}>
<MenuItem
eventKey={index+1}
key={category._id}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import moment from 'moment';
import { intlShape, FormattedMessage, FormattedRelative } from 'react-intl';
@ -104,8 +105,12 @@ class CommentsItem extends Component{
<Telescope.components.UsersAvatar size="small" user={comment.user}/>
<Telescope.components.UsersName user={comment.user}/>
<div className="comments-item-date"><FormattedRelative value={comment.postedAt}/></div>
{Users.canEdit(this.props.currentUser, this.props.comment) ? <a className="comment-edit" onClick={this.showEdit}><FormattedMessage id="comments.edit"/></a> : null}
{Users.canEdit(this.props.currentUser, this.props.comment) ? <a className="comment-delete" onClick={this.deleteComment}><FormattedMessage id="comments.delete"/></a> : null}
<Telescope.components.CanDo action="comments.edit" document={this.props.comment}>
<div>
<a className="comment-edit" onClick={this.showEdit}><FormattedMessage id="comments.edit"/></a>
<a className="comment-delete" onClick={this.deleteComment}><FormattedMessage id="comments.delete"/></a>
</div>
</Telescope.components.CanDo>
</div>
{this.state.showEdit ? this.renderEdit() : this.renderComment()}
</div>
@ -118,10 +123,11 @@ class CommentsItem extends Component{
CommentsItem.propTypes = {
comment: React.PropTypes.object.isRequired, // the current comment
currentUser: React.PropTypes.object, // the current user
//currentUser: React.PropTypes.object, // the current user
}
CommentsItem.contextTypes = {
currentUser: React.PropTypes.object,
actions: React.PropTypes.object,
messages: React.PropTypes.object,
events: React.PropTypes.object,

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import {injectIntl, FormattedMessage} from 'react-intl';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
class CommentsNode extends Component {

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { IntlProvider, intlShape} from 'react-intl';
import { AppComposer } from "meteor/nova:core";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
const FlashMessages = ({messages}) => {

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import Helmet from 'react-helmet';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
//import { Messages } from "meteor/nova:core";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
const Icon = ({ name, iconClass }) => {

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FlashContainer } from "meteor/nova:core";

View file

@ -14,7 +14,7 @@ Loading.propTypes = {
color: React.PropTypes.string
}
Loading.defaultPropTypes = {
Loading.defaultProps = {
color: "black"
}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import Formsy from 'formsy-react';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import NovaForm from "meteor/nova:forms";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
//import Actions from "../actions.js";
//import { Messages } from "meteor/nova:core";

View file

@ -1,3 +1,5 @@
import Telescope from 'meteor/nova:lib';
// common
Telescope.registerComponent("App", require('./common/App.jsx'));
@ -60,11 +62,7 @@ Telescope.registerComponent("CategoriesNewForm", require('./categories/Catego
// permissions
Telescope.registerComponent("CanCreatePost", require('./permissions/CanCreatePost.jsx'));
Telescope.registerComponent("CanEditPost", require('./permissions/CanEditPost.jsx'));
Telescope.registerComponent("CanView", require('./permissions/CanView.jsx'));
Telescope.registerComponent("CanViewPost", require('./permissions/CanViewPost.jsx'));
Telescope.registerComponent("CanEditUser", require('./permissions/CanEditUser.jsx'));
Telescope.registerComponent("CanDo", require('./permissions/CanDo.jsx'));
// users

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import Users from 'meteor/nova:users';
// import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';

View file

@ -1,32 +1,35 @@
import React, { PropTypes, Component } from 'react';
import { FormattedMessage } from 'react-intl';
import Users from 'meteor/nova:users';
// Deprecated way to handle permission in components, check CanDo component
const CanCreatePost = (props, context) => {
// import Telescope from 'meteor/nova:lib';
// import React, { PropTypes, Component } from 'react';
// import { FormattedMessage } from 'react-intl';
// import Users from 'meteor/nova:users';
const currentUser = context.currentUser;
// const CanCreatePost = (props, context) => {
const children = props.children;
const UsersAccountForm = Telescope.components.UsersAccountForm;
// const currentUser = context.currentUser;
if (!currentUser){
return (
<div className="log-in-message">
<h3><FormattedMessage id="users.please_log_in"/></h3>
<UsersAccountForm/>
</div>
)
} else if (Users.canDo(currentUser, "posts.new")) {
return children;
} else {
return <p><FormattedMessage id="users.cannot_post"/></p>;
}
};
// const children = props.children;
// const UsersAccountForm = Telescope.components.UsersAccountForm;
CanCreatePost.contextTypes = {
currentUser: React.PropTypes.object
};
// if (!currentUser){
// return (
// <div className="log-in-message">
// <h3><FormattedMessage id="users.please_log_in"/></h3>
// <UsersAccountForm/>
// </div>
// )
// } else if (Users.canDo(currentUser, "posts.new")) {
// return children;
// } else {
// return <p><FormattedMessage id="users.cannot_post"/></p>;
// }
// };
CanCreatePost.displayName = "CanCreatePost";
// CanCreatePost.contextTypes = {
// currentUser: React.PropTypes.object
// };
module.exports = CanCreatePost;
// CanCreatePost.displayName = "CanCreatePost";
// module.exports = CanCreatePost;

View file

@ -0,0 +1,60 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';
import Users from 'meteor/nova:users';
const CanDo = (props, context) => {
// no user login, display the login form
if (!context.currentUser && props.displayNoPermissionMessage) {
return (
<div className="log-in-message">
<h3><FormattedMessage id="users.please_log_in"/></h3>
<Telescope.components.UsersAccountForm />
</div>
);
}
// default permission, is the user allowed to perform this action?
let permission = Users.canDo(context.currentUser, props.action);
// the permission is about viewing a document, check if the user is allowed
if (props.document && props.action.indexOf('view') > -1) {
// use the permission shortcut canView on the current user and requested document
permission = Users.canView(context.currentUser, props.document);
}
// the permission is about editing a document, check if the user is allowed
if (props.document && props.action.indexOf('edit') > -1) {
// use the permission shortcut canEdit on the current user and requested document
permission = Users.canEdit(context.currentUser, props.document);
}
// the user can perform the intented action in the component: display the component,
// else: display a not allowed message
if (permission) {
return props.children;
} else {
return props.displayNoPermissionMessage ? <p><FormattedMessage id={props.noPermissionMessage}/></p> : null;
}
};
CanDo.contextTypes = {
currentUser: React.PropTypes.object
};
CanDo.propTypes = {
action: React.PropTypes.string.isRequired,
document: React.PropTypes.object,
noPermissionMessage: React.PropTypes.string,
displayNoPermissionMessage: React.PropTypes.bool,
};
CanDo.defaultProps = {
noPermissionMessage: 'app.noPermission',
displayNoPermissionMessage: false,
};
CanDo.displayName = "CanDo";
module.exports = CanDo;
export default CanDo;

View file

@ -1,21 +1,23 @@
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
// Deprecated way to handle permission in components, check CanDo component
const CanEditPost = ({user, post, children}) => {
if (Users.canEdit(user, post)) {
return children;
} else if (!user){
return <p>Please log in.</p>;
} else {
return <p>Sorry, you do not have permissions to edit this post at this time</p>;
}
};
// import React, { PropTypes, Component } from 'react';
// import Users from 'meteor/nova:users';
CanEditPost.propTypes = {
user: React.PropTypes.object,
post: React.PropTypes.object
}
// const CanEditPost = ({user, post, children}) => {
// if (Users.canEdit(user, post)) {
// return children;
// } else if (!user){
// return <p>Please log in.</p>;
// } else {
// return <p>Sorry, you do not have permissions to edit this post at this time</p>;
// }
// };
CanEditPost.displayName = "CanEditPost";
// CanEditPost.propTypes = {
// user: React.PropTypes.object,
// post: React.PropTypes.object
// }
module.exports = CanEditPost;
// CanEditPost.displayName = "CanEditPost";
// module.exports = CanEditPost;

View file

@ -1,21 +1,23 @@
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
// Deprecated way to handle permission in components, check CanDo component
const CanEditUser = ({user, userToEdit, children}) => {
if (!user){
return <p>Please log in.</p>;
} else if (Users.canEdit(user, userToEdit)) {
return children;
} else {
return <p>Sorry, you do not have permissions to edit this user at this time</p>;
}
};
// import React, { PropTypes, Component } from 'react';
// import Users from 'meteor/nova:users';
CanEditUser.propTypes = {
user: React.PropTypes.object,
userToEdit: React.PropTypes.object
}
// const CanEditUser = ({user, userToEdit, children}) => {
// if (!user){
// return <p>Please log in.</p>;
// } else if (Users.canEdit(user, userToEdit)) {
// return children;
// } else {
// return <p>Sorry, you do not have permissions to edit this user at this time</p>;
// }
// };
CanEditUser.displayName = "CanEditUser";
// CanEditUser.propTypes = {
// user: React.PropTypes.object,
// userToEdit: React.PropTypes.object
// }
module.exports = CanEditUser;
// CanEditUser.displayName = "CanEditUser";
// module.exports = CanEditUser;

View file

@ -1,20 +1,22 @@
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
// Deprecated way to handle permission in components, check CanDo component
const CanView = ({user, children}) => {
if (Users.canDo(user, "posts.view.approved.all")) {
return children;
} else if (!user){
return <p>Please log in.</p>;
} else {
return <p>Sorry, you do not have permissions to post at this time</p>;
}
};
// import React, { PropTypes, Component } from 'react';
// import Users from 'meteor/nova:users';
CanView.propTypes = {
user: React.PropTypes.object
}
// const CanView = ({user, children}) => {
// if (Users.canDo(user, "posts.view.approved.all")) {
// return children;
// } else if (!user){
// return <p>Please log in.</p>;
// } else {
// return <p>Sorry, you do not have permissions to post at this time</p>;
// }
// };
CanView.displayName = "CanView";
// CanView.propTypes = {
// user: React.PropTypes.object
// }
module.exports = CanView;
// CanView.displayName = "CanView";
// module.exports = CanView;

View file

@ -1,21 +1,23 @@
import React, { PropTypes, Component } from 'react';
import Users from 'meteor/nova:users';
// Deprecated way to handle permission in components, check CanDo component
const CanViewPost = ({user, post, children}) => {
if (Users.canView(this.props.user, this.props.document)) {
return this.props.children;
} else if (!this.props.user){
return <p>Please log in.</p>;
} else {
return <p>Sorry, you do not have permissions to post at this time</p>;
}
};
// import React, { PropTypes, Component } from 'react';
// import Users from 'meteor/nova:users';
CanViewPost.propTypes = {
user: React.PropTypes.object,
post: React.PropTypes.object
}
// const CanViewPost = ({user, post, children}) => {
// if (Users.canView(this.props.user, this.props.document)) {
// return this.props.children;
// } else if (!this.props.user){
// return <p>Please log in.</p>;
// } else {
// return <p>Sorry, you do not have permissions to post at this time</p>;
// }
// };
CanViewPost.displayName = "CanViewPost";
// CanViewPost.propTypes = {
// user: React.PropTypes.object,
// post: React.PropTypes.object
// }
module.exports = CanViewPost;
// CanViewPost.displayName = "CanViewPost";
// module.exports = CanViewPost;

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import { Link } from 'react-router';
import Posts from "meteor/nova:posts";
@ -6,7 +7,7 @@ const PostsCommenters = ({post}) => {
return (
<div className="posts-commenters">
<div className="posts-commenters-avatars">
{post.commentersArray.map(user => <Telescope.components.UsersAvatar key={user._id} user={user}/>)}
{_.take(post.commentersArray, 4).map(user => <Telescope.components.UsersAvatar key={user._id} user={user}/>)}
</div>
<div className="posts-commenters-discuss">
<Link to={Posts.getPageUrl(post)}>

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import {FormattedMessage } from 'react-intl';
import { ListContainer } from "meteor/utilities:react-list-container";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { Button } from 'react-bootstrap';
import moment from 'moment';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { ListContainer } from "meteor/utilities:react-list-container";
import moment from 'moment';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import NovaForm from "meteor/nova:forms";
@ -29,10 +30,12 @@ class PostsEditForm extends Component{
renderAdminArea() {
return (
<div className="posts-edit-form-admin">
<div className="posts-edit-form-id">ID: {this.props.post._id}</div>
<Telescope.components.PostsStats post={this.props.post} />
</div>
<Telescope.components.CanDo action="posts.edit.all">
<div className="posts-edit-form-admin">
<div className="posts-edit-form-id">ID: {this.props.post._id}</div>
<Telescope.components.PostsStats post={this.props.post} />
</div>
</Telescope.components.CanDo>
)
}
@ -41,7 +44,7 @@ class PostsEditForm extends Component{
return (
<div className="posts-edit-form">
{Users.canDo(this.context.currentUser, "posts.edit.all") ? this.renderAdminArea() : null}
{this.renderAdminArea()}
<DocumentContainer
collection={Posts}
publication="posts.single"

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { ListContainer, DocumentContainer } from "meteor/utilities:react-list-container";
import Posts from "meteor/nova:posts";
@ -22,7 +23,7 @@ class PostsHome extends Component {
terms={params}
joins={Posts.getJoins()}
component={Telescope.components.PostsList}
cacheSubscription={false}
cacheSubscription={true}
listId={params.listId}
limit={Telescope.settings.get("postsPerPage", 10)}
/>

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, FormattedRelative } from 'react-intl';
import { Button } from 'react-bootstrap';
@ -18,16 +19,16 @@ class PostsItem extends Component {
}
renderActions() {
const component = (
<ModalTrigger title="Edit Post" component={<a className="posts-action-edit"><FormattedMessage id="posts.edit"/></a>}>
<Telescope.components.PostsEditForm post={this.props.post}/>
</ModalTrigger>
);
return (
<div className="post-actions">
{Users.canEdit(this.context.currentUser, this.props.post) ? component : ""}
<Telescope.components.CanDo
action="posts.edit.all"
document={this.props.post}
>
<ModalTrigger title="Edit Post" component={<a className="posts-action-edit"><FormattedMessage id="posts.edit"/></a>}>
<Telescope.components.PostsEditForm post={this.props.post}/>
</ModalTrigger>
</Telescope.components.CanDo>
</div>
)
}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
const PostsList = ({results, currentUser, hasMore, ready, count, totalCount, loadMore, showHeader = true}) => {

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import { ListContainer } from "meteor/utilities:react-list-container";
import Categories from "meteor/nova:categories";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
const PostsLoading = props => {

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import { Button } from 'react-bootstrap';

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React, { PropTypes, Component } from 'react';
import { intlShape } from 'react-intl';
import NovaForm from "meteor/nova:forms";
@ -9,7 +10,11 @@ const PostsNewForm = (props, context) => {
const router = props.router;
return (
<Telescope.components.CanCreatePost>
<Telescope.components.CanDo
action="posts.new"
noPermissionMessage="users.cannot_post"
displayNoPermissionMessage={true}
>
<div className="posts-new-form">
<NovaForm
collection={Posts}
@ -21,7 +26,7 @@ const PostsNewForm = (props, context) => {
}}
/>
</div>
</Telescope.components.CanCreatePost>
</Telescope.components.CanDo>
)
}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import Posts from "meteor/nova:posts";
@ -13,7 +14,7 @@ const PostsPage = ({document, currentUser}) => {
<Telescope.components.PostsItem post={post}/>
<div className="posts-page-body" dangerouslySetInnerHTML={htmlBody}></div>
{post.htmlBody ? <div className="posts-page-body" dangerouslySetInnerHTML={htmlBody}></div> : null}
{/*<SocialShare url={ Posts.getLink(post) } title={ post.title }/>*/}

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import { DocumentContainer } from "meteor/utilities:react-list-container";
import Posts from "meteor/nova:posts";

View file

@ -1,3 +1,4 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
const PostsStats = ({post}) => {

View file

@ -25,13 +25,13 @@ const PostsViews = (props, context) => {
id="views-dropdown"
>
{views.map(view =>
<LinkContainer key={view} to={{pathname: "/", query: {...query, view: view}}} /*to={}*/ className="dropdown-item" activeClassName="posts-view-active">
<LinkContainer key={view} to={{pathname: "/", query: {...query, view: view}}} /*to={}*/ className="dropdown-item">
<MenuItem>
<FormattedMessage id={"posts."+view}/>
</MenuItem>
</LinkContainer>
)}
<LinkContainer to={"/daily"} /*to={{name: "posts.daily"}}*/ className="dropdown-item" activeClassName="posts-view-active">
<LinkContainer to={"/daily"} /*to={{name: "posts.daily"}}*/ className="dropdown-item">
<MenuItem className={"bar"}>
<FormattedMessage id="posts.daily"/>
</MenuItem>

View file

@ -1,18 +1,21 @@
import Telescope from 'meteor/nova:lib';
import React from 'react';
import { DocumentContainer } from "meteor/utilities:react-list-container";
import Users from 'meteor/nova:users';
const UsersAccount = (props, context) => {
const terms = props.params.slug ? {"telescope.slug": props.params.slug} : {_id: context.currentUser._id};
const terms = props.params.slug ? {"telescope.slug": props.params.slug} : context.currentUser ? {_id: context.currentUser._id } : undefined;
return (
<DocumentContainer
collection={Users}
publication="users.single"
selector={terms}
terms={terms}
documentPropName="user"
component={Telescope.components.UsersEdit}
/>
<Telescope.components.CanDo action="users.edit.own" displayNoPermissionMessage={true}>
<DocumentContainer
collection={Users}
publication="users.single"
selector={terms}
terms={terms}
documentPropName="user"
component={Telescope.components.UsersEdit}
/>
</Telescope.components.CanDo>
)
};

View file

@ -36,6 +36,15 @@ class AccountsButton extends Accounts.ui.Button {
}
class AccountsField extends Accounts.ui.Field {
// see https://github.com/studiointeract/accounts-ui/issues/60
triggerUpdate () {
const { onChange } = this.props
if (this.input) {
onChange({ target: { value: this.input.value } })
}
}
render() {
const { id, hint, label, type = 'text', onChange, className = "field", defaultValue = "" } = this.props;
const { mount = true } = this.state;

Some files were not shown because too many files have changed in this diff Show more