var el = $('<a class="checkbox-widget" href="javascript:void(0)"/>');
var form = $this.closest(".form-row");
var className = $this.attr('class');
+ var isRadio = $this.hasClass('radio');
// add class to identify form rows which contain a checkbox
form.addClass("with-checkbox");
+
if ($this.prev().length > 0) {
var lbl = $this.prev()[0];
$(lbl).addClass("checkbox-label");
$(lbl).click(function(e){
+ if (isRadio && $this.attr('checked')){ return; }
var src = e.srcElement.nodeName;
if (src == "LABEL" || src == "label") {
el.toggleClass("checked");
el.addClass(className);
el.click(function() {
-
+ if (isRadio && $this.attr('checked')){ return; }
el.toggleClass("checked");
$this.attr('checked', el.hasClass("checked"));
$this.trigger('changed');
el.keypress(function(e){
if (e.keyCode == 0 || e.keyCode == 32){
+ if (isRadio && $this.attr('checked')){ return; }
e.preventDefault();
el.toggleClass("checked");
$this.attr('checked', el.hasClass("checked"));
$(this).siblings('fieldset').find('.checkbox-widget.limited').removeClass('checked');
$(this).siblings('fieldset').find('input[type="checkbox"].limited').removeAttr('checked');
$(this).siblings('fieldset').find('input[type="checkbox"].unlimited').attr('checked','checked');
- $(this).siblings('fieldset').find('.double-checks input[type="text"]').removeClass('hideshow');
+ $(this).siblings('fieldset').find('.double-checks input[type="text"]').hide();
$(this).parents('.group').hide('slow', function() {
$(this).appendTo('.not-foo');
});
$('.quotas-form input.limited').bind("changed", function(e){
- $(this).siblings('input[type="text"]').toggle();
- $(this).siblings('input[type="text"]').focus();
- parentdiv = $(this).parents('.form-row').prev('.form-row');
- parentdiv.find('input[type="checkbox"].unlimited').removeAttr('checked');
- parentdiv.find('.checkbox-widget').removeClass('checked');
+ console.log($(this).attr('checked'));
+ if ($(this).attr('checked')){
+ $(this).siblings('input[type="text"]').toggle();
+ $(this).siblings('input[type="text"]').focus();
+ parentdiv = $(this).parents('.form-row').prev('.form-row');
+ parentdiv.find('input[type="checkbox"].unlimited').removeAttr('checked');
+ parentdiv.find('.checkbox-widget').removeClass('checked');
+ }
+
});
<div class="form-row">
<p class="clearfix">
<label for="{{r|add:'_unlimited'}}">Unlimited</label>
- <input type="checkbox" id="{{'id_'|add:r|add:'_unlimited'}}" name="{{r|add:'_unlimited'}}" class="unlimited" checked="checked">
+ <input type="checkbox" id="{{'id_'|add:r|add:'_unlimited'}}" name="{{r|add:'_unlimited'}}" class="unlimited radio" checked="checked">
</p>
</div>
<div class="form-row">
<p class="clearfix">
<label for="{{r|add:'_limited'}}">Limited</label>
- <input type="checkbox" id="id_storage_per_user_limited" name="{{r|add:'_limited'}}" class="limited">
+ <input type="checkbox" id="id_storage_per_user_limited" name="{{r|add:'_limited'}}" class="radio limited">
<input type="text" id="{{'id_'|add:r|add:'_uplimit'}}" name="{{r|add:'_uplimit'}}"/>
</p>
</div>
<div>
<div class="wrap">
<h2>WELCOME!</h2>
- <p ><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></p>
+ <p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
<p class="txt">Connect with a world of people who share your passions.<br>With millions of groups at your fingertips, it's easy to find the group that's best for you -- no matter your interest.</p>
<p><a href="{% url group_add 'course' %}">create a group ></a></p>
<!--<p class="btn"><a href="{% url group_create_list %}" class="submit">CREATE</a></p>-->
<div>
<div class="wrap">
<h2>ALREADY AWARE?</h2>
- <p ><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></p>
+ <p><a href="{% url group_add 'course' %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
<p class="txt">Well, this is the place to start!<br>sdofuisd ofuaofi usdiof uiofu osifuaoi ufisdfiousf oiusd<br></p>
<p><a href="{% url group_search %}">join a group ></a></p>