Merge branch 'coupon' of https://github.com/thelia/thelia into coupon

# By mespeche
# Via mespeche
* 'coupon' of https://github.com/thelia/thelia:
  Max usage field and Is enabled field updates
  Max usage gestion
This commit is contained in:
gmorel
2013-09-03 12:33:51 +02:00
2 changed files with 13 additions and 6 deletions

View File

@@ -55,15 +55,15 @@
if($('#is-unlimited').length){
if($('#is-unlimited').is(':checked')){
$('#max-usage').hide().val('');
$('#max-usage').hide().attr('value', '-1');
}
$('#is-unlimited').change(function(){
if($('#is-unlimited').is(':checked')){
$('#max-usage').hide().val('');
$('#max-usage').hide().attr('value', '-1');
}
else{
$('#max-usage').show();
$('#max-usage').show().val('').attr('value', '');
}
});

View File

@@ -34,6 +34,13 @@
<input id="title" type="text" name="title" placeholder="title">
</div>
<div class="control-group">
<label for="enabled" class="checkbox">
<input id="enabled" type="checkbox" name="isEnabled" value="1" checked>
Is enabled ?
</label>
</div>
<div class="control-group">
<label for="available-on-special-offers" class="checkbox">
<input id="available-on-special-offers" type="checkbox" name="isAvailableOnSpecialOffers" value="1">
@@ -66,7 +73,7 @@
<div class="control-group">
<label for="max-usage">Max usage :</label>
<label for="is-unlimited" class="checkbox">
<input id="is-unlimited" type="checkbox" name="isUnlimited" value="1">
<input id="is-unlimited" type="checkbox" name="isUnlimited" value="1" checked>
Is unlimited ?
</label>
<input id="max-usage" type="text" name="maxUsage" placeholder="max usage">
@@ -105,7 +112,7 @@
<div class="control-group">
<label for="short-description">Short description :</label>
<textarea id="short-description" name="short-description" placeholder="short description" class="span12" rows="5"></textarea>
<textarea id="short-description" name="shortDescription" placeholder="short description" class="span12" rows="5"></textarea>
</div>
</div>
@@ -113,7 +120,7 @@
<div class="control-group">
<label for="long-description">Long description :</label>
<textarea id="long-description" name="long-description" placeholder="long description" class="span12 wysiwyg" rows="10"></textarea>
<textarea id="long-description" name="longDescription" placeholder="long description" class="span12 wysiwyg" rows="10"></textarea>
</div>
<button type="submit" class="btn btn-primary">Save</button>