caboose-cms 0.9.19 → 0.9.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd1a1d7bb01139d692c5ea699b110b583c58e699
4
- data.tar.gz: 8cfe600f087feb342822b04e1e2b56d3d0302768
3
+ metadata.gz: d65662059d99a76d7ddcd7aec3b7103266bcd7b2
4
+ data.tar.gz: 5374e50d8d027c0fa0be6296efa79797e426cd03
5
5
  SHA512:
6
- metadata.gz: 82d1c40bc05d740ef7cbfc7999659b4dd354040deaf5412136e3b48f8c9efbb8ce3e71d0d07c9cfa993ea4e710917a416bed466d08c172b383904691dbda9329
7
- data.tar.gz: b986be6897527d8d79997b8ac7ef1a435a7ce23e6af94a6e15a9c3a6197375ea11b3a04b21f32a0bda255b4c2207cad88a727417663a61890118d90d5f5f7364
6
+ metadata.gz: f9719d772e11d46e2de4f9b3cf7ace2d8818b1eb32cee6c7f5aebb2a503ec6029aab1f968d45d62dbea26b054831d17deb5d6d1edd5c79e9645a56480574963a
7
+ data.tar.gz: ec11cf49c859ea8886ec26afc0801c5873abebd44c2dc5d4f6e56c0eebdfde72319a40554fc8f96bc820a09da6aa32d76f4427a3613f4090ed128fd9b3ac30ee
@@ -141,6 +141,7 @@ module Caboose
141
141
  end
142
142
  end
143
143
  li.save
144
+ li.invoice.reload # Reload invoice in case li.quantity changed
144
145
  li.invoice.calculate
145
146
  resp.success = true
146
147
  render :json => resp
@@ -35,7 +35,16 @@ module Caboose
35
35
  resp.success = true
36
36
  render :json => resp
37
37
  end
38
-
38
+
39
+ # @route DELETE /admin/event-groups/:id
40
+ def admin_delete
41
+ return unless user_is_allowed('calendars', 'delete')
42
+ CalendarEvent.where(:calendar_event_group_id => params[:id]).destroy_all
43
+ CalendarEventGroup.find(params[:id]).destroy
44
+ resp = StdClass.new({ 'redirect' => "/admin/calendars" })
45
+ render :json => resp
46
+ end
47
+
39
48
  # @route GET /admin/event-groups/period-options
40
49
  def admin_period_options
41
50
  render :json => [
@@ -176,9 +176,11 @@ module Caboose
176
176
  return
177
177
  end
178
178
 
179
- pdf = InvoicePdf.new
180
- pdf.invoice = Invoice.find(params[:id])
181
- send_data pdf.to_pdf, :filename => "invoice_#{pdf.invoice.id}.pdf", :type => "application/pdf", :disposition => "inline"
179
+ pdf = @site.store_config.custom_invoice_pdf
180
+ pdf = "InvoicePdf" if pdf.nil? || pdf.strip.length == 0
181
+ eval("pdf = #{pdf}.new")
182
+ pdf.invoice = Invoice.find(params[:id])
183
+ send_data pdf.to_pdf, :filename => "invoice_#{pdf.invoice.id}.pdf", :type => "application/pdf", :disposition => "inline"
182
184
  end
183
185
 
184
186
  # @route GET /my-account/invoices/authnet-relay
@@ -48,8 +48,9 @@ g = @event.calendar_event_group
48
48
 
49
49
  <div id='message'></div>
50
50
  <p>
51
- <input type='button' value='Close' onclick="modal.close();" />
52
- <input type='button' value='Delete Event' onclick="delete_event(<%= @event.id %>);" />
51
+ <input type='button' value='Close' onclick="modal.close();" />
52
+ <input type='button' value='Delete Event' onclick="delete_event(<%= @event.id %>);" />
53
+ <input type='button' value='Delete Event Group' onclick="delete_event_group(<%= @event.id %>);" />
53
54
  </p>
54
55
 
55
56
  <% content_for :caboose_js do %>
@@ -125,6 +126,28 @@ function delete_event(event_id, confirm)
125
126
  });
126
127
  }
127
128
 
129
+ function delete_event_group(event_id, confirm)
130
+ {
131
+ if (!confirm)
132
+ {
133
+ var p = $('<p/>').addClass('note confirm')
134
+ .append('Are you sure you want to delete the event group? ')
135
+ .append($('<input/>').attr('type','button').val('Yes').click(function() { delete_event_group(event_id, true); })).append(' ')
136
+ .append($('<input/>').attr('type','button').val('No').click(function() { $('#message').empty(); }));
137
+ modal.autosize(p);
138
+ return;
139
+ }
140
+ modal.autosize("<p class='loading'>Deleting event group...</p>");
141
+ $.ajax({
142
+ url: '/admin/event-groups/<%= g.id %>',
143
+ type: 'delete',
144
+ success: function(resp) {
145
+ if (resp.error) modal.autosize("<p class='note error'>" + resp.error + "</p>");
146
+ if (resp.redirect) modal.close();
147
+ }
148
+ });
149
+ }
150
+
128
151
  function after_all_day_update()
129
152
  {
130
153
  var el = $('#datetime_container');
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.19'
2
+ VERSION = '0.9.20'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.19
4
+ version: 0.9.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg