type.js 698 B

1234567891011121314151617181920212223242526
  1. // TODO: This file was created by bulk-decaffeinate.
  2. // Sanity-check the conversion and remove this comment.
  3. /*
  4. * decaffeinate suggestions:
  5. * DS102: Remove unnecessary code created because of implicit returns
  6. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
  7. */
  8. app.models.Type = class Type extends app.Model {
  9. // Attributes: name, slug, count
  10. fullPath() {
  11. return `/${this.doc.slug}-${this.slug}/`;
  12. }
  13. entries() {
  14. return this.doc.entries.findAllBy('type', this.name);
  15. }
  16. toEntry() {
  17. return new app.models.Entry({
  18. doc: this.doc,
  19. name: `${this.doc.name} / ${this.name}`,
  20. path: '..' + this.fullPath()
  21. });
  22. }
  23. };