diff --git a/addon/components/tag-sidebar.js b/addon/components/tag-sidebar.js index 1f0fc79..2f1162b 100644 --- a/addon/components/tag-sidebar.js +++ b/addon/components/tag-sidebar.js @@ -2,15 +2,64 @@ 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(), - showSidebar: computed('router.currentRouteName', function() { + fiteredTags: filter('tags.[]', ['yearTags'], function (tag) { + let individualIgnoredTags = [ + 'releases', + 'new', + ]; + + 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$/); + }), + + specificVersionTags: filter('tags.[]', function (tag) { + return tag.id.match(/^3.\d$/) || tag.id.match(/^2.\d$/) || tag.id.match(/^1.\d$/) + }), + + newsletterTags: filter('tags.[]', function (tag) { + if (tag.id.match(/^newsletter/)) { + return tag; + } + }), + + versionTags: filter('tags.[]', function (tag) { + let versionTags = [ + "3", + "2", + "1", + "version-1-x", + "version-2-x", + "version-3-x" + ] + + let allIgnoredTags = [ + ...versionTags, + ... this.specificVersionTags.map(tag => tag.id) + ] + + return allIgnoredTags.includes(tag.id); + }), + + showSidebar: computed('router.currentRouteName', function () { if (this.router.currentRouteName === 'author') { return false; - } + } return true; }), diff --git a/addon/templates/components/tag-sidebar.hbs b/addon/templates/components/tag-sidebar.hbs index 5507396..6c82bf5 100644 --- a/addon/templates/components/tag-sidebar.hbs +++ b/addon/templates/components/tag-sidebar.hbs @@ -1,80 +1,66 @@ {{#if showSidebar}} - {{/if}} \ No newline at end of file diff --git a/app/templates/application.hbs b/app/templates/application.hbs index c6a543a..ad2d6c8 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,17 +1,17 @@ {{#es-header}} - {{#es-navbar}} - {{/es-navbar}} +{{#es-navbar}} +{{/es-navbar}} {{/es-header}}
Stay up to date! Get all the latest & greatest posts delivered straight to your inbox
- {{subscribe_form placeholder="youremail@example.com"}} -Stay up to date! Get all the latest & greatest posts delivered straight + to your inbox
+ {{subscribe_form placeholder="youremail@example.com"}} +{{model.errors.0.title}}
{{#link-to 'index' class="error-link"}}Go to the front page →{{/link-to}} diff --git a/app/templates/index.hbs b/app/templates/index.hbs index f31ae5d..561e472 100644 --- a/app/templates/index.hbs +++ b/app/templates/index.hbs @@ -1,22 +1,22 @@