Skip to content

Commit

Permalink
WCM-92 Display drag-rules information message
Browse files Browse the repository at this point in the history
  • Loading branch information
jbalsas authored and juliocamarero committed Aug 21, 2014
1 parent 5eb9f71 commit 07c26a4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
Expand Up @@ -29,6 +29,7 @@ display-this-content=Display this content:
default-content=Default Content
does-not-belong=does not belong
dont-display-anything=Don't display anything
drag-rules-here-to-configure-this-user-segment=Drag Rules here to configure this User Segment
end-date=End Date
if-the-user=If the user
if-the-user-belongs-to-this-campaign=If the user belongs to this campaign:
Expand Down
12 changes: 12 additions & 0 deletions content-targeting-web/docroot/css/content_targeting/main.css
Expand Up @@ -122,6 +122,7 @@
}

.diagram-builder-field {
cursor: move;
display: inline-block;
float: none;
height: inherit;
Expand Down Expand Up @@ -182,6 +183,17 @@
background-color: #f6f6f6;
border: none;

&.has-rules {
.alert-no-rules {
display: none;
}
}

.alert-no-rules {
margin-left: 20px;
margin-right: 20px;
}

.diagram-builder-drop-container {
height: auto;
min-height: 500px;
Expand Down
Expand Up @@ -79,7 +79,17 @@
</div>

<div class="diagram-builder-content-container form-builder-content-container">
<div class="diagram-builder-canvas form-builder-canvas">
<#assign cssHasRulesClass = "">

<#if userSegment?? && (addedRuleTemplates?size > 0)>
<#assign cssHasRulesClass = "has-rules">
</#if>

<div class="diagram-builder-canvas form-builder-canvas ${cssHasRulesClass}">
<div class="alert alert-info alert-no-rules">
<@liferay_ui["message"] key="drag-rules-here-to-configure-this-user-segment" />
</div>

<div class="diagram-builder-drop-container form-builder-drop-container">
<#if userSegment??>
<#list addedRuleTemplates as template>
Expand Down
Expand Up @@ -61,7 +61,8 @@ AUI.add(
fieldsFilter = instance._createItemFilter();

eventHandles.push(
fieldsFilter.on('results', instance._onItemFilterResults, instance)
fieldsFilter.on('results', instance._onItemFilterResults, instance),
instance.on('fieldsChange', instance._onFieldsChange, instance)
);
}

Expand Down Expand Up @@ -213,6 +214,12 @@ AUI.add(
event.stopPropagation();
},

_onFieldsChange: function(event) {
var instance = this;

instance.get('canvas').toggleClass('has-rules', instance.get('fields').size());
},

_onItemFilterResults: function(event) {
var instance = this,
contentBox = instance.get('contentBox'),
Expand Down

0 comments on commit 07c26a4

Please sign in to comment.