Browse Source

Another attempt at fxing the mailer

development
Godwin 8 years ago
parent
commit
433afaffe6
  1. 22
      app/assets/stylesheets/_application.scss
  2. 12
      app/controllers/application_controller.rb
  3. 8
      app/controllers/conferences_controller.rb
  4. 9
      app/views/conferences/admin/_schedule.html.haml

22
app/assets/stylesheets/_application.scss

@ -1136,14 +1136,16 @@ ul.warnings li,
margin: 1em 0 0;
padding: 0;
list-style: none;
border: 0.1em solid #EEE;
background-color: #F8F8F8;
// border: 0.1em solid #EEE;
// background-color: #F8F8F8;
a {
display: block;
padding: 0.5em 0.75em;
@include font-family(secondary);
border-bottom: 0.1em solid #CCC;
//@include font-family(secondary);
border: 0.1rem solid #EEE;
border-top: 0;
border-right: 0;
@include after {
display: none;
@ -1370,6 +1372,18 @@ ul.warnings li,
vertical-align: top;
}
}
.table-tr.new {
.table-th {
background-color: transparent;
border: 0;
}
.table-td {
background-color: transparent;
border: 0;
}
}
}
#main {

12
app/controllers/application_controller.rb

@ -130,7 +130,7 @@ class ApplicationController < LinguaFrancaApplicationController
logger.info exception.to_s
logger.info exception.backtrace.join("\n")
UserMailer.error_report(
UserMailer.delay.error_report(
"A JavaScript error has occurred",
report,
params[:message],
@ -138,7 +138,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
end
render json: {}
end
@ -185,7 +185,7 @@ class ApplicationController < LinguaFrancaApplicationController
# send and email if this is production
suppress(Exception) do
UserMailer.error_report(
UserMailer.delay.error_report(
"An error has occurred in #{Rails.env}",
nil,
exception.to_s,
@ -193,7 +193,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
end
# raise the error if we are in development so that we can debug it
@ -335,7 +335,7 @@ class ApplicationController < LinguaFrancaApplicationController
def i18n_exception(str, exception, locale, key)
# send and email if this is production
suppress(Exception) do
UserMailer.error_report(
UserMailer.delay.error_report(
"A missing translation found in #{Rails.env}",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str || 'nil'}</blockquote>",
exception.to_s,
@ -343,7 +343,7 @@ class ApplicationController < LinguaFrancaApplicationController
request,
params,
current_user,
).deliver_now! if Rails.env.preview? || Rails.env.production?
) if Rails.env.preview? || Rails.env.production?
logger.info "Missing translation found for: #{key}"
end
end

8
app/controllers/conferences_controller.rb

@ -387,12 +387,12 @@ class ConferencesController < ApplicationController
@email_sent = :edit
elsif params[:button] == 'test'
@email_sent = :test
UserMailer.broadcast(
UserMailer.delay.broadcast(
"#{request.protocol}#{request.host_with_port}",
@subject,
@content,
current_user,
@this_conference).deliver_now!
@this_conference)
elsif params[:button] == 'preview'
@email_sent = :preview
elsif params[:button] == 'send'
@ -1001,12 +1001,12 @@ class ConferencesController < ApplicationController
@broadcast_step = :preview
elsif params[:button] == 'test'
@broadcast_step = :test
UserMailer.broadcast(
UserMailer.delay.broadcast(
"#{request.protocol}#{request.host_with_port}",
@subject,
@body,
current_user,
@this_conference).deliver_now!
@this_conference)
end
return render 'conferences/register'
when 'locations'

9
app/views/conferences/admin/_schedule.html.haml

@ -1,17 +1,18 @@
.table.workshop-blocks
.table-tr
.table-tr.header
.table-th=_'forms.labels.generic.block_number'
.table-th=_'forms.labels.generic.time'
.table-th=_'forms.labels.generic.length'
.table-th=_'forms.labels.generic.days'
.table-th.form
- @workshop_blocks.each_with_index do | info, block |
= form_tag administration_update_path(@this_conference.slug, :schedule), class: 'table-tr' do
.table-th.center.big=(block + 1)
- is_new = info['time'].blank?
= form_tag administration_update_path(@this_conference.slug, :schedule), class: ['table-tr', is_new ? 'new' : 'saved'] do
.table-th.center.big= is_new ? '' : (block + 1)
.table-td=time_select info['time'], small: true, label: false
.table-td=length_select info['length'], {small: true, label: false}, 0.5, 2
.table-td=checkboxes :days, @block_days, info['days'].map(&:to_i), 'date.day_names', vertical: true, small: true
.table-td.form
= hidden_field_tag :workshop_block, block
= button_tag :delete_block, value: :delete_block, class: [:small, :delete] if block == @workshop_blocks.length - 2
= button_tag (info['time'].present? ? :update_block : :add_block), value: :save_block, class: [:small, :add]
= button_tag (is_new ? :add_block : :update_block), value: :save_block, class: [:small, :add]

Loading…
Cancel
Save