Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
Merge branch 'feature/issue-47-fix-various-combination-rule-bugs' int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
nathanbegbie committed Nov 13, 2017
2 parents fbc6670 + 0ba033f commit 6356ac4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions molo/surveys/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,4 @@ class LogicBlock(blocks.StructBlock):

class Meta:
icon = 'cogs'
label = 'Nested Logic'
12 changes: 12 additions & 0 deletions molo/surveys/static/js/survey-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ $(function(){
});
$("#id_surveys_combinationrule_related-ADD").toggle();
});

if($("#id_surveys_combinationrule_related-FORMS").children("li").length > 0){
$("#id_surveys_combinationrule_related-ADD").toggle();

var deleteButton = $("#id_surveys_combinationrule_related-FORMS")
.children("li")
.find('button[title^="Delete"]')

deleteButton.click(function () {
$("#id_surveys_combinationrule_related-ADD").toggle();
});
}
}
addHideToRuleCombinationFunctionality();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,33 @@ <h2>{{ heading }}</h2>
<p>
{% blocktrans %}
This rule allows you to segment users that visited a certain number of unique articles with a specific tag during a specified time period, e.g. you can segment users who visited more than 3 articles with the “health” tag between January and March this year.
{% endblocktrans %}
{% endblocktrans %}
</p>
{% endif %}

{% if self.formset.prefix == 'surveys_combinationrule_related' %}
<p>
{% blocktrans %}
Use the Rule Combination to connect the defined rules with a combination of AND/OR statements. Include the statements that you want to be calculated first as Nested Logic as this will place the statements in parentheses. If you do not use Nested Logic, the system will read the combination in order from top to bottom.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
Once you’ve activated the Rule Combination, be sure to include all the rules that you want to use to create your segments. Any defined rules that are not included in the Rule Combination will not contribute to the results of your segment.
{% endblocktrans %}
</p>
<p>
{% blocktrans %}
Note:
{% endblocktrans %}
<br>
{% blocktrans %}
AND will narrow the results of your segment,
{% endblocktrans %}
<br>
{% blocktrans %}
OR will broaden the results of your segment.
{% endblocktrans %}
</p>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ molo.core<6.0.0,>=5.0.0
celery<4.0
django-celery
wagtailsurveys==0.1.1
wagtail-personalisation-molo==0.10.0
wagtail-personalisation-molo==0.10.1
psycopg2
html5lib==0.9999999
Unidecode==0.04.16

0 comments on commit 6356ac4

Please sign in to comment.