hummingbird-me/kitsu-web

View on GitHub
app/routes/manga/show.js

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
import MediaShowRoute from 'client/routes/media/show';
import { get, set } from '@ember/object';
import { capitalize } from '@ember/string';

export default MediaShowRoute.extend({
  afterModel(model) {
    this._super(...arguments);

    const tags = this.setHeadTags(model);
    tags.push({
      type: 'meta',
      tagId: 'meta-og-type',
      attrs: {
        property: 'og:type',
        content: 'books.book'
      }
    });
    set(this, 'headTags', tags);
  },

  titleToken(model) {
    const title = get(model, 'computedTitle');
    const subtype = capitalize(get(model, 'subtype'));
    return `${title} | ${subtype}`;
  }
});