Luke Plant avatar Luke Plant committed 626ae9a Merge

Merged from default

Comments (0)

Files changed (3)

cciw/bookings/models.py

     price = models.DecimalField(decimal_places=2, max_digits=10)
 
     class Meta:
-        unique_together = ['year', 'price_type']
+        unique_together = [('year', 'price_type')]
 
     def __unicode__(self):
         return u"%s %s - %s" % (self.get_price_type_display(), self.year, self.price)

cciw/bookings/static/bookings/js/add_place.js

                  userData['places'] = places;
                  if (places.length > 0) {
                      var cont = $('#id_use_existing_radio_container');
-                     $('#id_use_existing_btn').show();
+                     $('.use_existing_btn').show();
                      for (var i=0; i < places.length; i++) {
                          var place = places[i];
                          var html = ("<label><input type='radio' name='use_which_booking' value='" +
              var useExistingDataClose = function(ev) {
                  $('#id_use_existing_data_popup').fadeOut('fast');
                  $('#id_popup_background').fadeOut('fast');
+                 if (ev != undefined) {
+                     // for links
+                     ev.preventDefault();
+                 }
              };
 
              var address_attrs = [
              };
 
              $('#id_popup_close_btn').click(useExistingDataClose);
-             $('#id_use_existing_btn').click(useExistingDataShow);
+             $('.use_existing_btn').click(useExistingDataShow);
              $('#id_use_all_btn').click(useAllBtnClick);
              $('#id_use_address_btn').click(useAddressBtnClick);
              $('#id_use_gp_info_btn').click(useGPInfoBtnClick);

templates/cciw/bookings/add_place.html

 {% cciw_form_field form 'price_type' 'Price' %}
 
 <h2>Camper details</h2>
- <input type="submit" id="id_use_existing_btn" value="Use previous data" style="display:none; float: right;">
+ <input type="submit" class="use_existing_btn" value="Use previous data" style="display:none; float: right;">
 {% cciw_form_field form 'first_name' 'First name' %}
 {% cciw_form_field form 'last_name' 'Surname' %}
 {% cciw_form_field form 'sex' 'Sex' %}
 {% cciw_form_field form 'dietary_requirements' 'Dietary requirements' %}
 
 <h2>GP details</h2>
+ <input type="submit" class="use_existing_btn" value="Use previous data" style="display:none; float: right;">
 
 <p>Please enter the details of the camper's GP:</p>
 
 </div>
 <div class="popupbody">
 <p>You can copy information previously entered to save time. Please check
- the data after using this to ensure it is all up to date.</p>
+ the data after using this to ensure it is all up to date.
+ <b>NB: This will overwrite existing data on this form!</b>
+</p>
 
 <table>
 <tr>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.