{{/if}}
diff --git a/src/js/widgets/query_info/query_info_widget.js b/src/js/widgets/query_info/query_info_widget.js
index 3ab9a9554..6328e63f2 100644
--- a/src/js/widgets/query_info/query_info_widget.js
+++ b/src/js/widgets/query_info/query_info_widget.js
@@ -131,12 +131,16 @@ define(['marionette',
_.extend(QueryDisplayView.prototype, FormatMixin);
-
var Widget = BaseWidget.extend({
+ modelConstructor : QueryModel,
+ viewConstructor : QueryDisplayView,
+
initialize: function(options) {
+ options = options || {};
+
this.model = new QueryModel();
- this.view = new QueryDisplayView({model : this.model});
+ this.view = new QueryDisplayView({model : this.model, template : options.template});
BaseWidget.prototype.initialize.call(this, options);
},
@@ -194,7 +198,13 @@ define(['marionette',
options.library = data.libraryID;
//are we adding the current query or just the selected bibcodes?
- options.bibcodes = data.recordsToAdd;
+ //if it's an abstract page widget, will have this._bibcode val
+ if (this.abstractPage){
+ options.bibcodes = [this._bibcode];
+ }
+ else {
+ options.bibcodes = data.recordsToAdd;
+ }
var name = _.findWhere(this.model.get("libraries"), {id : data.libraryID }).name;
@@ -227,7 +237,13 @@ define(['marionette',
var options = {}, that = this;
//are we adding the current query or just the selected bibcodes?
- options.bibcodes = data.recordsToAdd;
+ //if it's an abstract page widget, will have this._bibcode val
+ if (this.abstractPage){
+ options.bibcodes = [this._bibcode];
+ }
+ else {
+ options.bibcodes = data.recordsToAdd;
+ }
options.name = data.name;
//XXX:rca - to decide
this.getBeeHive().getObject("LibraryController").createLibAndAddBibcodes(options)
diff --git a/src/js/widgets/recommender/templates/recommender_template.html b/src/js/widgets/recommender/templates/recommender_template.html
index 884b40592..425e8bf46 100644
--- a/src/js/widgets/recommender/templates/recommender_template.html
+++ b/src/js/widgets/recommender/templates/recommender_template.html
@@ -1,4 +1,6 @@
{{#if items}}
+
+
Suggested Articles
@@ -29,4 +31,5 @@
Suggested Articles
-{{/if}}
\ No newline at end of file
+{{/if}}
+
\ No newline at end of file
diff --git a/src/js/widgets/resources/templates/resources_template.html b/src/js/widgets/resources/templates/resources_template.html
index 1b35bbdf4..0290d33fa 100644
--- a/src/js/widgets/resources/templates/resources_template.html
+++ b/src/js/widgets/resources/templates/resources_template.html
@@ -1,5 +1,6 @@
{{#if fullTextSources}}
+
+
+ {{#if feedback.create}}
+ Library {{feedback.name}} was successfully created and {{feedback.numRecords}} new records were added.
+ {{else}}
+ {{feedback.numRecords}} new records were added to library {{feedback.name}}.
+ {{#if feedback.numAlreadyInLib}}
+ ({{feedback.numAlreadyInLib}} were already in the library).
+ {{/if}}
+ {{/if}}
+
+
+ {{else}}
+
+
+
+ {{#if feedback.create}}
+ {{feedback.name}} was not created, error occured.
+ {{feedback.error}}
+ {{else}}
+ Records were not added to {{feedback.name}}, error occurred.
+ {{feedback.error}}
+ {{/if}}
+
+
+ {{/if}}
+
+ {{/if}}
+
+
+
+{{/if}}
\ No newline at end of file
diff --git a/src/js/wraps/abstract_page_library_add/widget.js b/src/js/wraps/abstract_page_library_add/widget.js
new file mode 100644
index 000000000..411793e22
--- /dev/null
+++ b/src/js/wraps/abstract_page_library_add/widget.js
@@ -0,0 +1,60 @@
+define([
+ "js/widgets/query_info/query_info_widget",
+ "js/widgets/base/base_widget",
+ "hbs!./template"
+ ],
+ function(
+ QueryInfoWidget,
+ BaseWidget,
+ template
+ ){
+
+ var AbstractLibraryWidget = QueryInfoWidget.extend({
+
+ //flag for functions that send bibs to library
+ abstractPage : true,
+
+ //add new template
+ initialize: function(options) {
+ options = options || {};
+ this.model = new this.modelConstructor();
+ this.view = new this.viewConstructor({model : this.model, template : template});
+ BaseWidget.prototype.initialize.call(this, options);
+ },
+
+ //don't need to subscribe to storage paper update, do need to subscribe to display_documents
+ activate: function(beehive) {
+
+ this.setBeeHive(beehive);
+ _.bindAll(this);
+
+ var pubsub = this.getPubSub();
+ pubsub.subscribe(pubsub.LIBRARY_CHANGE, this.processLibraryInfo);
+ pubsub.subscribe(pubsub.USER_ANNOUNCEMENT, this.handleUserAnnouncement);
+ pubsub.subscribe(pubsub.DISPLAY_DOCUMENTS, this.onDisplayDocuments);
+
+ //check if user is signed in (because widget was just instantiated, but app might have been running for a while
+ if (this.getBeeHive().getObject("User").isLoggedIn()) {
+ // know whether to show library panel
+ this.model.set("loggedIn", true);
+ //fetch list of libraries
+ var libraryData = this.getBeeHive().getObject("LibraryController").getAllMetadata();
+ this.processLibraryInfo(libraryData);
+ }
+
+ },
+
+ onDisplayDocuments: function(apiQuery) {
+ var bibcode = apiQuery.get('q');
+ if (bibcode.length > 0 && bibcode[0].indexOf('bibcode:') > -1) {
+ bibcode = bibcode[0].replace('bibcode:', '');
+ this._bibcode = bibcode;
+ }
+ },
+
+
+ });
+
+ return AbstractLibraryWidget
+
+});
\ No newline at end of file
diff --git a/src/js/wraps/abstract_page_manager/abstract-page-layout.html b/src/js/wraps/abstract_page_manager/abstract-page-layout.html
index d9c1ac3f2..96ba54e8e 100644
--- a/src/js/wraps/abstract_page_manager/abstract-page-layout.html
+++ b/src/js/wraps/abstract_page_manager/abstract-page-layout.html
@@ -37,15 +37,10 @@