Skip to content
Permalink
Browse files

maj de la base du code et mise en place fixtures perso

  • Loading branch information
Alex
Alex committed Apr 10, 2019
1 parent fc5385b commit 2dc49a45a414d5a2c78325bdd60867a2c97c8e61
@@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"rules": {
"quotes": [
2,
"single"
],
"strict": [
2,
"never"
],
"indent": 2,
"eqeqeq": [
"error",
"always"
],
"no-multi-spaces": "error",
"keyword-spacing": "error",
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/jsx-no-undef": 2,
"react/react-in-jsx-scope": 2
},
"plugins": [
"react"
]
}
@@ -19,3 +19,4 @@ autopublish@1.0.7 # Publish all data to the clients (for prototyping
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
static-html # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
kadira:flow-router
@@ -32,6 +32,7 @@ htmljs@1.0.11
id-map@1.1.0
insecure@1.0.7
inter-process-messaging@0.1.0
kadira:flow-router@2.12.1
launch-screen@1.1.1
livedata@1.0.18
logging@1.1.20
@@ -54,6 +55,7 @@ ordered-dict@1.1.0
promise@0.11.2
random@1.1.0
react-meteor-data@0.2.16
reactive-dict@1.3.0
reactive-var@1.0.11
reload@1.3.0
retry@1.1.0
No changes.
@@ -1,4 +0,0 @@
body {
padding: 10px;
font-family: sans-serif;
}
@@ -1,7 +1,9 @@
<head>
<title>whodieswhen</title>
<title>Who dies when</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css" />
<meta name="viewport" content="width=device-width, user-scalable=no">
</head>

<body>
<div id="react-target"></div>
</body>
</body>
@@ -1,8 +1 @@
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import App from '/imports/ui/App'

Meteor.startup(() => {
render(<App />, document.getElementById('react-target'));
});
import '/imports/startup/client.js'
@@ -0,0 +1,3 @@
import { Mongo } from 'meteor/mongo'

export const Characters = new Mongo.Collection('characters')
@@ -0,0 +1,58 @@
//////////////////////////
// Characters fixtures //
////////////////////////

import { Characters } from '/imports/api/characters/_characters.js';

if (Characters.find().count() === 0) {

//Init tab
let tabCharacters = [
{ id: 'jonsnow', name: 'Jon Snow', info: '' },
{ id: 'dany', name: 'Daenerys Targaryen', info: '' },
{ id: 'cersei', name: 'Cersei Lannister', info: '' },
{ id: 'tyrion', name: 'Tyrion Lannister', info: '' },
{ id: 'sansa', name: 'Sansa Stark', info: '' },
{ id: 'arya', name: 'Arya Stark', info: '' },
{ id: 'bran', name: 'Bran Stark', info: '' },
{ id: 'jaime', name: 'Jaime Lannister', info: '' },
{ id: 'brienne', name: 'Brienne of Tarth', info: '' },
{ id: 'theon', name: 'Theon Greyjoy', info: '' },
{ id: 'sam', name: 'Samwell Tarly', info: '' },
{ id: 'savos', name: 'Davos Seaworth', info: '' },
{ id: 'mountain', name: 'The Mountain', info: '' },
{ id: 'varys', name: 'Varys', info: '' },
{ id: 'jorah', name: 'Jorah Mormont', info: '' },
{ id: 'melisandre', name: 'Melisandre', info: '' },
{ id: 'euron', name: 'Euron Greyjoy', info: '' },
{ id: 'hound', name: 'The Hound', info: '' },
{ id: 'bronn', name: 'Bronn', info: '' },
{ id: 'tormund', name: 'Tormund Giantsbane', info: '' },
{ id: 'gendry', name: 'Gendry', info: '' },
{ id: 'yara', name: 'Yara Greyjoy', info: '' },
{ id: 'greyworm', name: 'Grey Worm', info: '' },
{ id: 'missandei', name: 'Missandei', info: '' },
{ id: 'daario', name: 'Daario Naharis', info: '' },
{ id: 'jaqen', name: 'Jaqen H’ghar', info: '' },
{ id: 'beric', name: 'Beric Dondarrion', info: '' },
{ id: 'meera', name: 'Meera Reed', info: '' },
{ id: 'podrick', name: 'Podrick Payne', info: '' },
{ id: 'gilly', name: 'Gilly', info: '' },
{ id: 'lyanna', name: 'Lyanna Mormont', info: '' },
{ id: 'ellaria', name: 'Ellaria Sand', info: '' },
{ id: 'qyburn', name: 'Qyburn', info: '' },
{ id: 'robin', name: 'Robin Arryn', info: '' },
{ id: 'hotpie', name: 'Hot Pie', info: '' },
{ id: 'eddison', name: 'Eddison Tollett', info: '' }
]

//Injection in the BD
tabCharacters.forEach(element => {
element.isDead = false;
element.deadAtEpisode = 0;
element.dateOfDeath = null;
element.image = element.id + '.jepg';
Characters.insert(element);
});

}

This file was deleted.

@@ -0,0 +1,3 @@
import { Mongo } from 'meteor/mongo'

export const Votes = new Mongo.Collection('votes')
No changes.
@@ -0,0 +1,16 @@
import React from 'react';

class Layout extends React.Component {

render() {

return (
<div className="main-layout">
{this.props.content}
</div>
)
}

}

export default Layout;
@@ -0,0 +1,12 @@
import React from 'react';
import { mount } from 'react-mounter';

import Layout from '/imports/layouts/Layout.jsx';
import Home from '/imports/ui/Home.jsx';

FlowRouter.route('/', {
name: 'home',
action: function () {
mount(Layout, { content: <Home /> });
}
});
@@ -0,0 +1 @@
import '/imports/routing/routes.js';
@@ -0,0 +1,13 @@
/////////////////////
// STARTUP SERVER //
///////////////////

//Collections
import '/imports/api/characters/_characters.js';
import '/imports/api/votes/_votes.js';

//Fixtures
import '/imports/api/characters/fixtures.js';

//Methods
import '/imports/api/votes/methods.js';

This file was deleted.

This file was deleted.

@@ -0,0 +1,28 @@
import React from 'react';
import { Container } from 'semantic-ui-react';

class Home extends React.Component {

constructor() {
super();
this.state = {
access: 'loading'
}
}

componentDidMount() {

}

render() {

return (
<Container>
Hello World!!
</Container>
)
}

}

export default Home;

This file was deleted.

0 comments on commit 2dc49a4

Please sign in to comment.
You can’t perform that action at this time.