Merge branch 'cc-2425-tweak-phone-home' into devel

This commit is contained in:
James 2011-06-26 00:45:30 -04:00
commit a936212355
3 changed files with 52 additions and 19 deletions

View file

@ -136,6 +136,13 @@ class Application_Form_RegisterAirtime extends Zend_Form
'ViewHelper' 'ViewHelper'
) )
)); ));
// checkbox for privacy policy
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"\">privacy policy</a>.")
->setDecorators(array('ViewHelper'))
->setValue(1);
$this->addElement($checkboxPrivacy);
} }
} }

View file

@ -161,5 +161,12 @@
</dl> </dl>
</fieldset> </fieldset>
</div> </div>
<div>
<br>
<label class="optional" for="Privacy">
<?php echo $this->element->getElement('Privacy') ?>
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
</label>
</div>
</form> </form>
</div> </div>

View file

@ -1,6 +1,8 @@
$(document).ready(function(){ $(document).ready(function(){
var dialogGlob;
$.get("/Preference/register", {format:"json"}, function(json){ $.get("/Preference/register", {format:"json"}, function(json){
var dialog = $(json.dialog); var dialog = $(json.dialog);
dialogGlob = dialog;
dialog.dialog({ dialog.dialog({
autoOpen: false, autoOpen: false,
@ -8,15 +10,22 @@ $(document).ready(function(){
resizable: false, resizable: false,
modal: true, modal: true,
position:['center',50], position:['center',50],
buttons: { buttons: [
"Remind me in 1 week": function() { {
id: "remind_me",
text: "Remind me in 1 week",
click: function() {
var url = '/Preference/remindme'; var url = '/Preference/remindme';
$.ajax({ $.ajax({
url: url, url: url,
}); });
$(this).dialog("close"); $(this).dialog("close");
}
}, },
"Yes, help Airtime": function() { {
id: "help_airtime",
text: "Yes, help Airtime",
click: function() {
if($("#Publicise").is(':checked')){ if($("#Publicise").is(':checked')){
if(validateFields()){ if(validateFields()){
$("#register-form").submit(); $("#register-form").submit();
@ -26,6 +35,7 @@ $(document).ready(function(){
} }
} }
} }
]
}); });
dialog.dialog('open'); dialog.dialog('open');
@ -56,6 +66,15 @@ $(document).ready(function(){
} }
}); });
$("#Privacy").live('click', function(){
var button = $("#help_airtime");
if($(this).is(':checked')){
button.removeAttr('disabled').removeClass('ui-state-disabled');
}else{
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
}
});
$("#link_to_whos_using").live('click', function(){ $("#link_to_whos_using").live('click', function(){
window.open("http://sourcefabric.org/en/products/airtime_whosusing"); window.open("http://sourcefabric.org/en/products/airtime_whosusing");
}); });