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

Tag work #15

Closed
wants to merge 9 commits into from
Closed
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
21 changes: 20 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
/blueprints/*/files/**/*.js
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
Expand All @@ -20,6 +20,8 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
Expand Down
26 changes: 13 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# 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
/.env*
/.pnp*
/.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
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

config/credentials.json
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
46 changes: 28 additions & 18 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintignore
/.eslintrc.js
/.gitignore
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
.gitkeep

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
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'
};
52 changes: 30 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- "6"
- "8"

sudo: false
dist: trusty
Expand All @@ -23,29 +23,37 @@ env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
matrix:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true

branches:
only:
- master
# npm version tags
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- npm config set spin false
- npm install -g npm@6
- npm --version
include:
# runs linting and tests with current locked deps

- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: "Additional Tests"
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery

script:
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`

## Linting

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

## Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

## Running the dummy application

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2019

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

This is a custom template for the [Ember Blog](https://blog.emberjs.com) designed to work with [empress-blog](https://github.com/stonecircle/empress-blog)

For more information about Ember Ghost [read the Ember Ghost
For more information about empress-blog [read the empress-blog
documentation](https://github.com/empress/empress-blog/blob/master/README.md) but if you want to
get started straight away, try the quick start below.

Compatibility
------------------------------------------------------------------------------

## Quick Start
* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Node.js v8 or above

Quick Start
------------------------------------------------------------------------------

```sh
# if you don't have ember-cli installed already
Expand All @@ -23,3 +30,9 @@ It will ask you if you want to update the `index.html` file and you should say y

If you want to see the blog system running on your local machine just run `npm start` and you will
be able to navigate to [http://localhost:4200](http://localhost:4200) to see the blog in action.


Installation
------------------------------------------------------------------------------

See the [Contributing](CONTRIBUTING.md) guide for details.
26 changes: 26 additions & 0 deletions addon/components/tag-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,36 @@ import Component from '@ember/component';
import layout from '../templates/components/tag-sidebar';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import { filter } from '@ember/object/computed';

export default Component.extend({
router: service(),

fiteredTags: filter('tags.[]', ['yearTags'], function(tag) {
let individualIgnoredTags = [
'releases',
'new',
'newsletter',
];

let allIgnoredTags = [
...individualIgnoredTags,
...this.yearTags.map(tag => tag.id),
...this.versionTags.map(tag => tag.id),
]

return !allIgnoredTags.includes(tag.id);
}),

yearTags: filter('tags.[]', function(tag) {
console.log(tag.id, tag.id.match(/^20\d\d$/))
return tag.id.match(/^20\d\d$/);
}),

versionTags: filter('tags.[]', function(chore, index, array) {

}),

showSidebar: computed('router.currentRouteName', function() {
if (this.router.currentRouteName === 'author') {

Expand Down
8 changes: 6 additions & 2 deletions addon/templates/components/tag-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,18 @@

<h3 class="list-group-title" id="browse-subject">Browse by Subject</h3>
<ul class="list-group" aria-labelledby="browse-subject">
<li class="list-item"><a href="<%= tag_path 'Announcement'%>">Announcements</a></li>
{{log tags}}
{{#each fiteredTags as |tag|}}
<li class="list-item">{{#link-to 'tag' tag}}{{tag.name}}{{/link-to}}</li>
{{/each}}
{{!-- <li class="list-item"><a href="<%= tag_path 'Announcement'%>">Announcements</a></li>
<li class="list-item"><a href="<%= tag_path 'Ember CLI'%>">Ember CLI</a></li>
<li class="list-item"><a href="<%= tag_path 'Ember Data'%>">Ember Data</a></li>
<li class="list-item"><a href="<%= tag_path 'Newsletter'%>">Newsletter</a></li>
<li class="list-item"><a href="<%= tag_path 'Performance'%>">Performance</a></li>
<li class="list-item"><a href="<%= tag_path 'Roadmap'%>">Roadmap</a></li>
<li class="list-item"><a href="<%= tag_path 'Security'%>">Security</a></li>
<li class="list-item"><a href="<%= tag_path 'Testing'%>">Testing</a></li>
<li class="list-item"><a href="<%= tag_path 'Testing'%>">Testing</a></li> --}}
</ul>
</div>
</aside>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{outlet}}
</div>

{{tag-sidebar}}
{{tag-sidebar tags=model.tags}}

</div>

Expand Down
Loading