Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Config... Example not Clear #384

Closed
kenshinman opened this issue Apr 20, 2017 · 1 comment
Closed

Admin Config... Example not Clear #384

kenshinman opened this issue Apr 20, 2017 · 1 comment

Comments

@kenshinman
Copy link

kenshinman commented Apr 20, 2017

Hi, this is not meant to be an issue but I need help with this piece (config example) of code from the documentation:

    @AdminConfig =
    nonAdminRedirectRoute: 'entrySignIn',
    collections:
        Posts: {
            icon: 'pencil'
            tableColumns: [
              {label: 'Title', name: 'title'}
	            {label: 'Published', name: 'published'}
	            {label: 'User', name: 'owner', template: 'userEmail'}
            ]
            templates:
              new:
                name: 'postWYSIGEditor'
                data:
                  post: Session.get 'admin_doc' if Meteor.isClient
              edit:
                name: 'postWYSIGEditor'
                data:
                  post: ()-> Session.get 'admin_doc' if Meteor.isClient
            selector: (userId)->
              return {ownerId: userId}
        },
        Comments: {
            icon: 'comment'
            omitFields: ['owner']
            tableColumns: [
              {label: 'Content', name: 'content'}
              {label: 'Post', name: 'postTitle()'}
              {label: 'User', name: 'owner', template: 'userEmail'}
            ]
            showWidget: false
        }
    autoForm:
        omitFields: ['createdAt', 'updatedAt']
    dashboard:
        homeUrl: '/dashboard'
        widgets: [
          {
            template: 'adminCollectionWidget'
            data:
              collection: 'Posts'
              class: 'col-lg-3 col-xs-6'
          }
          {
            template: 'adminUserWidget'
            data:
              class: 'col-lg-3 col-xs-6'
          }
        ]

Comments.helpers({
  postTitle: function () {
    if (this.post) {
      return Posts.findOne(this.post).title;
    }
  }
});

Posts.attachSchema(Schemas.Posts)

I may be worng but I don't it's in a JavaScript format or not formatted properly.

Can someone help me format it to look like JS,.
I wrote earlier I may be wrong but i need a clearer version. Thanks Guys

Also, Is this meant to be in the server directory or client

@Fotso
Copy link

Fotso commented May 5, 2017

Hi,
this question have been answered many times...
This script is a coffee script. If you want a Javascript file just used an online converter.
Then once you have it, create a lib directory and put your script under this directory your_project_name/lib/AdminConfig.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants