//////////////////////////////////////////////////////////////////////////// // Information about the item, along with some controls // // Events: // * move-item-up User wants to move the item up // * mode-item-down User wants to move the item down // * delete-item User wants to delete the item // * edit-item-info User wants to edit item info // //////////////////////////////////////////////////////////////////////////// Vue.component('CategoryItemInfo', { props: { // Contents of the item item: {type: Object, required: true}, }, computed: { // Item group, e.g. "PCRE-based" or "POSIX-based" for regex libraries group: function() { return this.item.group_ || "other" }, // Link to the "official site" or something link: function () { return this.item.link || null }, // Link to the Hackage page (for Haskell packages) hackageLink: function () { return (this.item.kind.tag == "Library") ? this.item.kind.contents : (this.item.kind.tag == "Tool") ? this.item.kind.contents : null }, }, // TODO: this template is somewhat messy; styles should be moved out; // spans and divs used like here are weird, too template: `