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

Forms #11

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ module.exports = {
// node files
{
files: [
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js'
],
Expand Down
22 changes: 14 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/dist/
/tmp/

# dependencies
/node_modules
/bower_components
/bower_components/
/node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
<<<<<<< HEAD
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
package-lock.json
=======
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
>>>>>>> 2bc0017... message
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ before_install:
- npm config set spin false

script:
- npm run lint:hbs
- npm run lint:js
- npm test
84 changes: 84 additions & 0 deletions MODULE_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
## Module Report
### Unknown Global

**Global**: `Ember.Logger`

**Location**: `tests/assertions/async-throws.js` at line 7

```js

function intercept(f = () => {}) {
originalLoggerError = Ember.Logger.error;
originalTestAdapterException = Ember.Test.adapter.exception;
Ember.Logger.error = f;
```

### Unknown Global

**Global**: `Ember.Test`

**Location**: `tests/assertions/async-throws.js` at line 8

```js
function intercept(f = () => {}) {
originalLoggerError = Ember.Logger.error;
originalTestAdapterException = Ember.Test.adapter.exception;
Ember.Logger.error = f;
Ember.Test.adapter.exception = () => {};
```

### Unknown Global

**Global**: `Ember.Logger`

**Location**: `tests/assertions/async-throws.js` at line 9

```js
originalLoggerError = Ember.Logger.error;
originalTestAdapterException = Ember.Test.adapter.exception;
Ember.Logger.error = f;
Ember.Test.adapter.exception = () => {};
}
```

### Unknown Global

**Global**: `Ember.Test`

**Location**: `tests/assertions/async-throws.js` at line 10

```js
originalTestAdapterException = Ember.Test.adapter.exception;
Ember.Logger.error = f;
Ember.Test.adapter.exception = () => {};
}

```

### Unknown Global

**Global**: `Ember.Logger`

**Location**: `tests/assertions/async-throws.js` at line 14

```js

function restore() {
Ember.Logger.error = originalLoggerError;
Ember.Test.adapter.exception = originalTestAdapterException;
}
```

### Unknown Global

**Global**: `Ember.Test`

**Location**: `tests/assertions/async-throws.js` at line 15

```js
function restore() {
Ember.Logger.error = originalLoggerError;
Ember.Test.adapter.exception = originalTestAdapterException;
}

```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Make use of the many generators for code, try `ember help generate` for more det

### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

Expand Down
8 changes: 8 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import Model from 'ember-data/model';
import { computed } from '@ember/object';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});

Model.reopen({
lastSaveFailed: computed('isError', 'isValid', function() {
return this.isError || !this.isValid;
})
});

loadInitializers(App, config.modulePrefix);

export default App;
8 changes: 8 additions & 0 deletions app/helpers/guid-for.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { helper } from '@ember/component/helper';
import { guidFor as guid } from '@ember/object/internals';

export function guidFor(params/*, hash*/) {
return guid(params[0]);
}

export default helper(guidFor);
7 changes: 7 additions & 0 deletions app/helpers/nl2br.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Helper from '@ember/component/helper';

export default Helper.extend({
compute: function([ text ]) {
return text ? text.split(/\n/).join('<br>') : "";
}
});
2 changes: 2 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/embermap-cms.css">

<link rel="icon" href="about:blank" />

{{content-for "head-footer"}}
</head>
<body class="avenir">
Expand Down
8 changes: 7 additions & 1 deletion app/models/post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import DS from 'ember-data';
import { validator, buildValidations } from 'ember-cp-validations';

export default DS.Model.extend({
let Validations = buildValidations({
title: validator('presence', true),
text: validator('presence', true)
})

export default DS.Model.extend(Validations, {

comments: DS.hasMany(),
tags: DS.hasMany(),
Expand Down
11 changes: 11 additions & 0 deletions app/models/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import DS from 'ember-data';

export default DS.Model.extend({

firstName: DS.attr(),
lastName: DS.attr(),
email: DS.attr(),
age: DS.attr(),
notes: DS.attr()

});
17 changes: 17 additions & 0 deletions app/pods/application/controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Controller.extend({
isShowingNav: true,

isShowingSpeedControl: computed({
get() {
return window.localStorage.getItem('isShowingSpeedControl') === 'true';
},

set(key, value) {
window.localStorage.setItem('isShowingSpeedControl', value);
return value;
}
}),
});
63 changes: 40 additions & 23 deletions app/pods/application/template.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{#if flashMessages.queue}}
<div class="no-events fixed flex flex-column justify-end items-start z-999 vh-100 vw-100">
<div class="no-events fixed flex flex-col justify-end items-start z-999 h-screen w-screen">
{{#each flashMessages.queue as |flash|}}
<div class="
ml3 mb3 white bg-dark-gray pv3 ph4 shadow-4 br2 fade-up-and-down">
ml-4 mb-4 text-white bg-black px-4 py-4 shadow rounded-lg fade-up-and-down">
{{flash.message}}
</div>
{{/each}}
Expand All @@ -11,32 +11,49 @@

<div class='app'>
<header class='app-header'>
Acme, Inc.
<div class="flex items-center">
<div>
Acme, Inc.
</div>

<div class="ml-auto opacity-50 cursor-pointer">
<a {{action (toggle "isShowingSpeedControl" this)}}>
{{fa-icon "gear"}}
</a>
</div>
</div>
</header>

<main class='app-main'>
<section class='side-panel'>
{{#link-to 'dashboard'}}
Dashboard
{{/link-to}}
{{#link-to 'posts'}}
Blog posts
{{/link-to}}
{{#link-to 'tags'}}
Tags
{{/link-to}}
{{#link-to 'media'}}
Media
{{/link-to}}
{{#link-to 'comments'}}
Comments
{{/link-to}}
</section>

<section class='center-panel'>
{{#if isShowingNav}}
<section class='side-panel'>
{{#link-to 'dashboard'}}
Dashboard
{{/link-to}}
{{#link-to 'posts'}}
Blog posts
{{/link-to}}
{{#link-to 'tags'}}
Tags
{{/link-to}}
{{#link-to 'users'}}
Users
{{/link-to}}
{{#link-to 'media'}}
Media
{{/link-to}}
{{#link-to 'comments'}}
Comments
{{/link-to}}
</section>
{{/if}}

<section id='center-panel' class='center-panel'>
{{outlet}}

</section>
</main>
</div>

{{#if isShowingSpeedControl}}
{{speed-control}}
{{/if}}
Loading