diff --git a/js/components/tag-list.js b/js/components/tag-list.js new file mode 100644 index 0000000..bd16869 --- /dev/null +++ b/js/components/tag-list.js @@ -0,0 +1,40 @@ +/** + * @jsx React.DOM + */ + +var React = require('react/addons'); + +var Tag = require('./tag'); + +var TagList = React.createClass({ + getTags:function(){ + return this.props.data.getTags().map(function(tag){ + return ({tag}); + }); + }, + getCountries:function(){ + return this.props.data.getCountries().map(function(country){ + var country = country.replace('.',''); + return (); + }); + }, + render: function() { + + return ( +
+
+ +
+

Countries

+

{this.getCountries()}

+

Tags

+

{this.getTags()}

+
+
+
+ ); + } + +}); + +module.exports = TagList; diff --git a/js/components/topbar.js b/js/components/topbar.js index 87bc42b..306f6d2 100644 --- a/js/components/topbar.js +++ b/js/components/topbar.js @@ -21,6 +21,9 @@ var Topbar = React.createClass({ }, { link: '/about', label: 'About' + }, { + link: '/tag', + label: 'Tags' }, { link: '/blog', label: 'Blog' diff --git a/js/index.js b/js/index.js index 2fa529d..8b5f171 100644 --- a/js/index.js +++ b/js/index.js @@ -18,6 +18,7 @@ var Releases = require('./components/releases'); var ReleaseDetail = require('./components/release-detail'); var About = require('./components/about'); var Blog = require('./components/blog'); +var TagList = require('./components/tag-list'); // slim stat tracking // the router calls it every time the route changes, so we track internal navigation @@ -27,6 +28,7 @@ var SlimStat = require('./lib/slimstat'); React.renderComponent( + diff --git a/js/models/release.js b/js/models/release.js index 5064579..973a3b9 100644 --- a/js/models/release.js +++ b/js/models/release.js @@ -45,6 +45,11 @@ var ReleaseModel = Backbone.Model.extend({ _.each(tags, function(tag){ + // can remove once https://github.com/enoughrec/arecordlabel/issues/48 is fixed + if (tag == '') { + return; + } + if (tag[0] === '.') { country.push(tag); } else {