Commit 14499f50 authored by Joseph Lacey's avatar Joseph Lacey

Adding UI improvement for clearer targetting and less interface clutter.

parent d38e36a9
......@@ -3,6 +3,20 @@ cj(document).ready( function() {
cj("input#email_petition").click( function() { showHideEmailPetition(); });
cj("#profile_id").change( function() { populateUserFieldOptions(); });
cj('.petitionemail-matching-group_id :input').each( function () {
if (cj(this).val() > 0) {
cj("").prop("checked", true);
if (cj('#recipients').val() != '') {
cj("").prop("checked", true);
cj("").click( function() { showHideTargetGroup(); });
cj("").click( function() { showHideTargetIndividuals(); });
function populateUserFieldOptions() {
......@@ -49,3 +63,18 @@ function showHideEmailPetition() {
function showHideTargetGroup() {
if (cj("").prop("checked")) {
} else {
function showHideTargetIndividuals() {
if (cj("").prop("checked")) {
} else {
......@@ -30,7 +30,13 @@
<div class="petitionemail-recipient-options">
<div class="petition-email-recipient-option-description">{ts}You must specify who will receive a copy of the petition using at least one of the methods below. You may also use both methods if you would like one set of recipients to receive all petitions signed and another set of recipients to be chosen dynamically.{/ts}</div>
<h3 class="petition-email-header">Dynamic Method</h3>
<label for="target-group">Target a Group (Dynamic Method)</label>
<input name="target-group" value="1" class="crm-form-checkbox target-group" type="checkbox">
<label for="target-individuals">Target Individuals (Static Method)</label>
<input name="target-individuals" value="2" class="crm-form-checkbox target-individuals" type="checkbox">
<div class="petition-email-target-group">
<h3 class="petition-email-header">Target a Group (Dynamic Method)</h3>
<div class="petition-email-recipient-option-description">The dynamic method allows you to choose different petition recipients depending on who is filling out the petition. To use the dynamic method, you must first put your targets into a group. Then specify the group below, and the field that must match between the person filling out the petition and the target contact. You can choose up to three group/field combinations.</div>
<table id="petition-email-dynamic-method">
......@@ -69,13 +75,15 @@
<div class="label">{$form.location_type_id.label}</div>
<div class="view-value">{$form.location_type_id.html}</div>
<div class="description">{ts}A target contact can have more than one email address. Choose the email location that should be preferred when sending the petition. If blank, or the preferred location is not available for the target, the primary email address will be used.{/ts}</div>
<h3 class="petition-email-header">Static Method</h3>
<div class="petition-email-target-individuals">
<h3 class="petition-email-header">Target Individuals (Static Method)</h3>
<div class="label">{$form.recipients.label}</div>
<div class="view-value">{$form.recipients.html}</div>
<div class="description">{ts}Enter targets that receive copies of all petitions in the form: 'First name Last name' &lt;;. Put each recipient on a separate line.{/ts}</div></td>
<div class="description">{ts}Enter targets that receive copies of all petitions in the form: 'First name Last name' &lt;;. Put each recipient on a separate line.{/ts}</div>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment