Author: dgornstein
Date: Tue Sep 24 11:20:55 2013
New Revision: 1525855
URL: http://svn.apache.org/r1525855
Log:
Fixed add widget message to only show up when no widgets on page. RAVE-1058.
Patch submitted by Rohit Kalkur
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/css/bootstrap/less/mixins.less
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/css/bootstrap/less/mixins.less
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/css/bootstrap/less/mixins.less?rev=1525855&r1=1525854&r2=1525855&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/css/bootstrap/less/mixins.less
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/css/bootstrap/less/mixins.less
Tue Sep 24 11:20:55 2013
@@ -552,13 +552,13 @@
.core (@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~".span@{index}") { .span(@index); }
+ .span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
- (~".offset@{index}") { .offset(@index); }
+ .offset@{index} { .offset(@index); }
.offsetX(@index - 1);
}
.offsetX (0) {}
@@ -595,7 +595,7 @@
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~".span@{index}") { .span(@index); }
+ .span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
@@ -627,7 +627,7 @@
.input(@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
- (~"input.span@{index}, textarea.span@{index},
.uneditable-input.span@{index}") { .span(@index); }
+ input.span@{index}, textarea.span@{index},
.uneditable-input.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html?rev=1525855&r1=1525854&r2=1525855&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/html/portal/tabs.html
Tue Sep 24 11:20:55 2013
@@ -35,7 +35,7 @@
<div class="row-fluid">
<div class="tab-content" ng-show="currentPageId == page.id"
ng-repeat="page in pages">
<div id="emptyPageMessageWrapper" class="emptyPageMessageWrapper">
- <div class="emptyPageMessage" ng-hide="hasWidgets(page)">
+ <div class="emptyPageMessage" ng-hide="page.hasRegionWidgets()">
<a href="/portal/app/store">Add widgets to this page</a>
</div>
</div>
@@ -135,4 +135,4 @@
<div class="modal-footer">
<a href="#" class="btn" ng-click="close()">Cancel</a>
</div>
-</script>
\ No newline at end of file
+</script>
Modified:
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
URL:
http://svn.apache.org/viewvc/rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js?rev=1525855&r1=1525854&r2=1525855&view=diff
==============================================================================
---
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
(original)
+++
rave/branches/angular/rave-portal-resources/src/main/webapp/static/script/common/resources/PagesResource.js
Tue Sep 24 11:20:55 2013
@@ -17,9 +17,17 @@
* under the License.
*/
-define([], function(){
+define(["underscore"], function(_){
return ['RaveResource', function(RaveResource){
- return RaveResource('pages/:id', {id: '@id'});
+ var PageResource = RaveResource('pages/:id', {id: '@id'});
+
+ PageResource.prototype.hasRegionWidgets = function() {
+ return _.find(this.regions, function(region) {
+ return region.regionWidgets.length;
+ });
+ };
+
+ return PageResource;
}];
})