mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
working on Instagram example; use forms-upload package
This commit is contained in:
parent
a5d8202f27
commit
7fd6cce117
14 changed files with 23 additions and 24 deletions
|
@ -52,6 +52,7 @@
|
|||
"react-cookie": "^0.4.6",
|
||||
"react-datetime": "^2.3.2",
|
||||
"react-dom": "^15.4.1",
|
||||
"react-dropzone": "^3.12.2",
|
||||
"react-helmet": "^3.1.0",
|
||||
"react-intl": "^2.1.3",
|
||||
"react-redux": "^5.0.1",
|
||||
|
|
|
@ -20,7 +20,7 @@ const HeaderLoggedIn = ({currentUser}) =>
|
|||
|
||||
</div>
|
||||
|
||||
<Components.ModalTrigger label="Upload" size="small">
|
||||
<Components.ModalTrigger label="Upload">
|
||||
<PicsNewForm />
|
||||
</Components.ModalTrigger>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const PicsDetails = ({loading, document, currentUser}) => {
|
|||
|
||||
<div className="pics-details">
|
||||
|
||||
<div className="pics-details-image"><img src={`http://vulcanjs.org/photos/${document.imageUrl}`}/></div>
|
||||
<div className="pics-details-image"><img src={document.imageUrl}/></div>
|
||||
|
||||
<div className="pics-details-sidebar">
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ const PicsImage = ({imageUrl, onClick}) =>
|
|||
|
||||
<div className="pics-image" onClick={onClick}>
|
||||
|
||||
<img src={`http://vulcanjs.org/photos/${imageUrl}`}/>
|
||||
<img src={imageUrl}/>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -9,16 +9,16 @@ import { Components, registerComponent, withCurrentUser, getFragment } from 'met
|
|||
|
||||
import Pics from '../../modules/pics/collection.js';
|
||||
|
||||
const PicsNewForm = ({currentUser}) =>
|
||||
const PicsNewForm = ({currentUser, closeModal}) =>
|
||||
|
||||
<div>
|
||||
|
||||
{Pics.options.mutations.new.check(currentUser) ?
|
||||
<div style={{marginBottom: '20px', paddingBottom: '20px', borderBottom: '1px solid #ccc'}}>
|
||||
<h4>Insert New Document</h4>
|
||||
<Components.SmartForm
|
||||
collection={Pics}
|
||||
mutationFragment={getFragment('PicsItemFragment')}
|
||||
successCallback={closeModal}
|
||||
/>
|
||||
</div> :
|
||||
null
|
||||
|
|
|
@ -10,7 +10,6 @@ import resolvers from './resolvers.js';
|
|||
import './fragments.js';
|
||||
import mutations from './mutations.js';
|
||||
import './permissions.js';
|
||||
import './parameters.js';
|
||||
|
||||
const Comments = createCollection({
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// import { addCallback } from 'meteor/vulcan:core';
|
||||
|
||||
// function sortByCreatedAt (parameters, terms) {
|
||||
// return {
|
||||
// selector: parameters.selector,
|
||||
// options: {...parameters.options, sort: {createdAt: 1}}
|
||||
// };
|
||||
// }
|
||||
|
||||
// addCallback('comments.parameters', sortByCreatedAt);
|
|
@ -1,3 +0,0 @@
|
|||
import { Utils } from 'meteor/vulcan:core';
|
||||
|
||||
Utils.icons.comment = 'comment';
|
|
@ -1,9 +1,10 @@
|
|||
import { replaceComponent } from 'meteor/vulcan:core';
|
||||
import { replaceComponent, Utils } from 'meteor/vulcan:core';
|
||||
import './pics/collection.js';
|
||||
import './comments/collection.js';
|
||||
|
||||
import Layout from '../components/common/Layout.jsx';
|
||||
replaceComponent('Layout', Layout);
|
||||
|
||||
Utils.icons.comment = 'comment';
|
||||
|
||||
import './routes.js';
|
||||
import './icons.js';
|
||||
|
|
|
@ -4,6 +4,9 @@ A SimpleSchema-compatible JSON schema
|
|||
|
||||
*/
|
||||
|
||||
import { getSetting } from 'meteor/vulcan:core';
|
||||
import Upload from 'meteor/vulcan:forms-upload';
|
||||
|
||||
const schema = {
|
||||
|
||||
// default properties
|
||||
|
@ -34,6 +37,12 @@ const schema = {
|
|||
viewableBy: ['guests'],
|
||||
insertableBy: ['members'],
|
||||
editableBy: ['members'],
|
||||
control: Upload,
|
||||
form: {
|
||||
options: {
|
||||
preset: getSetting('cloudinaryPresets').pics
|
||||
},
|
||||
}
|
||||
},
|
||||
body: {
|
||||
label: 'Body',
|
||||
|
|
|
@ -29,7 +29,7 @@ var createPic = function (imageUrl, createdAt, body, username) {
|
|||
|
||||
const pic = {
|
||||
createdAt,
|
||||
imageUrl,
|
||||
imageUrl: `http://vulcanjs.org/photos/${imageUrl}`,
|
||||
body,
|
||||
isDummy: true,
|
||||
userId: user._id
|
||||
|
|
|
@ -9,7 +9,8 @@ Package.onUse(function (api) {
|
|||
'vulcan:forms',
|
||||
'vulcan:routing',
|
||||
'vulcan:accounts',
|
||||
|
||||
'vulcan:forms-upload',
|
||||
|
||||
'fourseven:scss',
|
||||
]);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
capitalize
|
||||
} from '../../helpers.js';
|
||||
|
||||
const loggingInMessage = 'Logging In...';
|
||||
const loggingInMessage = 'accounts.logging_in';
|
||||
|
||||
export class AccountsLoginForm extends Tracker.Component {
|
||||
constructor(props) {
|
||||
|
|
|
@ -30,6 +30,7 @@ addStrings('en', {
|
|||
"accounts.or_use": "or use",
|
||||
"accounts.info_email_sent": "Email sent.",
|
||||
"accounts.info_password_changed": "Password changed.",
|
||||
"accounts.logging_in": "Logging in…",
|
||||
|
||||
"forms.submit": "Submit",
|
||||
"forms.cancel": "Cancel",
|
||||
|
|
Loading…
Add table
Reference in a new issue