diff --git a/app/index.html b/app/index.html index cc807f41..11d576c8 100644 --- a/app/index.html +++ b/app/index.html @@ -67,7 +67,7 @@ - + diff --git a/css/multiview.css b/css/multiview.css index 7a6df9fe..4c661429 100644 --- a/css/multiview.css +++ b/css/multiview.css @@ -94,6 +94,19 @@ display: inline; } +/********************************************************** + * Fields Widget + *********************************************************/ + +.recline-fields-view .fields-list .accordion-heading a, +.recline-fields-view .fields-list .accordion-heading h3 { + display: inline; +} + +.recline-fields-view .fields-list .accordion-heading h3 { + margin-left: 10px; +} + /********************************************************** * Notifications *********************************************************/ diff --git a/src/view.multiview.js b/src/view.multiview.js index 04d0b847..4b8417c3 100644 --- a/src/view.multiview.js +++ b/src/view.multiview.js @@ -88,7 +88,7 @@ my.MultiView = Backbone.View.extend({ \
\ @@ -216,11 +216,11 @@ my.MultiView = Backbone.View.extend({ }); this.$filterEditor = filterEditor.el; this.el.find('.header').append(filterEditor.el); - var facetViewer = new recline.View.FacetViewer({ + var fieldsView = new recline.View.Fields({ model: this.model }); - this.$facetViewer = facetViewer.el; - this.el.find('.header').append(facetViewer.el); + this.$fieldsView = fieldsView.el; + this.el.find('.header').append(fieldsView.el); }, updateNav: function(pageName) { @@ -244,8 +244,8 @@ my.MultiView = Backbone.View.extend({ var action = $(e.target).attr('data-action'); if (action === 'filters') { this.$filterEditor.toggle(); - } else if (action === 'facets') { - this.$facetViewer.toggle(); + } else if (action === 'fields') { + this.$fieldsView.toggle(); } }, diff --git a/src/widget.fields.js b/src/widget.fields.js new file mode 100644 index 00000000..a2568467 --- /dev/null +++ b/src/widget.fields.js @@ -0,0 +1,70 @@ +/*jshint multistr:true */ + +// Field Info +// +// For each field +// +// Id / Label / type / format + +// Editor -- to change type (and possibly format) +// Editor for show/hide ... + +// Summaries of fields +// +// Top values / number empty +// If number: max, min average ... + +// Box to boot transform editor ... + +this.recline = this.recline || {}; +this.recline.View = this.recline.View || {}; + +(function($, my) { + +my.Fields = Backbone.View.extend({ + className: 'recline-fields-view well', + template: ' \ +
\ + {{#fields}} \ +
\ +
\ +

\ + {{label}} ({{id}}) \ + \ + {{type}} \ + More information » \ + \ + \ +

\ +
\ +
\ +
\ + {{type}} \ +
\ +
\ +
\ + {{/fields}} \ +
\ + ', + + events: { + }, + initialize: function(model) { + _.bindAll(this, 'render'); + this.el = $(this.el); + this.model.fields.bind('all', this.render); + this.render(); + }, + render: function() { + var tmplData = { + fields: this.model.fields.toJSON() + }; + var templated = Mustache.render(this.template, tmplData); + this.el.html(templated); + // this.el.hide(); + this.el.find('.collapse').collapse() + } +}); + +})(jQuery, recline.View); + diff --git a/test/index.html b/test/index.html index 84d0231e..26fed5dd 100644 --- a/test/index.html +++ b/test/index.html @@ -49,7 +49,7 @@ - +